結果
| 問題 | No.45 回転寿司 |
| ユーザー |
_Clay____
|
| 提出日時 | 2018-09-15 22:16:30 |
| 言語 | Scheme (Gauche-0.9.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 564 bytes |
| 記録 | |
| コンパイル時間 | 140 ms |
| コンパイル使用メモリ | 7,972 KB |
| 実行使用メモリ | 37,064 KB |
| 最終ジャッジ日時 | 2026-04-01 23:25:03 |
| 合計ジャッジ時間 | 12,605 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 4 |
| other | TLE * 1 -- * 29 |
ソースコード
(let* ((n (string->number (read-line)))
(v (list->vector(map string->number (string-split (read-line) " ")))))
(letrec ((calc-max
(lambda (i)
(cond
((eq? i 1) (vector-ref v 0))
((eq? i 2) (max (vector-ref v 0) (vector-ref v 1)))
(else (max
(calc-max (- i 1))
(+ (vector-ref v (- i 1))
(calc-max (- i 2)))))))))
(print (calc-max n))))
_Clay____