結果
| 問題 |
No.150 "良問"(良問とは言っていない
|
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2020-12-10 08:13:18 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 301 ms / 5,000 ms |
| コード長 | 334 bytes |
| コンパイル時間 | 564 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 77,432 KB |
| 最終ジャッジ日時 | 2024-09-19 15:54:08 |
| 合計ジャッジ時間 | 3,688 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 20 |
ソースコード
T = int(input())
good ="good"
problem = "problem"
for _ in range(T):
s = input()
L = len(s)
ans = 11
for i in range(L):
v = sum(si!=sj for si,sj in zip(good,s[i:i+4]))
for j in range(i+4,L-6):
w = sum(si!=sj for si,sj in zip(problem,s[j:j+7]))
ans = min(ans,v+w)
print(ans)
convexineq