結果
問題 | No.870 無敵囲い |
ユーザー |
![]() |
提出日時 | 2020-07-10 13:03:52 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 300 ms |
コード長 | 513 bytes |
コンパイル時間 | 1,593 ms |
コンパイル使用メモリ | 167,820 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-29 06:42:33 |
合計ジャッジ時間 | 2,312 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
#include<bits/stdc++.h>using namespace std;using ll=long long;#define rep2(i, a, n) for(int i = (a); i < (n); i++)#define rep(i, n) rep2(i,0,n)#define repe(i,a) for(auto &i:a)int main(){cin.tie(nullptr);ios_base::sync_with_stdio(false);int n;cin>>n;string a="28",b="39",c="79",p,m,t;rep(i,n){cin>>p>>t;p+=t;cin>>m>>t;m+=t;if(p==a)a=m;else if(p==b)b=m;else if(p==c)c=m;}//最終的に座標(5,8),(4,8),(6,8)cout<<(a=="58"&&b=="48"&&c=="68"?"YES":"NO")<<endl;}