結果
問題 |
No.314 ケンケンパ
|
ユーザー |
![]() |
提出日時 | 2018-12-13 10:53:17 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 959 ms / 1,000 ms |
コード長 | 356 bytes |
コンパイル時間 | 228 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-09-25 04:16:33 |
合計ジャッジ時間 | 4,878 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
N = int(input()) a = 1 b = 1 c = 0 a_tmp = 0 b_tmp = 0 c_tmp = 0 d = 0 if N == 1: print(1) elif N == 2: print(2) else: for i in range(N-2): a_tmp,b_tmp,c_tmp = a,b,c a = c_tmp % (10**9 + 7) b = (a_tmp % (10**9 + 7))+(c_tmp % (10**9 + 7)) c = (b_tmp % (10**9 + 7)) d = (a + b + c)%(10**9 + 7) print(d)