結果

問題 No.643 Two Operations No.2
ユーザー YamaKasaYamaKasa
提出日時 2018-09-30 19:56:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 426 bytes
コンパイル時間 2,202 ms
コンパイル使用メモリ 74,280 KB
実行使用メモリ 54,432 KB
最終ジャッジ日時 2024-04-20 13:45:50
合計ジャッジ時間 4,106 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
53,080 KB
testcase_01 AC 115 ms
53,776 KB
testcase_02 AC 121 ms
54,304 KB
testcase_03 AC 98 ms
52,632 KB
testcase_04 AC 106 ms
53,040 KB
testcase_05 AC 111 ms
54,164 KB
testcase_06 AC 102 ms
52,784 KB
testcase_07 AC 111 ms
53,696 KB
testcase_08 AC 105 ms
54,432 KB
testcase_09 AC 115 ms
53,868 KB
testcase_10 AC 113 ms
52,992 KB
testcase_11 AC 106 ms
53,028 KB
testcase_12 AC 104 ms
52,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int X = scan.nextInt();
		int Y = scan.nextInt();
		scan.close();
		if(X == Y) {
			System.out.println(0);
		}else if(Y == 0) {
			System.out.println(1);
		}else if(X == 0) {
			System.out.println(2);
		}else if(X == -Y) {
			System.out.println(3);
		}else {
			System.out.println(-1);
		}
	}
}
0