結果

問題 No.1016 三目並べ
コンテスト
ユーザー kimiyuki
提出日時 2020-04-03 21:46:18
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 718 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 389 ms
コンパイル使用メモリ 20,700 KB
実行使用メモリ 19,676 KB
最終ジャッジ日時 2026-03-24 09:11:52
合計ジャッジ時間 2,895 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#!/usr/bin/env python3
from typing import *

def solve(n: int, s: str) -> bool:
    for t in ('ooo', 'oo-', 'o-o', '-oo', '-o--', '--o-'):
        if t in s:
            return True
    return False

# generated by online-judge-template-generator (https://github.com/kmyk/online-judge-template-generator)
def main():
    import sys
    tokens = iter(sys.stdin.read().split())
    T = int(next(tokens))
    N = [None for _ in range(T)]
    S = [None for _ in range(T)]
    for i in range(T):
        N[i] = int(next(tokens))
        S[i] = next(tokens)
    assert next(tokens, None) is None
    for i in range(T):
        ans = solve(N[i], S[i])
        print(ans and 'O' or 'X')

if __name__ == '__main__':
    main()
0