結果

問題 No.1412 Super Ryuo
ユーザー tentententen
提出日時 2021-03-01 12:33:22
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 488 bytes
コンパイル時間 2,383 ms
コンパイル使用メモリ 74,844 KB
実行使用メモリ 54,344 KB
最終ジャッジ日時 2024-04-14 03:39:25
合計ジャッジ時間 4,561 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
53,896 KB
testcase_01 AC 126 ms
54,088 KB
testcase_02 AC 125 ms
53,972 KB
testcase_03 AC 128 ms
54,124 KB
testcase_04 AC 126 ms
53,900 KB
testcase_05 AC 127 ms
53,796 KB
testcase_06 AC 128 ms
54,100 KB
testcase_07 AC 129 ms
54,060 KB
testcase_08 AC 116 ms
53,120 KB
testcase_09 AC 130 ms
54,144 KB
testcase_10 AC 129 ms
54,344 KB
testcase_11 AC 116 ms
53,040 KB
testcase_12 AC 129 ms
54,080 KB
testcase_13 AC 133 ms
54,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long a = sc.nextInt();
        long b = sc.nextInt();
        long c = sc.nextInt();
        long d = sc.nextInt();
        if (Math.abs(a - c) + Math.abs(b - d) <= 3) {
            System.out.println(1);
        } else if (a == c || b == d) {
            System.out.println(1);
        } else {
            System.out.println(2); 
        }
    }
}
0