https://www.codechef.com/viewsolution/26625992
Here is the fixed answer
I just did this
ll index=pow(2,y);
//cout<<index<<endl;
cout<<findLastDigit(index%60 -1)<<endl;
https://www.codechef.com/viewsolution/26625992
Here is the fixed answer
I just did this
ll index=pow(2,y);
//cout<<index<<endl;
cout<<findLastDigit(index%60 -1)<<endl;
I know it’s dumb to ask because I’m beginner in ds and algo. Where you learnt that 10^8 is max memory allocation for the array?
Honestly… i think i read somewhere on internet…i don’t remember where 
Maximum size of the array: We must be knowing that the maximum size of array declared inside the main function is of the order of 10^6 but if you declare array globally then you can declare its size upto 10^7
Ref: Geeksforgeeks
Use exp2l() function, Its better than pow() function.
cin >> n;
n = log2l(n);
n = exp2l(n) - 1;
cout << f[n % 60] << "\n";
You can use up to 10^8. I also read it somewhere 
But that you have to declare globally. And I also tried it creating the global array with size 10^8. And up to 10^6 is advised inside the function.
Although the size of array also depends upon whether you want to create integer array or character array. Along with that it also depends on your hardware.
Using log2() will give WA for the following testcase:
1
18014398509481983
Output should be 9.
have you even tried on his solution?
works fine riNeF6 - Online C++0x Compiler & Debugging Tool - Ideone.com
Got it. I was doing index-1 % 60. Cheers.
Was meant as an announcement for the people who were wondering why log2() was not working, I’m the problem setter. Replied on your comment by mistake, this wasn’t supposed to be a reply.
That’s awesome ! 
How did you come up with this logic bro:)
by observing the pattern while doing { \mod}10
Yes by observing the pattern. I checked manually for the small nos. And verified the logic using python (it allows you to work with very very large nos. Easily) and after that I gave it a try.
This will help you alot : Easy Fibonacci | September long challenge 2019 | Codechef Solutions & Code || FIBEASY | Hello World - YouTube
This will help you alot : Easy Fibonacci | September long challenge 2019 | Codechef Solutions & Code || FIBEASY | Hello World - YouTube
thanks