結果
問題 |
No.634 硬貨の枚数1
|
ユーザー |
|
提出日時 | 2018-01-19 23:12:53 |
言語 | Scheme (Gauche-0.9.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 454 bytes |
コンパイル時間 | 266 ms |
コンパイル使用メモリ | 5,248 KB |
実行使用メモリ | 303,360 KB |
最終ジャッジ日時 | 2024-12-25 20:09:15 |
合計ジャッジ時間 | 150,356 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 TLE * 48 |
ソースコード
(define (main args) (let* ([n (read)] [mv (vector-tabulate (+ n 1) identity)]) (let loop ([k 2] [c 3] [i 3]) (cond [(> c n) #t] [(> i n) (loop (+ k 1) (quotient (* (+ k 1) (+ k 2)) 2) (quotient (* (+ k 1) (+ k 2)) 2))] [else (vector-set! mv i (min (vector-ref mv i) (+ 1 (vector-ref mv (- i c))))) (loop k c (+ i 1))])) (print (vector-ref mv n)) ) 0)