結果

問題 No.149 碁石の移動
ユーザー ffmm00ffmm00
提出日時 2015-06-10 20:22:23
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 432 bytes
コンパイル時間 5,273 ms
コンパイル使用メモリ 71,680 KB
実行使用メモリ 56,304 KB
最終ジャッジ日時 2023-08-25 17:36:12
合計ジャッジ時間 6,776 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,920 KB
testcase_01 AC 118 ms
56,100 KB
testcase_02 AC 118 ms
55,936 KB
testcase_03 AC 119 ms
56,056 KB
testcase_04 AC 119 ms
56,056 KB
testcase_05 AC 123 ms
56,100 KB
testcase_06 AC 121 ms
55,704 KB
testcase_07 AC 121 ms
55,892 KB
testcase_08 AC 122 ms
55,664 KB
testcase_09 AC 121 ms
55,552 KB
testcase_10 AC 120 ms
55,792 KB
testcase_11 AC 122 ms
56,092 KB
testcase_12 AC 123 ms
56,304 KB
testcase_13 AC 123 ms
56,176 KB
testcase_14 AC 121 ms
55,808 KB
testcase_15 AC 121 ms
55,896 KB
testcase_16 AC 121 ms
56,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class N149 {

	public static void main(String[] args) {

		Scanner sca = new Scanner(System.in);
		int Aw = sca.nextInt();
		int Ab = sca.nextInt();
		int Bw = sca.nextInt();
		int Bb = sca.nextInt();
		int c = sca.nextInt();
		int d = sca.nextInt();

		if (Ab < c) {
			Aw = Aw - (c - Ab);
			Bw = Bw + (c - Ab);
		}

		if (Bw > d)
			Aw += d;
		else
			Aw += Bw;

		System.out.println(Aw);

	}

}
0