結果
問題 |
No.240 ナイト散歩
|
ユーザー |
![]() |
提出日時 | 2015-07-10 23:03:50 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 457 bytes |
コンパイル時間 | 382 ms |
コンパイル使用メモリ | 39,936 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-08 02:04:46 |
合計ジャッジ時間 | 1,397 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 24 WA * 6 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:8:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | int x,y;scanf("%d%d",&x,&y); | ~~~~~^~~~~~~~~~~~~~
ソースコード
#include <cstdio> #include <cstring> #include <cmath> #include <algorithm> using namespace std; int main(){ int x,y;scanf("%d%d",&x,&y); int b[101][101]={}; int dx[10]={-2,-2,2,2,-1,-1,1,1},dy[10]={-1,1,-1,1,-2,2,-2,2}; b[50][50]=1; for(int i=0;i<3;i++)for(int j=35;j<65;j++)for(int k=35;k<65;k++){ if(b[j][k])for(int d=0;d<8;d++)b[j+dy[d]][k+dx[d]]=1; } if(abs(x)<10&&abs(y)<10&&b[y+50][x+50])printf("YES\n"); else printf("NO\n"); return 0; }