結果

問題 No.1047 Zero (Novice)
ユーザー ks2m
提出日時 2020-05-08 21:30:18
言語 Java
(openjdk 23)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 2,765 ms
コンパイル使用メモリ 74,016 KB
実行使用メモリ 54,292 KB
最終ジャッジ日時 2024-07-03 23:52:55
合計ジャッジ時間 5,188 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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

		if (b == 0) {
			System.out.println(1);
		} else if (a == -1) {
			System.out.println(2);
		} else {
			System.out.println(-1);
		}
	}
}
0