結果

問題 No.561 東京と京都
ユーザー ducktailducktail
提出日時 2018-01-01 21:13:35
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 18 ms / 2,000 ms
コード長 536 bytes
コンパイル時間 115 ms
コンパイル使用メモリ 5,296 KB
実行使用メモリ 13,864 KB
最終ジャッジ日時 2023-08-24 15:43:59
合計ジャッジ時間 1,922 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
11,764 KB
testcase_01 AC 17 ms
11,832 KB
testcase_02 AC 17 ms
11,636 KB
testcase_03 AC 17 ms
11,692 KB
testcase_04 AC 16 ms
11,752 KB
testcase_05 AC 17 ms
11,840 KB
testcase_06 AC 17 ms
11,756 KB
testcase_07 AC 16 ms
11,780 KB
testcase_08 AC 17 ms
11,672 KB
testcase_09 AC 17 ms
11,744 KB
testcase_10 AC 17 ms
11,660 KB
testcase_11 AC 18 ms
11,760 KB
testcase_12 AC 17 ms
11,780 KB
testcase_13 AC 17 ms
11,808 KB
testcase_14 AC 17 ms
11,720 KB
testcase_15 AC 17 ms
13,864 KB
testcase_16 AC 17 ms
11,688 KB
testcase_17 AC 17 ms
11,696 KB
testcase_18 AC 18 ms
11,804 KB
testcase_19 AC 17 ms
11,780 KB
testcase_20 AC 17 ms
11,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (main args)
  (let* ([n (read)]
         [d (read)])
    (print
     (let loop ([c n]
                [tm 0]
                [km -1000000000])
       (cond [(zero? c) (max tm km)]
             [else (let* ([t (read)]
                          [k (read)])
                     (loop (- c 1)
                           (max
                            (+ tm t)
                            (- (+ km t) d))
                           (max
                            (+ km k)
                            (- (+ tm k) d))))]))))
  0)
0