結果
| 問題 |
No.643 Two Operations No.2
|
| コンテスト | |
| ユーザー |
ほっしいー
|
| 提出日時 | 2018-02-13 00:22:09 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 417 bytes |
| コンパイル時間 | 3,558 ms |
| コンパイル使用メモリ | 75,468 KB |
| 実行使用メモリ | 56,140 KB |
| 最終ジャッジ日時 | 2024-11-26 09:44:13 |
| 合計ジャッジ時間 | 5,348 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 WA * 2 |
ソースコード
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)||((x==-y)&&(x<0))) {
System.out.println(2);
}else if((y==0)||((x==-y)&&(x>0))) {
System.out.println(1);
}else {
System.out.println(-1);
}
}
}
ほっしいー