結果

問題 No.643 Two Operations No.2
ユーザー ほっしいーほっしいー
提出日時 2018-02-12 23:42:29
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 469 bytes
コンパイル時間 6,605 ms
コンパイル使用メモリ 72,224 KB
実行使用メモリ 55,692 KB
最終ジャッジ日時 2023-08-17 11:34:43
合計ジャッジ時間 5,321 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
55,412 KB
testcase_01 AC 111 ms
55,600 KB
testcase_02 AC 111 ms
55,692 KB
testcase_03 AC 113 ms
55,400 KB
testcase_04 AC 113 ms
55,456 KB
testcase_05 AC 114 ms
55,360 KB
testcase_06 WA -
testcase_07 AC 117 ms
55,456 KB
testcase_08 WA -
testcase_09 AC 114 ms
55,460 KB
testcase_10 AC 115 ms
55,520 KB
testcase_11 WA -
testcase_12 WA -
権限があれば一括ダウンロードができます

ソースコード

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)&&(y>0))||((y==0)&&(x<0))||((x==-y)&&(x<0))) {
			System.out.println(2);
		}else if(((x==0)&&(y<0))||((y==0)&&(x>0))||((x==-y)&&(x>0))) {
			System.out.println(1);
		}else {
			System.out.println(-1);
		}
	}

}
0