結果

問題 No.150 "良問"(良問とは言っていない
ユーザー gorugo30gorugo30
提出日時 2021-03-16 22:30:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 493 ms / 5,000 ms
コード長 415 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 76,800 KB
最終ジャッジ日時 2024-04-26 05:18:24
合計ジャッジ時間 4,011 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 148 ms
76,032 KB
testcase_01 AC 39 ms
51,968 KB
testcase_02 AC 45 ms
59,136 KB
testcase_03 AC 48 ms
59,136 KB
testcase_04 AC 40 ms
51,840 KB
testcase_05 AC 71 ms
75,776 KB
testcase_06 AC 493 ms
76,160 KB
testcase_07 AC 40 ms
52,480 KB
testcase_08 AC 58 ms
65,664 KB
testcase_09 AC 52 ms
61,312 KB
testcase_10 AC 154 ms
75,904 KB
testcase_11 AC 169 ms
76,800 KB
testcase_12 AC 160 ms
76,032 KB
testcase_13 AC 162 ms
75,904 KB
testcase_14 AC 193 ms
76,160 KB
testcase_15 AC 182 ms
76,032 KB
testcase_16 AC 79 ms
75,904 KB
testcase_17 AC 103 ms
75,904 KB
testcase_18 AC 163 ms
75,904 KB
testcase_19 AC 200 ms
76,160 KB
testcase_20 AC 203 ms
75,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
for case in range(T):
    S = input()
    good = "good"
    prob = "problem"
    ans = len(S)
    for i in range(len(S) - 4 + 1):
        for j in range(i + 4, len(S) - 6):
            U = S[:i] + good + S[i + 4:j] + prob + S[j + 7:]
            cnt = 0
            for k in range(len(S)):
                if S[k] != U[k]:
                    cnt += 1
            ans = min(ans, cnt)
    print(ans)
0