結果

問題 No.1047 Zero (Novice)
ユーザー ks2mks2m
提出日時 2020-05-08 21:30:18
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 1,997 ms
コンパイル使用メモリ 71,048 KB
実行使用メモリ 56,320 KB
最終ジャッジ日時 2023-09-17 01:43:50
合計ジャッジ時間 5,547 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
56,156 KB
testcase_01 AC 118 ms
55,764 KB
testcase_02 AC 120 ms
55,796 KB
testcase_03 AC 127 ms
55,784 KB
testcase_04 AC 118 ms
55,908 KB
testcase_05 AC 117 ms
56,156 KB
testcase_06 AC 121 ms
56,200 KB
testcase_07 AC 119 ms
56,196 KB
testcase_08 AC 117 ms
56,072 KB
testcase_09 AC 120 ms
55,900 KB
testcase_10 AC 122 ms
56,320 KB
testcase_11 AC 118 ms
56,152 KB
testcase_12 AC 116 ms
55,552 KB
testcase_13 AC 117 ms
55,560 KB
testcase_14 AC 116 ms
56,004 KB
testcase_15 AC 120 ms
55,780 KB
testcase_16 AC 123 ms
56,040 KB
testcase_17 AC 117 ms
56,072 KB
testcase_18 AC 118 ms
56,316 KB
testcase_19 AC 115 ms
55,780 KB
権限があれば一括ダウンロードができます

ソースコード

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