結果

問題 No.1016 三目並べ
ユーザー kozykozy
提出日時 2021-05-09 17:42:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 704 bytes
コンパイル時間 417 ms
コンパイル使用メモリ 11,864 KB
実行使用メモリ 10,204 KB
最終ジャッジ日時 2023-10-19 03:01:36
合計ジャッジ時間 1,789 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

T=int(input())
for i in range(T):
  N,S=input().split()
  N=int(N)
  flag=True
  for i in range(N-2):
    if S[i]==S[i+1]==S[i+2]=="o":
      print("O")
      flag=False
      break
    if (S[i]==S[i+1]=="o") and S[i+2]=="-":
      print("O")
      flag=False
      break
    if (S[i]==S[i+2]=="o") and S[i+1]=="-":
      print("O")
      flag=False
      break
    if (S[i+2]==S[i+1]=="o") and S[i]=="-":
      print("O")
      flag=False
      break
    if i!=N-3:
      if (S[i+1]=="o") and S[i]==S[i+2]==S[i+3]=="-":
        print("O")
        flag=False
        break
      if (S[i+2]=="o") and S[i]==S[i+1]==S[i+3]=="-":
        print("O")
        flag=False
        break
  if flag:
    print("X")
0