結果

問題 No.1412 Super Ryuo
ユーザー 37zigen37zigen
提出日時 2021-02-28 16:18:26
言語 Java21
(openjdk 21)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 644 bytes
コンパイル時間 2,198 ms
コンパイル使用メモリ 75,828 KB
実行使用メモリ 41,944 KB
最終ジャッジ日時 2024-04-10 16:01:16
合計ジャッジ時間 4,251 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
41,688 KB
testcase_01 AC 112 ms
41,608 KB
testcase_02 AC 107 ms
41,536 KB
testcase_03 AC 106 ms
41,344 KB
testcase_04 AC 118 ms
41,740 KB
testcase_05 AC 112 ms
41,268 KB
testcase_06 AC 104 ms
41,576 KB
testcase_07 AC 110 ms
41,328 KB
testcase_08 AC 108 ms
41,340 KB
testcase_09 AC 100 ms
41,368 KB
testcase_10 AC 108 ms
41,944 KB
testcase_11 AC 107 ms
41,624 KB
testcase_12 AC 112 ms
41,540 KB
testcase_13 AC 110 ms
41,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
class Main
{
    public static void main(String[] args)
    {
        new Main().run();
    }
    
    
    
    void run()
    {
    	Scanner sc=new Scanner(System.in);
    	long A=sc.nextLong();
    	long B=sc.nextLong();
    	long C=sc.nextLong();
    	long D=sc.nextLong();
    	C-=A;
    	D-=B;
    	C=Math.abs(C);
    	D=Math.abs(D);
    	assert(!(C==0&&D==0));
    	if (C==0||D==0) {
    		System.out.println(1);
    	} else if (C+D<=3) {
    		System.out.println(1);
    	} else {
    		System.out.println(2);
    	}
    }
    
    
    void tr(Object...objects) {System.out.println(Arrays.deepToString(objects));}
}
0