結果
| 問題 |
No.870 無敵囲い
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-03-21 18:52:36 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 300 ms |
| コード長 | 346 bytes |
| コンパイル時間 | 1,941 ms |
| コンパイル使用メモリ | 191,516 KB |
| 最終ジャッジ日時 | 2025-01-09 09:22:01 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:13:21: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
13 | int n; scanf("%d",&n);
| ~~~~~^~~~~~~~~
main.cpp:15:39: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
15 | int x1,y1,x2,y2; scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
int main(){
int B[10][10]={};
B[2][8]=1;
B[3][9]=2;
B[7][9]=3;
int n; scanf("%d",&n);
rep(i,n){
int x1,y1,x2,y2; scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
swap(B[x1][y1],B[x2][y2]);
}
puts(B[5][8]==1&&B[4][8]==2&&B[6][8]==3?"YES":"NO");
return 0;
}