QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#59502 | #3491. Meow Factor 2 | yahoco | Compile Error | / | / | Python3 | 511b | 2022-10-29 19:30:37 | 2022-10-29 19:30:38 |
Judging History
你现在查看的是最新测评结果
- [2023-08-10 23:21:45]
- System Update: QOJ starts to keep a history of the judgings of all the submissions.
- [2022-10-29 19:30:38]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2022-10-29 19:30:37]
- 提交
answer
P = 'meow'
S = raw_input()
n = len(S)
opt = [i % 5 for i in range(5*(n+1))]
ans = 4
for i in range(n):
for j in range(4):
opt[5*(i+1)+j+1] = min(opt[5*i+j+1] + 1, # del
opt[5*(i+1)+j] + 1, # ins
opt[5*i+j] + (S[i] != P[j])) # sub
if i > 0 and j > 0 and S[i] == P[j-1] and S[i-1] == P[j]: # swap
opt[5*(i+1)+j+1] = min(opt[5*(i+1)+j+1], 1 + opt[5*(i-1)+j-1])
ans = min(ans, opt[5*(i+1)+4])
print ans
詳細信息
File "answer.code", line 14 print ans ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(ans)?