結果

問題 No.149 碁石の移動
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-06 22:34:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 601 bytes
コンパイル時間 1,762 ms
コンパイル使用メモリ 70,976 KB
実行使用メモリ 56,360 KB
最終ジャッジ日時 2023-08-25 17:31:15
合計ジャッジ時間 4,532 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
56,088 KB
testcase_01 AC 113 ms
56,104 KB
testcase_02 AC 110 ms
55,632 KB
testcase_03 AC 112 ms
55,900 KB
testcase_04 AC 114 ms
55,736 KB
testcase_05 AC 111 ms
55,820 KB
testcase_06 AC 111 ms
55,620 KB
testcase_07 AC 116 ms
56,012 KB
testcase_08 AC 120 ms
55,952 KB
testcase_09 AC 115 ms
56,132 KB
testcase_10 AC 111 ms
55,648 KB
testcase_11 AC 111 ms
55,620 KB
testcase_12 AC 114 ms
55,572 KB
testcase_13 AC 109 ms
56,360 KB
testcase_14 AC 111 ms
56,028 KB
testcase_15 AC 109 ms
55,912 KB
testcase_16 AC 111 ms
55,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner koko = new Scanner(System.in);
       int aw = koko.nextInt();
       int ab = koko.nextInt();
       int bw = koko.nextInt();
       int bb = koko.nextInt();
       int c = koko.nextInt();
       int d = koko.nextInt();
       int minus, plus;
       if(ab>c){
           minus = 0;
       }else{
           minus = c-ab;
       }
       if((bw+minus)>=d){
           plus = d;
       }else{
           plus = bw + minus;
       }
       System.out.println(aw-minus+plus);
    }
}
0