結果
| 問題 |
No.1016 三目並べ
|
| コンテスト | |
| ユーザー |
auaua
|
| 提出日時 | 2020-04-03 23:04:48 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,236 bytes |
| コンパイル時間 | 1,690 ms |
| コンパイル使用メモリ | 170,100 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-03 05:38:21 |
| 合計ジャッジ時間 | 2,000 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 6 WA * 4 |
ソースコード
#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<<'O'<<endl;
else cout<<'X'<<endl;
}
}
auaua