結果

問題 No.870 無敵囲い
ユーザー okok
提出日時 2019-08-30 21:33:10
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 300 ms
コード長 1,082 bytes
コンパイル時間 1,718 ms
コンパイル使用メモリ 73,936 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-11 16:09:05
合計ジャッジ時間 1,460 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 1 ms
4,384 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 2 ms
4,384 KB
testcase_20 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

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