結果

問題 No.240 ナイト散歩
ユーザー shinwisteria
提出日時 2017-04-01 14:13:03
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 551 bytes
コンパイル時間 3,514 ms
コンパイル使用メモリ 75,240 KB
実行使用メモリ 54,412 KB
最終ジャッジ日時 2024-07-07 18:51:48
合計ジャッジ時間 7,638 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Knightwalk {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner s = new Scanner(System.in);
		int X = Math.abs(s.nextInt()),Y = Math.abs(s.nextInt());
		s.close();
		if(X > 6 || Y > 6){
			System.out.println("NO");
		}else{
			int A = Math.max(X, Y);
			int count = 0;
			while(A >= 2){
				count++;
				A -= 2;
			}
			if(Math.min(X, Y) == count + (A % 2) * 2){
				System.out.println("YES");
			}else{
				System.out.println("NO");
			}
			
		}

	}

}
0