結果
| 問題 |
No.240 ナイト散歩
|
| ユーザー |
SSRS
|
| 提出日時 | 2020-11-19 18:42:41 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 463 bytes |
| コンパイル時間 | 1,692 ms |
| コンパイル使用メモリ | 169,484 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-23 10:09:18 |
| 合計ジャッジ時間 | 2,717 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
vector<int> dx = {0, 2, 1, 2, 1, -2, -1, -2, -1};
vector<int> dy = {0, 1, 2, -1, -2, 1, 2, -1, -2};
int main(){
int X, Y;
cin >> X >> Y;
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;
}
SSRS