結果

問題 No.149 碁石の移動
ユーザー TatsuDXTatsuDX
提出日時 2016-09-09 00:01:51
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 394 bytes
コンパイル時間 3,433 ms
コンパイル使用メモリ 73,116 KB
実行使用メモリ 57,504 KB
最終ジャッジ日時 2023-08-25 17:47:49
合計ジャッジ時間 6,685 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
55,472 KB
testcase_01 AC 128 ms
55,544 KB
testcase_02 AC 126 ms
55,356 KB
testcase_03 AC 127 ms
55,680 KB
testcase_04 AC 129 ms
55,600 KB
testcase_05 AC 125 ms
55,816 KB
testcase_06 AC 126 ms
55,508 KB
testcase_07 AC 125 ms
55,652 KB
testcase_08 AC 124 ms
55,772 KB
testcase_09 AC 124 ms
57,504 KB
testcase_10 AC 125 ms
55,608 KB
testcase_11 AC 126 ms
55,500 KB
testcase_12 AC 124 ms
55,568 KB
testcase_13 AC 123 ms
55,768 KB
testcase_14 AC 124 ms
55,580 KB
testcase_15 AC 126 ms
56,012 KB
testcase_16 AC 126 ms
55,348 KB
権限があれば一括ダウンロードができます

ソースコード

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