結果

問題 No.149 碁石の移動
ユーザー takeya_okinotakeya_okino
提出日時 2017-06-22 16:12:45
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 397 bytes
コンパイル時間 2,101 ms
コンパイル使用メモリ 74,132 KB
実行使用メモリ 56,428 KB
最終ジャッジ日時 2024-04-10 10:29:22
合計ジャッジ時間 5,345 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
54,148 KB
testcase_01 AC 134 ms
54,232 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 136 ms
53,924 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 137 ms
54,232 KB
testcase_08 AC 138 ms
54,040 KB
testcase_09 AC 137 ms
54,380 KB
testcase_10 AC 135 ms
53,964 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 133 ms
53,924 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public 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 c = sc.nextInt();
    int d = sc.nextInt();
    int ans = aw;
    ans -= Math.max(0, c - ab);
    ans += Math.min(bw, d);
    System.out.println(ans);
  }
}
0