結果

問題 No.870 無敵囲い
ユーザー toto6114toto6114
提出日時 2019-09-20 20:52:28
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 300 ms
コード長 499 bytes
コンパイル時間 684 ms
コンパイル使用メモリ 80,268 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-29 06:25:20
合計ジャッジ時間 1,328 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<map>
using namespace std;
int main() {
  int n,a,b,c,d,A,B,C,D,E,F;
  cin >> n;
  A=2,B=8,C=3,D=9,E=7,F=9;
  for(int i=0; i<n; i++) {
    cin >> a >> b >> c >> d;
    if(a==A&&b==B) {
      A=c,B=d;
    }
    else if(a==C&&b==D) {
      C=c,D=d;
    }
    else if(a==E&&b==F) {
      E=c,F=d;
    }
  }
  if(A==5&&B==8&&C==4&&D==8&&E==6&&F==8) {
    cout << "YES" << endl;
  }
  else {
    cout << "NO" << endl;
  }
}
0