結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
41,340 KB
testcase_01 AC 113 ms
41,296 KB
testcase_02 AC 100 ms
41,596 KB
testcase_03 AC 115 ms
41,540 KB
testcase_04 AC 113 ms
41,760 KB
testcase_05 AC 112 ms
41,260 KB
testcase_06 AC 111 ms
40,136 KB
testcase_07 AC 98 ms
40,384 KB
testcase_08 AC 103 ms
41,448 KB
testcase_09 AC 120 ms
41,680 KB
testcase_10 AC 121 ms
41,848 KB
testcase_11 AC 120 ms
41,768 KB
testcase_12 AC 116 ms
41,280 KB
testcase_13 AC 115 ms
41,552 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();
    	
    	assert(-1e9<=A&&A<=1e9);
    	assert(-1e9<=B&&B<=1e9);
    	assert(-1e9<=C&&C<=1e9);
    	assert(-1e9<=D&&D<=1e9);
    	
    	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