結果
問題 |
No.634 硬貨の枚数1
|
ユーザー |
![]() |
提出日時 | 2021-01-28 22:11:53 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 236 bytes |
コンパイル時間 | 316 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 131,200 KB |
最終ジャッジ日時 | 2024-06-26 06:06:02 |
合計ジャッジ時間 | 6,218 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 TLE * 1 -- * 62 |
ソースコード
N = int(input()) cnt = [N+1] * (N+1) i = 1 add = 1 while i <= N: cnt[i] = 1 for j in range(1, i + 1): if i + j > N: break cnt[i+j] = min(cnt[i+j], cnt[j] + 1) add += 1 i += add print(cnt[N])