結果

問題 No.3108 Luke or Bishop
ユーザー Maeda
提出日時 2025-08-27 16:06:02
言語 Java
(openjdk 23)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 469 bytes
コンパイル時間 2,290 ms
コンパイル使用メモリ 76,112 KB
実行使用メモリ 46,776 KB
最終ジャッジ日時 2025-08-27 16:06:09
合計ジャッジ時間 6,424 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        if(x < 0){
        	x *= -1;
        }
        int y = sc.nextInt();
        if(y < 0){
        	y *= -1;
        }
        
		if(x == 0 && y == 0){
        System.out.println(0);
    	}else if(x == 0 ||  y == 0 || x == y){
    		System.out.println(1);
		}else{
			System.out.println(2);
		}
    }
}
0