結果

問題 No.149 碁石の移動
ユーザー GrenacheGrenache
提出日時 2015-09-23 21:46:22
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 500 bytes
コンパイル時間 4,377 ms
コンパイル使用メモリ 72,096 KB
実行使用メモリ 56,168 KB
最終ジャッジ日時 2023-08-25 17:40:41
合計ジャッジ時間 7,012 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,924 KB
testcase_01 AC 117 ms
56,116 KB
testcase_02 AC 119 ms
55,760 KB
testcase_03 AC 120 ms
55,928 KB
testcase_04 AC 120 ms
56,004 KB
testcase_05 AC 123 ms
56,032 KB
testcase_06 AC 118 ms
56,128 KB
testcase_07 AC 119 ms
56,088 KB
testcase_08 AC 120 ms
56,084 KB
testcase_09 AC 121 ms
56,056 KB
testcase_10 AC 120 ms
55,800 KB
testcase_11 AC 120 ms
56,148 KB
testcase_12 AC 120 ms
55,504 KB
testcase_13 AC 119 ms
55,888 KB
testcase_14 AC 117 ms
56,144 KB
testcase_15 AC 119 ms
56,056 KB
testcase_16 AC 119 ms
56,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder149 {

    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 c = sc.nextInt();
        int d = sc.nextInt();

        int tmp = Math.max(0, c - ab);
        int ret = Math.min(bw + tmp, d) + aw - tmp;

        System.out.println(ret);
        
        sc.close();
    }
}
0