結果

問題 No.1412 Super Ryuo
ユーザー tenten
提出日時 2021-03-01 12:33:22
言語 Java
(openjdk 23)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 488 bytes
コンパイル時間 1,955 ms
コンパイル使用メモリ 73,660 KB
実行使用メモリ 41,540 KB
最終ジャッジ日時 2024-10-03 00:49:56
合計ジャッジ時間 4,538 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

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