結果
問題 |
No.1016 三目並べ
|
ユーザー |
|
提出日時 | 2020-04-03 21:42:48 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 448 bytes |
コンパイル時間 | 584 ms |
コンパイル使用メモリ | 65,792 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-03 01:50:27 |
合計ジャッジ時間 | 1,063 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 2 WA * 8 |
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 5 | main() | ^~~~
ソースコード
#include<iostream> using namespace std; int T,N; string s; main() { cin>>T; for(;T--;) { cin>>N>>s; bool flag=false; for(int i=0;i+3<=N;i++) { if(s.substr(i,3)=="ooo"||s.substr(i,3)=="-oo"||s.substr(i,3)=="oo-")flag=true; } for(int i=0;i<N;) { if(s[i]!='o') { i++; continue; } int j=i+1; while(j<N&&s[j]=='-')j++; if(j<N&&s[j]=='o'&&(j-i)%2==0)flag=true; i=j; } cout<<(flag?"O":"X")<<endl; } }