結果

問題 No.149 碁石の移動
ユーザー TatsuDX
提出日時 2016-09-09 00:01:51
言語 Java
(openjdk 23)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 394 bytes
コンパイル時間 3,403 ms
コンパイル使用メモリ 73,924 KB
実行使用メモリ 41,320 KB
最終ジャッジ日時 2024-12-24 03:20:49
合計ジャッジ時間 6,384 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Test {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int aw, ab, bw, bb, x, y;
		aw = sc.nextInt();
		ab = sc.nextInt();
		bw = sc.nextInt();
		bb = sc.nextInt();
		x = sc.nextInt();
		y = sc.nextInt();
		bw += Math.max(0, x - ab);
		aw -= Math.max(0, x - ab);
		aw += Math.min(y, bw);
		System.out.println(aw);
	}
}
0