FIB64 - 64bit-Fibonacci
Warning
This task is intended to help people to debug their codes and try speed experiments.
The task is the same as in some known problems, but with new constraints and speed goal.
The Fibonacci sequence is defined for any positive integer by : If N<2: Fib(N)=N, else Fib(N)=Fib(N-1)+Fib(N-2)
You have the task of being the fastest to compute Fib(N) mod M.
Input
The input consists of 500,000 lines. In each the 500,000 lines there are two integers N, M. You don't need to read the whole input, only some lines to get some points. You should begin with one line, then 10, then 100, ...
Output
For as many test cases you can, on a single line, print Fib(N) mod M.
Example
Input: 5 4 5 5 5 6 [...] Output: 1 0 5
Constraints
0 <= N <= 10^18 2 <= M <= 10^18
Score
As in the example, if you can output the 3 first correct answers, your score will be 3 points. No need to solve all the input, the minimum is 1 ; every solver in any language will be able to check his FIB64-speed.
hide comments
Pranet Verma:
2013-06-03 01:24:54
i keep getting WA for some reason. its refusing to accept even for the first input line. can u please state the first line of the input? think im stuck due to constraints
|
|
Arika Saputro:
2013-05-10 10:43:48
i use ME and tle, is it must use montgomery to get ac?
|
|
[Lakshman]:
2013-04-30 12:58:59
Francky Please help me why WA again , I am trying to solve this problem for last 10 days but getting WA..again and again..I have tried several methods for solving this problem as well other Fibonacci problems and I got AC with same algo but can't figure out why getting WA here, Please help..
|
|
Michael Kharitonov:
2013-03-25 07:11:31
First to reach the limit:)
|
|
Michael Kharitonov:
2013-03-20 11:18:58
I am getting close to the end of input;-)
|
|
Francky:
2013-02-27 17:36:47
@ Michael Kharitonov : I don't know what to answer. Just many thanks for your great participation, I hope you'll enjoy my new challenge, and that all the 'fun' will join the party.
|
|
Michael Kharitonov:
2013-02-26 12:24:38
All the fun moved to the next Francky's problem( |
|
Francky:
2013-02-08 14:18:24
For your information my initial 331B python3 code get 10600 points with this new judge. |
|
(Tjandra Satria Gunawan)(曾毅昆):
2013-02-08 02:12:13
I just get VERY small points like an epsilon :-(
|
|
Francky:
2013-02-08 00:10:32
Here is the new judge, new data, but I failed with masterJudge tuning. It will be for another problem, I need some tests to read time of submissions.
|
Added by: | Francky |
Date: | 2013-01-20 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | Own problem |