結果
| 問題 |
No.70 睡眠の重要性!
|
| コンテスト | |
| ユーザー |
neko_the_shadow
|
| 提出日時 | 2017-01-15 20:40:48 |
| 言語 | Scheme (Gauche-0.9.15) |
| 結果 |
AC
|
| 実行時間 | 23 ms / 5,000 ms |
| コード長 | 844 bytes |
| コンパイル時間 | 56 ms |
| コンパイル使用メモリ | 6,948 KB |
| 実行使用メモリ | 16,128 KB |
| 最終ジャッジ日時 | 2024-12-21 13:45:52 |
| 合計ジャッジ時間 | 822 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 |
ソースコード
(define (input->list)
(let ((n (string->number (read-line))))
(let loop ((cnt n)
(ls '()))
(if (zero? cnt)
ls
(loop (- cnt 1)
(cons (map string->number
(string-split (read-line) #[:#\space]))
ls))))))
(define (solve)
(let loop ((items (input->list)) (sum 0))
(if (null? items)
sum
(receive
(h1 m1 h2 m2)
(apply values (car items))
(let* ((min1 (+ (* h1 60) m1))
(min2 (+ (* h2 60) m2))
(diff (- min2 min1))
(duration (if (> diff 0) diff (+ 1440 diff))))
(loop (cdr items) (+ sum duration)))))))
(print (solve))
neko_the_shadow