結果

問題 No.149 碁石の移動
ユーザー kou6839kou6839
提出日時 2015-02-22 23:11:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 378 bytes
コンパイル時間 3,348 ms
コンパイル使用メモリ 71,892 KB
実行使用メモリ 55,956 KB
最終ジャッジ日時 2023-08-25 17:27:36
合計ジャッジ時間 5,300 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,768 KB
testcase_01 AC 120 ms
55,540 KB
testcase_02 AC 121 ms
55,576 KB
testcase_03 AC 120 ms
55,564 KB
testcase_04 AC 120 ms
55,700 KB
testcase_05 AC 122 ms
55,836 KB
testcase_06 AC 120 ms
55,932 KB
testcase_07 AC 120 ms
55,568 KB
testcase_08 AC 120 ms
55,756 KB
testcase_09 AC 119 ms
55,704 KB
testcase_10 AC 119 ms
55,760 KB
testcase_11 AC 120 ms
55,624 KB
testcase_12 AC 120 ms
55,880 KB
testcase_13 AC 121 ms
55,956 KB
testcase_14 AC 120 ms
55,748 KB
testcase_15 AC 119 ms
55,952 KB
testcase_16 AC 118 ms
55,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.*;
import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int aw=sc.nextInt();
		int ab=sc.nextInt();
		int bw=sc.nextInt();
		int bb=sc.nextInt();
		int f=sc.nextInt();
		int s=sc.nextInt();
		int temp=Math.max(0, f-ab);
		aw-=temp;
		bw+=temp;
		aw+=Math.min(bw, s);
		System.out.println(aw);
	}
}
0