結果

問題 No.1016 三目並べ
ユーザー 👑 rin204rin204
提出日時 2022-03-21 21:07:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 377 bytes
コンパイル時間 442 ms
コンパイル使用メモリ 82,848 KB
実行使用メモリ 60,504 KB
最終ジャッジ日時 2024-04-17 17:36:36
合計ジャッジ時間 990 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
53,264 KB
testcase_01 AC 29 ms
52,460 KB
testcase_02 AC 32 ms
52,464 KB
testcase_03 AC 32 ms
53,300 KB
testcase_04 AC 33 ms
54,072 KB
testcase_05 AC 30 ms
52,652 KB
testcase_06 AC 31 ms
53,252 KB
testcase_07 AC 35 ms
60,504 KB
testcase_08 AC 35 ms
58,848 KB
testcase_09 AC 35 ms
59,408 KB
testcase_10 AC 37 ms
60,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

win = ["ooo", "-oo", "o-o", "oo-", "-o--", "--o-"]
def solve():
    n, S = input().split()
    for w in win:
        if w in S:
            print("O")
            return
    S = S.split("o")
    for s in S[1:-1]:
        if "x" not in s and len(s) % 2 == 1 and len(s) >= 3:
            print("O")
            return
    print("X")
    
for _ in range(int(input())):
    solve()
0