結果
問題 | No.240 ナイト散歩 |
ユーザー |
|
提出日時 | 2015-07-10 22:29:12 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 750 bytes |
コンパイル時間 | 1,268 ms |
コンパイル使用メモリ | 164,952 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-07 20:46:51 |
合計ジャッジ時間 | 2,136 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 30 |
ソースコード
#include <bits/stdc++.h> #define rep(i, a) for (int i = 0; i < (a); i++) #define rep2(i, a, b) for (int i = (a); i < (b); i++) using namespace std; typedef long long ll; const ll inf = 1e9; const ll mod = 1e9 + 7; typedef pair<int, int> P; int dy[] = {-2, -2, -1, -1, 1, 1, 2, 2, 0}; int dx[] = {-1, 1, -2, 2, -2, 2, -1, 1, 0}; int main() { set<P> good; rep (i, 9) { rep (j, 9) { rep (k, 9) { int y = dy[i] + dy[j] + dy[k]; int x = dx[i] + dx[j] + dx[k]; good.insert(P(y, x)); } } } int Y, X; cin >> Y >> X; if (good.count(P(Y, X))) { cout << "YES" << endl; } else { cout << "NO" << endl; } return 0; }