6分求调。。。呜呜呜
查看原帖
6分求调。。。呜呜呜
1361333
huangbache楼主2025/1/27 21:30
a=str(input());t=0;l=len(a);p=[]
def f(a):
    global t
    global l
    for x in range(0,l-1):
        if a[x]=='V' and a[x+1]=="K":
            t+=1
    p.append(t)
    t=0
f(a)
for x in range(0,l):
    ll=list(a)
    ll[x]="V" if a[x]=="K" else "K"
    b=''.join(ll)
    f(b)
print(max(p))
   
 啊啊啊啊啊啊啊啊啊

2025/1/27 21:30
加载中...