結果

問題 No.150 "良問"(良問とは言っていない
ユーザー 👑 rin204rin204
提出日時 2022-01-20 09:29:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 460 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 75,904 KB
最終ジャッジ日時 2024-05-02 20:15:59
合計ジャッジ時間 2,702 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
75,776 KB
testcase_01 AC 42 ms
51,584 KB
testcase_02 AC 42 ms
51,840 KB
testcase_03 AC 41 ms
51,840 KB
testcase_04 AC 42 ms
51,968 KB
testcase_05 AC 53 ms
60,928 KB
testcase_06 AC 128 ms
75,776 KB
testcase_07 AC 43 ms
51,456 KB
testcase_08 AC 52 ms
60,288 KB
testcase_09 AC 50 ms
60,160 KB
testcase_10 AC 89 ms
75,648 KB
testcase_11 AC 90 ms
75,904 KB
testcase_12 AC 86 ms
75,520 KB
testcase_13 AC 93 ms
75,648 KB
testcase_14 AC 91 ms
75,648 KB
testcase_15 AC 91 ms
75,776 KB
testcase_16 AC 56 ms
63,488 KB
testcase_17 AC 75 ms
75,648 KB
testcase_18 AC 84 ms
75,520 KB
testcase_19 AC 91 ms
75,648 KB
testcase_20 AC 87 ms
75,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    S = input()
    l = len(S)
    ans = 11
    for i in range(l - 3):
        cnt = 0
        for j in range(4):
            if S[i + j] != "good"[j]:
                cnt += 1
        for j in range(i + 4, l - 6):
            cnt2 = 0
            for k in range(7):
                if S[j + k] != "problem"[k]:
                    cnt2 += 1
            ans = min(ans, cnt + cnt2)
    print(ans)
        

for _ in range(int(input())):
    solve()
0