結果

問題 No.208 王将
ユーザー t8m8⛄️t8m8⛄️
提出日時 2015-05-15 22:40:37
言語 Java19
(openjdk 21)
結果
AC  
実行時間 131 ms / 1,000 ms
コード長 926 bytes
コンパイル時間 3,659 ms
コンパイル使用メモリ 72,392 KB
実行使用メモリ 56,300 KB
最終ジャッジ日時 2023-07-30 21:15:57
合計ジャッジ時間 8,223 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
55,676 KB
testcase_01 AC 129 ms
55,580 KB
testcase_02 AC 127 ms
56,068 KB
testcase_03 AC 129 ms
56,164 KB
testcase_04 AC 127 ms
55,636 KB
testcase_05 AC 128 ms
56,032 KB
testcase_06 AC 127 ms
55,732 KB
testcase_07 AC 130 ms
55,768 KB
testcase_08 AC 130 ms
55,732 KB
testcase_09 AC 129 ms
55,880 KB
testcase_10 AC 130 ms
55,696 KB
testcase_11 AC 131 ms
56,300 KB
testcase_12 AC 129 ms
55,696 KB
testcase_13 AC 129 ms
55,668 KB
testcase_14 AC 131 ms
55,672 KB
testcase_15 AC 130 ms
55,996 KB
testcase_16 AC 130 ms
55,428 KB
testcase_17 AC 128 ms
55,680 KB
testcase_18 AC 129 ms
56,212 KB
testcase_19 AC 130 ms
55,812 KB
testcase_20 AC 129 ms
55,744 KB
testcase_21 AC 128 ms
55,984 KB
testcase_22 AC 130 ms
55,768 KB
testcase_23 AC 128 ms
55,804 KB
testcase_24 AC 128 ms
55,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class No0208 {
    
    static final Scanner in = new Scanner(System.in);
    static final PrintWriter out = new PrintWriter(System.out,false);

    static void solve() {
        int x = abs(in.nextInt());
        int y = abs(in.nextInt());
        int x2 = abs(in.nextInt());
        int y2 = abs(in.nextInt());
        if (x == y && x2 == y2 && x2 < x) {
            out.println((x+y-min(x,y)+1));
        }else {
            out.println((x+y-min(x,y)));
        }
    }

    public static void main(String[] args) {
        long start = System.currentTimeMillis();

        solve();
        out.flush();

        long end = System.currentTimeMillis();
        //trace(end-start + "ms");
        in.close();
        out.close();
    }

    static void trace(Object... o) { System.out.println(deepToString(o));}
}
0