結果
問題 |
No.176 2種類の切手
|
ユーザー |
|
提出日時 | 2016-09-05 14:06:19 |
言語 | Python2 (2.7.18) |
結果 |
RE
|
実行時間 | - |
コード長 | 246 bytes |
コンパイル時間 | 63 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 7,168 KB |
最終ジャッジ日時 | 2024-11-15 20:27:01 |
合計ジャッジ時間 | 1,698 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 RE * 5 |
ソースコード
A, B, T = map(int, raw_input().split()) mem = {} def rec(t): if t < 0: return 0 if t%A==0 or t%B==0: return t if t in mem: return mem[t] mem[t] = min(rec(t-A)+A, rec(t-B)+B) return mem[t] print rec(T)