結果

問題 No.149 碁石の移動
ユーザー pekempey
提出日時 2016-06-23 17:08:44
言語 Scheme
(Gauche-0.9.15)
結果
AC  
実行時間 25 ms / 2,000 ms
コード長 320 bytes
コンパイル時間 54 ms
コンパイル使用メモリ 5,248 KB
実行使用メモリ 16,128 KB
最終ジャッジ日時 2024-12-24 03:17:09
合計ジャッジ時間 1,260 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

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