結果

問題 No.149 碁石の移動
ユーザー ffmm00
提出日時 2015-06-10 20:22:23
言語 Java
(openjdk 23)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 432 bytes
コンパイル時間 3,227 ms
コンパイル使用メモリ 74,036 KB
実行使用メモリ 41,260 KB
最終ジャッジ日時 2024-12-24 03:08:14
合計ジャッジ時間 6,006 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

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