結果
| 問題 |
No.1016 三目並べ
|
| コンテスト | |
| ユーザー |
uni_python
|
| 提出日時 | 2020-04-04 09:01:45 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 910 bytes |
| コンパイル時間 | 286 ms |
| コンパイル使用メモリ | 82,348 KB |
| 実行使用メモリ | 72,424 KB |
| 最終ジャッジ日時 | 2024-07-03 07:00:14 |
| 合計ジャッジ時間 | 1,242 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 10 |
ソースコード
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
mod=10**9+7
def main():
T=I()
for _ in range(T):
a,S=input().split()
S=["x"]+list(S)+["x"]
N=len(S)
now="x"
length=1
f=0
for i in range(1,N-1):
if S[i]==now:
length+=1
else:
now=S[i]
length=1
if now=="o" and length==3:
f=1
break
elif now=="o" and length==2 and (S[i-1]=="-" or S[i+1]=="-"):
f=1
break
elif now=="-" and length%2==1 and (S[i-1]=="o" and S[i+1]=="o"):
f=1
break
if f==1:
print("O")
else:
print("X")
main()
uni_python