結果

問題 No.643 Two Operations No.2
ユーザー ほっしいー
提出日時 2018-02-12 23:25:45
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 433 bytes
コンパイル時間 4,686 ms
コンパイル使用メモリ 74,996 KB
実行使用メモリ 54,408 KB
最終ジャッジ日時 2024-11-26 06:27:34
合計ジャッジ時間 7,025 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9 WA * 4
権限があれば一括ダウンロードができます

ソースコード

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

}
0