結果

問題 No.240 ナイト散歩
ユーザー shinwisteriashinwisteria
提出日時 2017-04-01 14:13:03
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 551 bytes
コンパイル時間 3,978 ms
コンパイル使用メモリ 72,608 KB
実行使用メモリ 57,172 KB
最終ジャッジ日時 2023-09-22 02:02:51
合計ジャッジ時間 9,760 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
55,712 KB
testcase_01 AC 126 ms
55,928 KB
testcase_02 WA -
testcase_03 AC 126 ms
53,988 KB
testcase_04 AC 127 ms
55,772 KB
testcase_05 AC 126 ms
55,980 KB
testcase_06 AC 127 ms
55,868 KB
testcase_07 AC 129 ms
55,708 KB
testcase_08 AC 129 ms
55,536 KB
testcase_09 AC 128 ms
55,768 KB
testcase_10 AC 128 ms
55,776 KB
testcase_11 AC 129 ms
55,812 KB
testcase_12 AC 130 ms
55,732 KB
testcase_13 AC 131 ms
55,612 KB
testcase_14 AC 131 ms
56,020 KB
testcase_15 AC 130 ms
55,800 KB
testcase_16 AC 132 ms
55,896 KB
testcase_17 AC 130 ms
55,532 KB
testcase_18 AC 127 ms
55,844 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 131 ms
56,000 KB
testcase_29 AC 130 ms
55,756 KB
testcase_30 AC 130 ms
55,740 KB
testcase_31 AC 142 ms
55,876 KB
testcase_32 AC 131 ms
55,956 KB
testcase_33 AC 127 ms
55,772 KB
権限があれば一括ダウンロードができます

ソースコード

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