結果

問題 No.799 赤黒かーどげぇむ
ユーザー ducktailducktail
提出日時 2019-07-30 16:57:27
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 19 ms / 2,000 ms
コード長 297 bytes
コンパイル時間 29 ms
コンパイル使用メモリ 5,212 KB
実行使用メモリ 11,912 KB
最終ジャッジ日時 2023-09-18 08:51:51
合計ジャッジ時間 2,594 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
11,720 KB
testcase_01 AC 19 ms
11,896 KB
testcase_02 AC 19 ms
11,708 KB
testcase_03 AC 19 ms
11,712 KB
testcase_04 AC 18 ms
11,620 KB
testcase_05 AC 19 ms
11,724 KB
testcase_06 AC 18 ms
11,864 KB
testcase_07 AC 19 ms
11,900 KB
testcase_08 AC 19 ms
11,896 KB
testcase_09 AC 19 ms
11,912 KB
testcase_10 AC 19 ms
11,616 KB
testcase_11 AC 18 ms
11,628 KB
testcase_12 AC 19 ms
11,756 KB
testcase_13 AC 19 ms
11,760 KB
testcase_14 AC 18 ms
11,872 KB
testcase_15 AC 19 ms
11,728 KB
testcase_16 AC 19 ms
11,772 KB
testcase_17 AC 18 ms
11,788 KB
testcase_18 AC 18 ms
11,888 KB
testcase_19 AC 19 ms
11,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (solve a b c d)
  (let ([n (max 0 (- (min b d) (max a c) -1))]
        [ab (- b a -1)]
        [cd (- d c -1)])
    (+ (* n (- cd 1)) (* (- ab n) cd))))

(define (main args)
  (let* ([a (read)]
         [b (read)]
         [c (read)]
         [d (read)])
    (print (solve a b c d)))
  0)
0