結果

問題 No.314 ケンケンパ
ユーザー mlihua09mlihua09
提出日時 2020-08-27 19:52:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 43 ms / 1,000 ms
コード長 190 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 82,856 KB
実行使用メモリ 58,848 KB
最終ジャッジ日時 2024-04-25 14:58:23
合計ジャッジ時間 1,550 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
58,848 KB
testcase_01 AC 37 ms
52,072 KB
testcase_02 AC 37 ms
52,124 KB
testcase_03 AC 34 ms
53,716 KB
testcase_04 AC 35 ms
52,628 KB
testcase_05 AC 34 ms
52,508 KB
testcase_06 AC 33 ms
52,928 KB
testcase_07 AC 33 ms
52,264 KB
testcase_08 AC 33 ms
51,756 KB
testcase_09 AC 33 ms
52,968 KB
testcase_10 AC 34 ms
53,244 KB
testcase_11 AC 33 ms
52,364 KB
testcase_12 AC 33 ms
52,796 KB
testcase_13 AC 36 ms
52,412 KB
testcase_14 AC 38 ms
57,728 KB
testcase_15 AC 37 ms
58,000 KB
testcase_16 AC 38 ms
58,560 KB
testcase_17 AC 37 ms
58,448 KB
testcase_18 AC 38 ms
58,300 KB
testcase_19 AC 41 ms
57,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

P = 10 ** 9 + 7

x = 1

y = 0

z = 1

N = int(input()) 

if N == 1:
    
    print(1)
    
    exit()

for i in range(N - 2):
    
    x, y, z = y, z, (x + y) % P
    
print((x + y + z) % P)
0