結果
問題 | No.240 ナイト散歩 |
ユーザー | mastersatoshi |
提出日時 | 2015-07-16 16:10:47 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 51 ms / 2,000 ms |
コード長 | 2,325 bytes |
コンパイル時間 | 1,947 ms |
コンパイル使用メモリ | 77,136 KB |
実行使用メモリ | 50,476 KB |
最終ジャッジ日時 | 2024-10-07 20:57:45 |
合計ジャッジ時間 | 4,596 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 51 ms
50,404 KB |
testcase_01 | AC | 50 ms
50,012 KB |
testcase_02 | AC | 50 ms
50,088 KB |
testcase_03 | AC | 50 ms
49,984 KB |
testcase_04 | AC | 50 ms
50,156 KB |
testcase_05 | AC | 50 ms
50,476 KB |
testcase_06 | AC | 48 ms
50,088 KB |
testcase_07 | AC | 48 ms
50,204 KB |
testcase_08 | AC | 47 ms
50,052 KB |
testcase_09 | AC | 47 ms
50,060 KB |
testcase_10 | AC | 47 ms
50,332 KB |
testcase_11 | AC | 48 ms
50,256 KB |
testcase_12 | AC | 48 ms
50,212 KB |
testcase_13 | AC | 47 ms
50,240 KB |
testcase_14 | AC | 50 ms
49,896 KB |
testcase_15 | AC | 50 ms
50,220 KB |
testcase_16 | AC | 50 ms
49,836 KB |
testcase_17 | AC | 51 ms
50,264 KB |
testcase_18 | AC | 50 ms
50,396 KB |
testcase_19 | AC | 50 ms
50,212 KB |
testcase_20 | AC | 50 ms
49,916 KB |
testcase_21 | AC | 50 ms
49,860 KB |
testcase_22 | AC | 51 ms
50,256 KB |
testcase_23 | AC | 50 ms
50,056 KB |
testcase_24 | AC | 50 ms
50,020 KB |
testcase_25 | AC | 51 ms
50,336 KB |
testcase_26 | AC | 51 ms
49,972 KB |
testcase_27 | AC | 51 ms
50,240 KB |
testcase_28 | AC | 50 ms
50,332 KB |
testcase_29 | AC | 50 ms
50,316 KB |
testcase_30 | AC | 50 ms
50,392 KB |
testcase_31 | AC | 51 ms
50,216 KB |
testcase_32 | AC | 50 ms
49,888 KB |
testcase_33 | AC | 50 ms
50,400 KB |
ソースコード
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { //取りうる座標を全て定数化しておく private static final int dest[][] = new int[][]{{-6, -3}, {-6, -1}, {-6, 1}, {-6, 3}, {-5, -4}, {-5, -2}, {-5, 0}, {-5, 2}, {-5, 4}, {-4, -5}, {-4, -3}, {-4, -2}, {-4, -1}, {-4, 0}, {-4, 1}, {-4, 2}, {-4, 3}, {-4, 5}, {-3, -6}, {-3, -4}, {-3, -3}, {-3, -2}, {-3, -1}, {-3, 0}, {-3, 1}, {-3, 2}, {-3, 3}, {-3, 4}, {-3, 6}, {-2, -5}, {-2, -4}, {-2, -3}, {-2, -1}, {-2, 0}, {-2, 1}, {-2, 3}, {-2, 4}, {-2, 5}, {-1, -6}, {-1, -4}, {-1, -3}, {-1, -2}, {-1, -1}, {-1, 0}, {-1, 1}, {-1, 2}, {-1, 3}, {-1, 4}, {-1, 6}, {0, -5}, {0, -4}, {0, -3}, {0, -2}, {0, -1}, {0, 0}, {0, 1}, {0, 2}, {0, 3}, {0, 4}, {0, 5}, {1, -6}, {1, -4}, {1, -3}, {1, -2}, {1, -1}, {1, 0}, {1, 1}, {1, 2}, {1, 3}, {1, 4}, {1, 6}, {2, -5}, {2, -4}, {2, -3}, {2, -1}, {2, 0}, {2, 1}, {2, 3}, {2, 4}, {2, 5}, {3, -6}, {3, -4}, {3, -3}, {3, -2}, {3, -1}, {3, -1}, {3, 0}, {3, 1}, {3, 2}, {3, 3}, {3, 4}, {3, 6}, {4, -5}, {4, -3}, {4, -2}, {4, -1}, {4, 0}, {4, 1}, {4, 2}, {4, 3}, {4, 5}, {5, -4}, {5, -2}, {5, 0}, {5, 2}, {5, 4}, {6, -3}, {6, -1}, {6, 1}, {6, 3}}; public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str; while (!"".equals(str = br.readLine())) { if (str == null) { break; } String strs[] = str.split(" "); int place[] = new int[]{Integer.parseInt(strs[0]), Integer.parseInt(strs[1])}; for (int i = 0; i < dest.length; i++) { if (dest[i][0] == place[0] && dest[i][1] == place[1]) { System.out.println("YES"); return; } } System.out.println("NO"); } } }