結果
| 問題 | No.252 "良問"(良問とは言っていない (2) | 
| コンテスト | |
| ユーザー |  fmhr | 
| 提出日時 | 2015-07-24 23:56:24 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                TLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 699 bytes | 
| コンパイル時間 | 149 ms | 
| コンパイル使用メモリ | 81,880 KB | 
| 実行使用メモリ | 90,744 KB | 
| 最終ジャッジ日時 | 2024-07-16 00:42:10 | 
| 合計ジャッジ時間 | 6,636 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | TLE * 1 -- * 6 | 
ソースコード
# -*- coding: utf-8 -*-
def check(s1, s2):
    c = 0
    for i in range(len(s1)):
        if s1[i]!=s2[i]:
            c += 1
    return c
t = int(input())
for i in range(t):
    index_good = 0
    index_problems = []
    s = input()
    cost = 100
    for j in range(len(s)):
        if s[j:j+7]=='problem':
            index_problems.append(j)
        for k in range(j+4, len(s)-6, 1):
            if cost > check(s[j:j+4], 'good')+check(s[k:k+7], 'problem'):
                cost = check(s[j:j+4], 'good')+check(s[k:k+7], 'problem')
                index_good = j
    for i in index_problems:
        if i>k:
            break
        if i < index_good:
            cost += 1
    print(cost)
            
            
            
        