結果

問題 No.149 碁石の移動
ユーザー yun_appyun_app
提出日時 2016-05-12 01:30:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 799 bytes
コンパイル時間 1,927 ms
コンパイル使用メモリ 71,000 KB
実行使用メモリ 49,952 KB
最終ジャッジ日時 2023-08-25 17:44:11
合計ジャッジ時間 3,409 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
49,516 KB
testcase_01 AC 38 ms
49,340 KB
testcase_02 AC 40 ms
49,576 KB
testcase_03 AC 41 ms
49,536 KB
testcase_04 AC 40 ms
49,524 KB
testcase_05 AC 40 ms
49,288 KB
testcase_06 AC 40 ms
49,440 KB
testcase_07 AC 40 ms
49,948 KB
testcase_08 AC 40 ms
49,336 KB
testcase_09 AC 39 ms
49,388 KB
testcase_10 AC 39 ms
49,700 KB
testcase_11 AC 41 ms
49,952 KB
testcase_12 AC 40 ms
49,396 KB
testcase_13 AC 41 ms
49,232 KB
testcase_14 AC 41 ms
49,764 KB
testcase_15 AC 39 ms
49,416 KB
testcase_16 AC 41 ms
49,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.lang.*;
import java.io.*;

class Ideone{
    public static void main(String[] args) throws Exception{
        // your code goes here
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] lines = br.readLine().split(" ");
        int aw = Integer.parseInt(lines[0]);
        int ab = Integer.parseInt(lines[1]);

        lines = br.readLine().split(" ");
        int bw = Integer.parseInt(lines[0]);
        int bb = Integer.parseInt(lines[1]);

        lines = br.readLine().split(" ");
        int c = Integer.parseInt(lines[0]);
        int d = Integer.parseInt(lines[1]);

        c -= ab;
        if(c>0){
            aw-=c;
            bw+=c;
        }
        
        System.out.println(aw+Math.min(bw,d));
    }
}
0