結果
| 問題 | No.240 ナイト散歩 |
| コンテスト | |
| ユーザー |
tenten
|
| 提出日時 | 2020-10-15 08:55:04 |
| 言語 | Java (openjdk 27 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 148 ms / 2,000 ms |
| + 846µs | |
| コード長 | 711 bytes |
| 記録 | |
| コンパイル時間 | 1,862 ms |
| コンパイル使用メモリ | 95,488 KB |
| 実行使用メモリ | 48,356 KB |
| 最終ジャッジ日時 | 2026-10-28 17:30:14 |
| 合計ジャッジ時間 | 8,385 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge7_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 31 |
ソースコード
import java.util.*;
public class Main {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int y = sc.nextInt();
int[] xArr = new int[]{-2, -2, 2, 2, -1, -1, 1, 1};
int[] yArr = new int[]{-1, 1, -1, 1, -2, 2, -2, 2};
for (int i = 0; i < 8 * 8 * 8; i++) {
int key = i;
int xx = 0;
int yy = 0;
for (int j = 0; j < 3; j++) {
xx += xArr[key % 8];
yy += yArr[key % 8];
key /= 8;
if (xx == x && yy == y) {
System.out.println("YES");
return;
}
}
}
System.out.println("NO");
}
}
tenten