結果

問題 No.149 碁石の移動
ユーザー shinwisteriashinwisteria
提出日時 2019-01-24 21:02:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 459 bytes
コンパイル時間 3,110 ms
コンパイル使用メモリ 71,600 KB
実行使用メモリ 56,492 KB
最終ジャッジ日時 2023-10-14 09:44:12
合計ジャッジ時間 6,044 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
56,288 KB
testcase_01 AC 122 ms
56,056 KB
testcase_02 AC 121 ms
56,408 KB
testcase_03 AC 121 ms
56,140 KB
testcase_04 AC 119 ms
56,308 KB
testcase_05 AC 120 ms
55,748 KB
testcase_06 AC 120 ms
55,828 KB
testcase_07 AC 119 ms
56,492 KB
testcase_08 AC 120 ms
55,900 KB
testcase_09 AC 120 ms
56,280 KB
testcase_10 AC 120 ms
55,768 KB
testcase_11 AC 121 ms
55,508 KB
testcase_12 AC 121 ms
55,992 KB
testcase_13 AC 120 ms
55,864 KB
testcase_14 AC 121 ms
56,044 KB
testcase_15 AC 123 ms
55,608 KB
testcase_16 AC 121 ms
56,048 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class No149 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int aw = s.nextInt() , ab = s.nextInt() , bw = s.nextInt() , bb = s.nextInt() , c = s.nextInt() , d = s.nextInt();
		s.close();

		if(Math.min(ab, c) == ab){
			aw -= c - ab;
			bw += c - ab;
			bb = ab;
		}else{
			bb = c;
		}
		if(Math.min(bw, d) == bw){
			aw += bw;
		}else{
			aw += d;
		}
		System.out.println(aw);


	}

}
0