結果

問題 No.870 無敵囲い
ユーザー ok
提出日時 2019-08-30 21:33:10
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 300 ms
コード長 1,082 bytes
コンパイル時間 602 ms
コンパイル使用メモリ 74,936 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-29 06:15:22
合計ジャッジ時間 1,334 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

#define int long long
#define endl "\n"

const long long INF = (long long)1e18;
// const long long MOD = 1'000'000'007; 

string yn(bool f){return f?"Yes":"No";}
string YN(bool f){return f?"YES":"NO";}



signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);
	
	int N;
	int x1, x2, y1, y2;
	pair<int,int> field[10][10];
	
	cin>>N;
	
	for(int i = 0; i < 10; i++){
		for(int j = 0; j < 10; j++){
			field[i][j] = make_pair(i,j);
		}
	}
	
	for(int i = 0; i < N; i++){
		cin>>y1>>x1>>y2>>x2;
		field[y2][x2] = field[y1][x1];
		field[y1][x1] = make_pair(-1,-1);
	}
	
	// for(int i = 0; i < 10; i++){
		// for(int j = 0; j < 10; j++){
			// cout<<i<<" "<<j<<" : ";
			// cout<<field[i][j].first<<" <> "<<field[i][j].second<<endl;
		// }
	// }
	
	pair<int,int> p1{2,8}, p2{3,9}, p3{7,9};
	
	if(field[5][8] == p1 &&
	   field[4][8] == p2 &&
	   field[6][8] == p3) cout<<"YES"<<endl;
	else cout<<"NO"<<endl;
	   
	return 0;
}
0