結果
問題 | No.240 ナイト散歩 |
ユーザー |
![]() |
提出日時 | 2015-10-26 01:41:42 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 742 bytes |
コンパイル時間 | 1,507 ms |
コンパイル使用メモリ | 157,968 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-07 21:14:01 |
合計ジャッジ時間 | 2,221 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 30 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define int long long #define rep(i,n) for(int i=0;i<(n);i++) #define REP(i,a,b) for(int i=(a);i<(b);i++) #define pb push_back #define all(v) (v).begin(),(v).end() typedef vector<int>vi; const int dx[]={-2,-2,-1,-1,1,1,2,2,0}; const int dy[]={-1,1,-2,2,-2,2,-1,1,0}; typedef pair<int,int>pii; int X,Y; signed main(){ cin>>X>>Y; for(int i=0;i<9;i++){ for(int j=0;j<9;j++){ for(int k=0;k<9;k++){ int x=dx[i]+dx[j]+dx[k]; int y=dy[i]+dy[j]+dy[k]; if(x==X&&y==Y){ cout<<"YES"<<endl; return 0; } } } } cout<<"NO"<<endl; return 0; }