結果

問題 No.70 睡眠の重要性!
ユーザー neko_the_shadowneko_the_shadow
提出日時 2017-01-15 20:40:48
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 20 ms / 5,000 ms
コード長 844 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 5,380 KB
実行使用メモリ 11,936 KB
最終ジャッジ日時 2023-08-23 11:16:37
合計ジャッジ時間 841 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
11,872 KB
testcase_01 AC 20 ms
11,900 KB
testcase_02 AC 18 ms
11,788 KB
testcase_03 AC 19 ms
11,700 KB
testcase_04 AC 19 ms
11,936 KB
testcase_05 AC 19 ms
11,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(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))
0