結果
問題 |
No.1016 三目並べ
|
ユーザー |
![]() |
提出日時 | 2020-04-03 23:04:06 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,234 bytes |
コンパイル時間 | 1,581 ms |
コンパイル使用メモリ | 168,784 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-03 05:38:15 |
合計ジャッジ時間 | 2,034 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | WA * 10 |
ソースコード
#include<bits/stdc++.h> #include<unordered_set> #include<unordered_map> using namespace std; #define REP(i,m,n) for(int i=(m);i<(n);i++) #define rep(i,n) REP(i,0,n) #define pb push_back #define all(a) a.begin(),a.end() #define rall(c) (c).rbegin(),(c).rend() #define mp make_pair typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef long double ld; const ll inf=1e9+7; const ll mod=998244353; int main(){ ll t;cin>>t; while(t){ t--; ll n;string s;cin>>n>>s; string a="xxxx"; string b=""; b+=a+s+a; bool f=0; rep(i,n){ ll c=i+4; if(b[c]=='o'&&b[c+1]=='-'&&b[c+2]=='o')f=1; if(b[c]=='o'&&b[c+1]=='o'&&b[c+2]=='-')f=1; if(b[c]=='-'&&b[c+1]=='o'&&b[c+2]=='o')f=1; if(b[c]=='o'&&b[c+1]=='o'&&b[c+2]=='o')f=1; if(b[c]=='o'&&b[c+1]=='-'&&b[c+2]=='o'&&b[c+3]=='-'&&b[c+4]=='o')f=1; if(b[c]=='-'&&b[c+1]=='o'&&b[c+2]=='-'&&b[c+3]=='-')f=1; if(b[c]=='-'&&b[c+1]=='-'&&b[c+2]=='o'&&b[c+3]=='-')f=1; if(b[c]=='o'&&b[c+1]=='-'&&b[c+2]=='-'&&b[c+3]=='-'&&b[c+4]=='o')f=1; } if(f)cout<<0<<endl; else cout<<'X'<<endl; } }