結果

問題 No.643 Two Operations No.2
ユーザー ほっしいーほっしいー
提出日時 2018-02-13 00:29:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 422 bytes
コンパイル時間 4,599 ms
コンパイル使用メモリ 72,660 KB
実行使用メモリ 56,100 KB
最終ジャッジ日時 2023-08-17 13:40:03
合計ジャッジ時間 7,257 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,872 KB
testcase_01 AC 116 ms
55,364 KB
testcase_02 AC 116 ms
54,200 KB
testcase_03 AC 115 ms
55,544 KB
testcase_04 AC 116 ms
55,508 KB
testcase_05 AC 116 ms
55,704 KB
testcase_06 AC 116 ms
55,652 KB
testcase_07 AC 118 ms
56,100 KB
testcase_08 AC 117 ms
55,616 KB
testcase_09 AC 119 ms
55,580 KB
testcase_10 AC 117 ms
55,512 KB
testcase_11 AC 118 ms
55,920 KB
testcase_12 AC 116 ms
55,632 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class No643 {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int x=Integer.parseInt(sc.next());
		int y=Integer.parseInt(sc.next());
		if(x==y) {
			System.out.println(0);
		}else if(x==0) {
			System.out.println(2);
		}else if(y==0) {
			System.out.println(1);
		}else if(x==-y){
			System.out.println(3);
		}else{
			System.out.println(-1);
		}
	}

}

0