結果
| 問題 |
No.1016 三目並べ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-03 22:35:43 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 872 bytes |
| コンパイル時間 | 736 ms |
| コンパイル使用メモリ | 79,728 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-03 04:44:58 |
| 合計ジャッジ時間 | 1,262 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 10 |
ソースコード
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>
#include<utility>
using namespace std;
#define int long long
#define endl "\n"
constexpr long long INF = (long long)1e18;
constexpr long long MOD = 1'000'000'007;
struct fast_io {
fast_io(){
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
};
} fio;
bool solve(string &S){
int N = S.size();
for(int i = 0; i < N - 2; i++){
string x;
x += S[i];
x += S[i+1];
x += S[i+2];
if(x == "ooo") return true;
if(x == "oo-") return true;
if(x == "o-o") return true;
if(x == "-oo") return true;
}
return false;
}
signed main(){
cout<<fixed<<setprecision(10);
int T;
cin>>T;
for(int _ = 0; _ < T; _++){
int N;
string S;
cin>>N>>S;
if(solve(S)) cout<<"o"<<endl;
else cout<<"x"<<endl;
}
return 0;
}