結果
問題 | No.240 ナイト散歩 |
ユーザー |
![]() |
提出日時 | 2018-03-12 23:37:05 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 441 bytes |
コンパイル時間 | 1,525 ms |
コンパイル使用メモリ | 157,684 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-15 18:49:07 |
合計ジャッジ時間 | 2,950 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 30 |
ソースコード
#include <bits/stdc++.h>using namespace std;typedef long long ll;int main() {ll x, y;cin >> x >> y;int dx[] = { -2,-2,-1,-1,1,1,2,2,0 };int dy[] = { -1,1,-2,2,-2,2,-1,1,0 };for (int i = 0;i < 9;i++) {for (int j = 0;j < 9;j++) {for (int k = 0;k < 9;k++) {if (x == dx[i] + dx[j] + dx[k] && y == dy[i] + dy[j] + dy[k]) {cout << "YES" << endl;return 0;}}}}cout << "NO" << endl;return 0;}