結果

問題 No.643 Two Operations No.2
ユーザー ほっしいー
提出日時 2018-02-13 00:29:16
言語 Java
(openjdk 23)
結果
AC  
実行時間 117 ms / 2,000 ms
コード長 422 bytes
コンパイル時間 4,526 ms
コンパイル使用メモリ 76,744 KB
実行使用メモリ 54,232 KB
最終ジャッジ日時 2024-11-26 10:28:58
合計ジャッジ時間 6,352 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

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