結果

問題 No.1016 三目並べ
ユーザー IT_parselyIT_parsely
提出日時 2020-04-03 23:23:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 511 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 10,640 KB
実行使用メモリ 9,360 KB
最終ジャッジ日時 2023-09-16 04:55:31
合計ジャッジ時間 1,201 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
9,204 KB
testcase_01 AC 29 ms
9,048 KB
testcase_02 AC 26 ms
9,168 KB
testcase_03 AC 27 ms
9,160 KB
testcase_04 AC 26 ms
9,204 KB
testcase_05 AC 26 ms
9,044 KB
testcase_06 AC 26 ms
9,192 KB
testcase_07 AC 57 ms
9,148 KB
testcase_08 AC 54 ms
9,152 KB
testcase_09 AC 71 ms
9,360 KB
testcase_10 AC 77 ms
9,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import re
import math

t = int(input())
for _ in range(t):
    n, line = input().split()
    if line.find('ooo') != -1 \
    or line.find('-oo') != -1 \
    or line.find('oo-') != -1 \
    or line.find('--o-') != -1 \
    or line.find('-o--') != -1:
        print('O')
    else:
        limit = int(n) // 2
        for i in range(1, limit):
            desire = 'o' + '-'*(2*i-1) + 'o'
            if line.find(desire) != -1:
                print('O')
                break
        else:
            print('X')
0