結果
| 問題 | No.70 睡眠の重要性! |
| コンテスト | |
| ユーザー |
neko_the_shadow
|
| 提出日時 | 2017-01-15 20:40:48 |
| 言語 | Scheme (Gauche-0.9.15) |
| 結果 |
AC
|
| 実行時間 | 17 ms / 5,000 ms |
| コード長 | 844 bytes |
| 記録 | |
| コンパイル時間 | 79 ms |
| コンパイル使用メモリ | 6,528 KB |
| 実行使用メモリ | 16,256 KB |
| 最終ジャッジ日時 | 2026-05-28 05:58:58 |
| 合計ジャッジ時間 | 866 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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