結果
問題 | No.870 無敵囲い |
ユーザー |
![]() |
提出日時 | 2019-08-30 21:45:23 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 300 ms |
コード長 | 984 bytes |
コンパイル時間 | 1,442 ms |
コンパイル使用メモリ | 165,836 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-29 06:17:08 |
合計ジャッジ時間 | 2,090 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
#define _USE_MATH_DEFINES#include <bits/stdc++.h>using namespace std;//template#define rep(i,a,b) for(int i=(a);i<(b);i++)#define rrep(i,a,b) for(int i=(a);i>(b);i--)#define ALL(v) (v).begin(),(v).end()typedef long long int ll; typedef pair<ll, ll> P;template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }template<typename A,size_t N,typename T>void Fill(A(&array)[N],const T &val){fill((T*)array, (T*)(array+N), val);}const int inf = INT_MAX / 2; const ll INF = LLONG_MAX / 2;//template endint main(){int n; scanf("%d",&n);int x1=2,y1=8,x2=3,y2=9,x3=7,y3=9;rep(i,0,n){int w,x,y,z;scanf("%d%d%d%d",&w,&x,&y,&z);if(w==x1&&x==y1)x1=y,y1=z;if(w==x2&&x==y2)x2=y,y2=z;if(w==x3&&x==y3)x3=y,y3=z;}printf(x1==5&&y1==8&&x2==4&&y2==8&&x3==6&&y3==8?"YES":"NO");return 0;}