結果

問題 No.150 "良問"(良問とは言っていない
ユーザー yuppe19 😺yuppe19 😺
提出日時 2015-12-03 11:05:18
言語 Python2
(2.7.18)
結果
AC  
実行時間 1,188 ms / 5,000 ms
コード長 277 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2024-04-19 09:29:57
合計ジャッジ時間 5,726 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 243 ms
6,144 KB
testcase_01 AC 11 ms
6,272 KB
testcase_02 AC 11 ms
6,272 KB
testcase_03 AC 11 ms
6,272 KB
testcase_04 AC 12 ms
6,144 KB
testcase_05 AC 23 ms
6,144 KB
testcase_06 AC 1,188 ms
6,272 KB
testcase_07 AC 11 ms
6,144 KB
testcase_08 AC 15 ms
6,144 KB
testcase_09 AC 12 ms
6,272 KB
testcase_10 AC 272 ms
6,272 KB
testcase_11 AC 313 ms
6,400 KB
testcase_12 AC 208 ms
6,144 KB
testcase_13 AC 295 ms
6,272 KB
testcase_14 AC 375 ms
6,144 KB
testcase_15 AC 361 ms
6,144 KB
testcase_16 AC 37 ms
6,272 KB
testcase_17 AC 109 ms
6,272 KB
testcase_18 AC 333 ms
6,272 KB
testcase_19 AC 409 ms
6,272 KB
testcase_20 AC 431 ms
6,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python
f = lambda a, b, n: sum(a[i]!=b[i] for i in xrange(n))

t = int(raw_input())
for _ in xrange(t):
    s = raw_input()
    n = len(s)
    res = min(f(s[i:i+4], 'good', 4) + f(s[j:j+7], 'problem', 7) for i in xrange(n-3) for j in xrange(i+4, n-6))
    print res
0