結果

問題 No.149 碁石の移動
ユーザー yuppe19 😺yuppe19 😺
提出日時 2015-04-21 23:26:30
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 549 bytes
コンパイル時間 1,981 ms
コンパイル使用メモリ 72,268 KB
実行使用メモリ 57,892 KB
最終ジャッジ日時 2023-08-25 17:31:56
合計ジャッジ時間 4,935 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,816 KB
testcase_01 AC 121 ms
55,588 KB
testcase_02 AC 120 ms
55,816 KB
testcase_03 AC 120 ms
55,944 KB
testcase_04 AC 121 ms
55,876 KB
testcase_05 AC 118 ms
55,424 KB
testcase_06 AC 119 ms
55,760 KB
testcase_07 AC 121 ms
57,892 KB
testcase_08 AC 118 ms
55,648 KB
testcase_09 AC 119 ms
55,552 KB
testcase_10 AC 120 ms
55,572 KB
testcase_11 AC 119 ms
55,792 KB
testcase_12 AC 118 ms
55,924 KB
testcase_13 AC 121 ms
55,812 KB
testcase_14 AC 123 ms
55,828 KB
testcase_15 AC 125 ms
55,672 KB
testcase_16 AC 124 ms
53,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import static java.lang.Math.*;

public class Main {
    private void solve() {
        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 lagmark = min(ab, c);
        aw -= c - lagmark;
        bw += c - lagmark;
        System.out.println(aw + min(bw, d));
    }

    public static void main(String[] args) {
        new Main().solve();
    }
}
0