結果
問題 | No.870 無敵囲い |
ユーザー |
![]() |
提出日時 | 2019-08-30 21:35:47 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 300 ms |
コード長 | 629 bytes |
コンパイル時間 | 2,307 ms |
コンパイル使用メモリ | 193,700 KB |
最終ジャッジ日時 | 2025-01-07 15:47:20 |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main(){int N;cin>>N;pair<int,int> A={2,8};pair<int,int> B={3,9};pair<int,int> C={7,9};for (int i=0;i<N;i+=1){int x,y,z,w;cin>>x>>y>>z>>w;if (x==A.first && y==A.second){A={z,w};}else if (x==B.first && y==B.second){B={z,w};}else if (x==C.first && y==C.second){C={z,w};}}if (A.first==5 && A.second==8 && B.first==4 && B.second==8 && C.first==6 && C.second==8){cout<<"YES";}else{cout<<"NO";}}