結果
問題 | No.240 ナイト散歩 |
ユーザー |
![]() |
提出日時 | 2016-07-03 12:35:16 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 538 bytes |
コンパイル時間 | 615 ms |
コンパイル使用メモリ | 63,684 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-07 21:26:53 |
合計ジャッジ時間 | 1,601 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 30 |
ソースコード
#include<iostream>using namespace std;int main(){long long X,Y;int x_move[9]={ 0,-2,-2,-1,-1, 1, 1, 2, 2};int y_move[9]={ 0,-1, 1,-2, 2,-2, 2,-1, 1};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_move[i]+x_move[j]+x_move[k]==X &&y_move[i]+y_move[j]+y_move[k]==Y){cout << "YES"<< endl;return 0;}}}}cout<< "NO" <<endl;}