結果

問題 No.149 碁石の移動
ユーザー Mcpu3Mcpu3
提出日時 2018-09-19 15:20:33
言語 Java19
(openjdk 21)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 421 bytes
コンパイル時間 1,881 ms
コンパイル使用メモリ 71,064 KB
実行使用メモリ 56,300 KB
最終ジャッジ日時 2023-09-25 10:09:37
合計ジャッジ時間 4,940 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,916 KB
testcase_01 AC 125 ms
55,624 KB
testcase_02 AC 123 ms
55,360 KB
testcase_03 AC 124 ms
55,640 KB
testcase_04 AC 124 ms
56,144 KB
testcase_05 AC 124 ms
55,768 KB
testcase_06 AC 124 ms
55,556 KB
testcase_07 AC 123 ms
55,528 KB
testcase_08 AC 123 ms
56,224 KB
testcase_09 AC 125 ms
55,896 KB
testcase_10 AC 122 ms
56,092 KB
testcase_11 AC 122 ms
56,300 KB
testcase_12 AC 122 ms
55,848 KB
testcase_13 AC 125 ms
55,932 KB
testcase_14 AC 124 ms
55,720 KB
testcase_15 AC 124 ms
55,568 KB
testcase_16 AC 124 ms
55,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int aw=sc.nextInt(),ab=sc.nextInt(),bw=sc.nextInt(),bb=sc.nextInt(),c=sc.nextInt(),d=sc.nextInt();
        sc.close();
        if(ab<c){
            aw-=c-ab;
            bw+=c-ab;
        }
        if(bw>d)aw+=d;
        else aw+=bw;
        System.out.print(aw);
    }
}
0