結果

問題 No.149 碁石の移動
ユーザー pekempeypekempey
提出日時 2016-06-23 17:08:44
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 19 ms / 2,000 ms
コード長 320 bytes
コンパイル時間 116 ms
コンパイル使用メモリ 5,300 KB
実行使用メモリ 11,856 KB
最終ジャッジ日時 2023-08-25 17:44:39
合計ジャッジ時間 1,621 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
11,696 KB
testcase_01 AC 19 ms
11,660 KB
testcase_02 AC 18 ms
11,656 KB
testcase_03 AC 18 ms
11,704 KB
testcase_04 AC 19 ms
11,852 KB
testcase_05 AC 18 ms
11,672 KB
testcase_06 AC 18 ms
11,668 KB
testcase_07 AC 18 ms
11,708 KB
testcase_08 AC 18 ms
11,744 KB
testcase_09 AC 18 ms
11,704 KB
testcase_10 AC 18 ms
11,672 KB
testcase_11 AC 18 ms
11,672 KB
testcase_12 AC 17 ms
11,672 KB
testcase_13 AC 18 ms
11,740 KB
testcase_14 AC 18 ms
11,692 KB
testcase_15 AC 18 ms
11,856 KB
testcase_16 AC 17 ms
11,736 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (solve Aw Ab Bw Bb C D)
  (let* ((use-black (min C Ab)) (use-white (- C use-black)))
    (let ((Aw (- Aw use-white)) (Ab (- Ab use-black)) (Bw (+ Bw use-white)) (Bb (+ Bb use-black)))
      (let ((use-white (min D Bw)))
	(+ Aw use-white)))))

(display (solve (read) (read) (read) (read) (read) (read)))
(newline)
0