結果
問題 |
No.44 DPなすごろく
|
ユーザー |
![]() |
提出日時 | 2020-01-02 22:48:39 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 32 ms / 5,000 ms |
コード長 | 438 bytes |
コンパイル時間 | 109 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-11-22 18:22:58 |
合計ジャッジ時間 | 1,752 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
import sys sys.setrecursionlimit(10 ** 6) int1 = lambda x: int(x) - 1 p2D = lambda x: print(*x, sep="\n") def MI(): return map(int, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def main(): n=int(input()) dp=[0]*(n+1) dp[0]=dp[1]=1 for i in range(2,n+1): dp[i]=dp[i-1]+dp[i-2] print(dp[n]) main()