結果

問題 No.643 Two Operations No.2
ユーザー ほっしいー
提出日時 2018-02-13 00:20:40
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 435 bytes
コンパイル時間 3,615 ms
コンパイル使用メモリ 74,560 KB
実行使用メモリ 54,396 KB
最終ジャッジ日時 2024-11-26 09:31:16
合計ジャッジ時間 5,080 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8 WA * 5
権限があれば一括ダウンロードができます

ソースコード

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

}
0