結果

問題 No.314 ケンケンパ
ユーザー hanorver
提出日時 2016-02-03 17:08:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 48 ms / 1,000 ms
コード長 174 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 82,364 KB
実行使用メモリ 57,984 KB
最終ジャッジ日時 2024-09-21 20:09:15
合計ジャッジ時間 1,735 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
if n==1:print(1)
elif n==2 or n==3:print(2)
else:
 k=kk=kkk=1
 for i in range(n-3):
  t=k
  k=kk+kkk
  kkk=kk
  kk=t
  k%=1000000007
 print((k+kk)%1000000007)
0