結果

問題 No.3108 Luke or Bishop
ユーザー ks2m
提出日時 2025-04-18 20:02:44
言語 Java
(openjdk 23)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 386 bytes
コンパイル時間 2,242 ms
コンパイル使用メモリ 76,332 KB
実行使用メモリ 46,564 KB
最終ジャッジ日時 2025-04-18 20:02:51
合計ジャッジ時間 6,628 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int y = sc.nextInt();
		sc.close();

		if (x == 0 && y == 0) {
			System.out.println(0);
		} else if (x == y || -x == y || x == 0 || y == 0) {
			System.out.println(1);
		} else {
			System.out.println(2);
		}
	}
}
0