結果

問題 No.150 "良問"(良問とは言っていない
ユーザー rpy3cpprpy3cpp
提出日時 2015-06-09 22:48:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 520 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 17,824 KB
最終ジャッジ日時 2024-07-06 15:15:33
合計ジャッジ時間 32,548 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4,760 ms
11,264 KB
testcase_01 AC 25 ms
10,752 KB
testcase_02 AC 26 ms
10,752 KB
testcase_03 AC 188 ms
11,008 KB
testcase_04 AC 115 ms
11,136 KB
testcase_05 AC 34 ms
10,752 KB
testcase_06 AC 83 ms
10,624 KB
testcase_07 AC 140 ms
10,880 KB
testcase_08 AC 30 ms
10,624 KB
testcase_09 AC 200 ms
10,880 KB
testcase_10 AC 4,654 ms
11,136 KB
testcase_11 AC 4,984 ms
11,136 KB
testcase_12 AC 3,201 ms
10,880 KB
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 AC 187 ms
11,008 KB
testcase_17 AC 1,847 ms
11,136 KB
testcase_18 TLE -
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