結果

問題 No.150 "良問"(良問とは言っていない
ユーザー あかりきあかりき
提出日時 2021-02-23 21:42:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 137 ms / 5,000 ms
コード長 344 bytes
コンパイル時間 175 ms
コンパイル使用メモリ 81,664 KB
実行使用メモリ 75,960 KB
最終ジャッジ日時 2023-10-23 22:38:12
合計ジャッジ時間 3,121 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
75,636 KB
testcase_01 AC 38 ms
53,392 KB
testcase_02 AC 38 ms
53,392 KB
testcase_03 AC 39 ms
53,392 KB
testcase_04 AC 39 ms
53,392 KB
testcase_05 AC 51 ms
64,340 KB
testcase_06 AC 137 ms
75,960 KB
testcase_07 AC 39 ms
53,392 KB
testcase_08 AC 53 ms
64,368 KB
testcase_09 AC 49 ms
62,104 KB
testcase_10 AC 79 ms
75,616 KB
testcase_11 AC 81 ms
75,632 KB
testcase_12 AC 74 ms
75,624 KB
testcase_13 AC 81 ms
75,652 KB
testcase_14 AC 85 ms
75,660 KB
testcase_15 AC 90 ms
75,636 KB
testcase_16 AC 55 ms
64,360 KB
testcase_17 AC 68 ms
72,732 KB
testcase_18 AC 75 ms
75,536 KB
testcase_19 AC 88 ms
75,652 KB
testcase_20 AC 87 ms
75,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

t=int(input())
g=list('good')
p=list('problem')
for i in range(t):
  s=list(input())
  n=len(s)
  ans=[]
  for j1 in range(n-10):
    for j2 in range(j1+4,n-6):
      ct=0
      for k in range(4):
        if s[j1+k]!=g[k]:
          ct+=1
      for k in range(7):
        if s[j2+k]!=p[k]:
          ct+=1
      ans.append(ct)
  print(min(ans))
0