No.8037 Restricted Lucas (Hard)
レベル :
/ 実行時間制限 : 1ケース 2.000秒 / メモリ制限
: 256 MB / スペシャルジャッジ問題 (複数の解が存在する可能性があります)
タグ : / 解いたユーザー数 28
作問者 :
ciel
タグ : / 解いたユーザー数 28
作問者 :
問題文最終更新日: 2020-04-01 19:14:29
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
yukicoder April fool contest 2018
(順位表)
の他の問題:
Problem Statement
The Lucas sequence is the sequence
L(0)=2,L(1)=1,L(2)=3,L(3)=4,L(4)=7,...
satisfying L(N+2)=L(N)+L(N+1).
Find the N-th term of this sequence modulo 1000000007. However, the following characters are forbidden from appearing in your source code.
0 1 2 3 4 5 6 7 8 9 " ' \ * / % + -
The time limit is the same, but the upper limit of T (the number of cases) is set significantly lower.
Input
T N1 N2 … NT
T: the number of cases
Ni (1<=i<=T): the index of the term of the Lucas sequence to find
1 <= T <= 10
1 <= Ni <= 2000000000
Output
For each line, output the Ni-th term of the Lucas sequence modulo 1000000007.
Print a newline at the end.
Sample
Sample 1
Input
3 10 43 2000000000
Output
123 969323029 2207
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。