結果

問題 No.150 "良問"(良問とは言っていない
ユーザー zombietanzombietan
提出日時 2016-05-25 18:26:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 198 ms / 5,000 ms
コード長 624 bytes
コンパイル時間 109 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-19 09:32:23
合計ジャッジ時間 2,273 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
10,752 KB
testcase_01 AC 30 ms
10,880 KB
testcase_02 AC 30 ms
10,752 KB
testcase_03 AC 30 ms
10,752 KB
testcase_04 AC 30 ms
10,880 KB
testcase_05 AC 32 ms
10,880 KB
testcase_06 AC 198 ms
10,880 KB
testcase_07 AC 29 ms
10,880 KB
testcase_08 AC 33 ms
10,752 KB
testcase_09 AC 30 ms
10,752 KB
testcase_10 AC 74 ms
10,752 KB
testcase_11 AC 79 ms
10,752 KB
testcase_12 AC 60 ms
10,752 KB
testcase_13 AC 75 ms
10,752 KB
testcase_14 AC 89 ms
10,752 KB
testcase_15 AC 85 ms
10,752 KB
testcase_16 AC 34 ms
10,752 KB
testcase_17 AC 47 ms
10,752 KB
testcase_18 AC 84 ms
10,752 KB
testcase_19 AC 96 ms
10,752 KB
testcase_20 AC 102 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
S = [input() for _ in range(T)]
        
for s in S:
    cc = len(s)
    g = []
    p = []
    for gi in range(0, cc-3):
        gcount = 0
        for j, k in zip(s[gi:gi+4], 'good'):
            if j != k:
                gcount += 1
        g.append([gcount, gi+3])
    for pi in range(0, cc-6):
        pcount = 0
        for n, m in zip(s[pi:pi+7], 'problem'):
            if n != m:
                pcount += 1
        p.append([pcount, pi])
    ans = set()
    for cg in g:
        for cp in p:
            if cg[1] < cp[1]:
                ans.add(cg[0] + cp[0])
    print(min(ans))
                
0