結果

問題 No.150 "良問"(良問とは言っていない
ユーザー rpy3cpprpy3cpp
提出日時 2015-06-09 22:48:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 520 bytes
コンパイル時間 70 ms
コンパイル使用メモリ 10,644 KB
実行使用メモリ 13,944 KB
最終ジャッジ日時 2023-09-20 20:25:31
合計ジャッジ時間 37,761 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 29 ms
9,076 KB
testcase_02 AC 28 ms
9,120 KB
testcase_03 AC 198 ms
9,456 KB
testcase_04 AC 118 ms
9,404 KB
testcase_05 AC 35 ms
9,184 KB
testcase_06 AC 83 ms
9,236 KB
testcase_07 AC 143 ms
9,608 KB
testcase_08 AC 28 ms
9,032 KB
testcase_09 AC 211 ms
9,524 KB
testcase_10 AC 4,871 ms
9,588 KB
testcase_11 TLE -
testcase_12 AC 3,376 ms
9,420 KB
testcase_13 TLE -
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import re
import itertools

def solve(S):
    words_original = [c for c in 'goodproblem']
    for i in range(12):
        for pos in itertools.combinations(range(11), i):
            words = words_original[:]
            for p in pos:
                words[p] = '.'
            pattern = ''.join(words[:4] + ['.*'] + words[4:])
            result = re.search(pattern, S)
            if result:
                return i

if __name__ == '__main__':
    T = int(input())
    for t in range(T):
        print(solve(input()))
0