結果

問題 No.1016 三目並べ
ユーザー 沙耶花沙耶花
提出日時 2020-04-03 21:35:53
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 673 bytes
コンパイル時間 1,938 ms
コンパイル使用メモリ 199,672 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-16 00:28:29
合計ジャッジ時間 2,675 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 WA -
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define modulo 998244353
#define mod(mod_x) ((((long long)mod_x)+modulo)%modulo)
#define Inf 1000000000000



int main() {

	int T;
	cin>>T;
	
	for(int _=0;_<T;_++){
		int N;
		cin>>N;
		
		string S;
		cin>>S;
		
		bool f = false;
		if(S.size()>=3){
			for(int i=0;i<S.size()-2;i++){
				string s = S.substr(i,3);
				if(s=="ooo"||s=="o-o"||s=="oo-"||s=="-oo"){
					f=true;
					break;
				}
			}
		}
		
		if(S.size()>=4){
			for(int i=0;i<S.size()-3;i++){
				string s = S.substr(i,4);
				if(s=="-o--"||s=="--o-"){
					f=true;
					break;
				}
			}
		}
		if(f)cout<<"O"<<endl;
		else cout<<"X"<<endl;
	}
	
    return 0;
}
0