結果

問題 No.149 碁石の移動
ユーザー fal_rndfal_rnd
提出日時 2018-04-25 10:02:34
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 402 bytes
コンパイル時間 2,177 ms
コンパイル使用メモリ 72,364 KB
実行使用メモリ 56,188 KB
最終ジャッジ日時 2023-09-10 05:24:21
合計ジャッジ時間 5,471 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,976 KB
testcase_01 AC 119 ms
55,372 KB
testcase_02 AC 119 ms
55,700 KB
testcase_03 AC 120 ms
55,896 KB
testcase_04 AC 118 ms
56,052 KB
testcase_05 AC 118 ms
56,132 KB
testcase_06 AC 118 ms
55,888 KB
testcase_07 AC 119 ms
56,088 KB
testcase_08 AC 120 ms
56,188 KB
testcase_09 AC 120 ms
55,396 KB
testcase_10 AC 120 ms
55,540 KB
testcase_11 AC 119 ms
55,976 KB
testcase_12 AC 120 ms
55,396 KB
testcase_13 AC 121 ms
56,044 KB
testcase_14 AC 122 ms
55,648 KB
testcase_15 AC 119 ms
55,884 KB
testcase_16 AC 120 ms
55,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.util.stream.*;
class Main {
    static Scanner s=new Scanner(System.in);
    static int gInt(){return Integer.parseInt(s.next());}
    public static void main(String[]$){
        int aw=gInt(),ab=gInt(),bw=gInt(),bb=gInt(),c=gInt(),d=gInt();
        aw-=Math.max(0,c-ab);
        bw+=Math.max(0,c-ab);
        aw+=Math.min(d,bw);
        System.out.println(aw);
    }
}
0