Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03160 (python)

Fixed submission:
#!/usr/bin/env python
import os
import sys
from io import BytesIO, IOBase
#from bisect import bisect_left as bl                #c++ lowerbound bl(array,element)
#from bisect import bisect_right as br               #c++ upperbound br(array,element)
 
 
def main():
    n=int(input())
    a=list(map(int,input().split(" ")))
    dp=[0 for x in range(n+1)]
    dp[0]=0
    dp[1]=abs(a[1]-a[0])
    for x in range(2,n):
        dp[x]=min(dp[x-1]+abs(a[x]-a[x-1]),dp[x-2]+abs(a[x]-a[x-2]))
    print(dp[n-1])




#-----------------------------BOSS-------------------------------------!
# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split("")))
dp=[0 for x in range(n+1)]
dp[1]=0
dp[2]=abs(a[1]-a[0])
for x in range(3,n+1):
  dp[x]=min(dp[x-1]+abs(a[x]-a[x-1]),dp[x-2]+abs(a[x]-a[x-2]))
print(dp[n])
Problem p02606 (python)

Fixed submission:
a,b,c=map(int,input().split())
total=0
for i in range(a,b+1):
    if i%c==0:
        total+=1
print(total)

Buggy submission (verdict: Runtime Error):
def main():
    a=int(input())
    for w in range(1,a+1):
        if w<5:
            print(0)
        else:
            total=0
            for i in range(1,w):
                for j in range(1,w):
                    for k in range(1,w):
                        if (i**2)+(j**2)+(k**2)+i*k+i*j+k*j==w:
                            total+=1
            print(total)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
a=int(input())
for w in range(1,a+1):
    if w<5:
        print(0)
    else:
        total=0
        for i in range(1,w):
            for j in range(1,w):
                for k in range(1,w):
                    if (i**2)+(j**2)+(k**2)+i*k+i*j+k*j==w:
                        total+=1
        print(total)
Problem p02923 (python)

Fixed submission:
a=int(input())
b=list(map(int,input().split()))
total=0
total2=0
i=1
for i in range(a-1):
    if b[i+1]<=b[i]:
        total+=1
    else:
        if total2<=total:
            total2=total
        total=0
print(max(total2,total))

Buggy submission (verdict: Runtime Error):
a=int(input())
b=list(map(int,input().split()))
total=0
total2=0
i=1
while True:
    if b[i-1]>=b[i]:
        total+=1
    else:
        if total2<=total:
            total2=total
        total=0
    i+=1
    if i==a:
        break
print(max(total2,total))

Buggy submission (verdict: Runtime Error):
a=int(input())
b=list(map(int,input().split()))
total=0
total2=0
i=1
while True:
    if b[i-1]>=b[i]:
        total+=1
    else:
        if total2<=total:
            total2=total
            total=0
    i+=1
    if i==a:
        break
print(max(total2,total))

Buggy submission (verdict: Runtime Error):
a=int(input())
b=list(map(int,input().split()))
total=0
total2=0
i=1
while True:
    if b[i-1]>=b[i]:
        total+=1
    else:
        if total2<=total:
            total2=total
            total=0
    i+=1
    if i==a:
        break
print(max(total2))

Buggy submission (verdict: Runtime Error):
a=int(input())
b=list(map(int,input().split()))
total=0
total2=0
i=1
while True:
    if b[i-1]>=b[i]:
        total+=1
    else:
        if total2<=total:
            total2=total
            total=0
    i+=1
    if i==a:
        break
print(max(total2,total))
Problem p03126 (python)

Fixed submission:
N,M=map(int,input().split())
b=[]
s=[0]*M
for i in range(N):
    a=list(map(int,input().split()))
    del a[0]
    a.sort()
    b.append(a)
for i in range(N):
    for j in range(len(b[i])):
        s[b[i][j]-1]+=1
print(s.count(N))

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
b=[]
s=[0]*M
for i in range(N):
    a=list(map(int,input().split()))
    del a[0]
    a.sort()
    b.append(a)
for i in range(N):
    for j in range(len(b[i])):
        s[b[i][j]]+=1
print(s.count(N))
Problem p03160 (python)

Fixed submission:
n=int(input())
rec=list(map(int,input().split()))
s=[0,abs(rec[1]-rec[0])]
for i in range(2,n):
        total2=abs(rec[i]-rec[i-2])+s[i-2]
        total1=abs(rec[i]-rec[i-1])+s[i-1]
        s.append(min(total2,total1))
print(s[-1])

Buggy submission (verdict: Runtime Error):
n=int(input())
rec=list(map(int,input().split()))
s=[rec[0],abs(rec[1]-rec[0])]
for i in range(2,n):
        total2=abs(rec[i]-rec[i-2])+s[i-2]
        total1=abs(rec[i]-rec[i-1])+s[i-1]
        s.append(min(total2,total))
print(s[-1])

Buggy submission (verdict: Runtime Error):
n=int(input())
rec=list(map(int,input().split()))
s=[rec[0],rec[1]-rec[0]]
for i in range(2,n):
        total2=abs(rec[i]-rec[i-2])+s[i-2]
        total1=abs(rec[i]-rec[i-1])+s[i-1]
        s.append(min(total2,total))
print(s[-1])
Problem p03161 (python)

Fixed submission:
import math
from numba import jit
n,k=map(int,input().split())
h=list(map(int,input().split()))
@jit
def a(N,K,H):
    s=[0]*n
    for i in range(1,N):
        total=math.inf
        for j in range(1,K+1):
            if i-j<0:
                break
            total=min(total,abs(H[i]-H[i-j])+s[i-j])
        s[i]=(total)
    print(s[-1])
a(n,k,h)

Buggy submission (verdict: Runtime Error):
import math
from numba import jit
n,k=map(int,input().split())
h=list(map(int,input().split()))
s=[0]*n
@jit
for i in range(1,n):
    total=math.inf
    for j in range(1,k+1):
        if i-j<0:
            break
        total=min(total,abs(h[i]-h[i-j])+s[i-j])
    s[i]=(total)
print(s[-1])
Problem p03386 (python)

Fixed submission:
a,b,k=map(int,input().split())
x=[]
y=[]
if b-a<k:
    k=b-a+1
for i in range(a,a+k):
    x.append(i)
for i in range(b-k+1,b+1):
    x.append(i)
x=list(set(x))
x.sort()
for i in range(len(x)):
    print(x[i])

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
x=[]
y=[]
for i in range(a,b+1):
    x.append(i)
for i in range(k):
    y.append(x[i])
for i in range(1,k+1):
    y.append(x[-i])
y.sort()
for i in range(len(y)):
    print(y[i])

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
x=[]
y=[]
for i in range(a,b+1):
    x.append(i)
for i in range(k):
    y.append(x[i])
for i in range(1,k+1):
    y.append(x[-i])
y.sort()
for i in range(len(y)):
    print(y[i])
Problem p03598 (python)

Fixed submission:
a=int(input())
b=int(input())
c=list(map(int,input().split()))
total=0
for i in range(a):
    d=2*c[i]
    e=2*abs(b-c[i])
    total+=min(d,e)
print(total)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=list(map(int,input().split()))
total=0
for i in range(2):
    d=2*c[i]
    e=2*abs(9-c[i])
    total+=min(d,e)
print(total)

Buggy submission (verdict: Runtime Error):
#Collecting Balls
a=int(input())
b=int(input())
c=list(map(int,input().split()))
total=0
for i in range(2):
    d=2*c[i]
    e=2*abs(9-c[i])
    total+=min(d,e)
print(total)
Problem p03845 (python)

Fixed submission:
import copy
n=int(input())
t=list(map(int,input().split()))
m=int(input())
for i in range(m):
    a,b=map(int,input().split())
    total=copy.copy(t)
    total[a-1]=b
    print(sum(total))

Buggy submission (verdict: Runtime Error):
#Contest with Drinks Easy
n=int(input())
t=list(map(int,input().split()))
m=int(input())
for i in range(m):
    a,b=map(int,input().split())
    total=t
    total[a]=b
    print(sum(total))

Buggy submission (verdict: Runtime Error):
n=int(input())
t=list(map(int,input().split()))
m=int(input())
for i in range(m):
    a,b=map(int,input().split())
    total=t
    total2[a]=b
    print(sum(total2))
Problem p04012 (python)

Fixed submission:
w=sorted(input())
total=False
if len(w)==1:
    total=True
    print("No")
else:
    for i in range(0,len(w),2):
        if w[i]!=w[i+1]:
            print("No")
            total=True
            break
if total==False:
    print("Yes")

Buggy submission (verdict: Runtime Error):
w=sorted(input())
total=False
for i in range(0,len(w),2):
    if w[i]!=w[i+1]:
        print("No")
        total=True
        break
if total==False:
    print("Yes")
Problem p02761 (python)

Fixed submission:
import sys
n,m=map(int,input().split())
a1=0
a2=0
a3=0
c1=0
c2=0
c3=0
for i in range(m):
    s,c=map(int,input().split())
    if s==1:
        if c1==1:
            if a1==c:
                pass
            else:
                print(-1)
                sys.exit()
        else:
            a1=c
            c1=1
    if s==2:
        if c2==1:
            if a2==c:
                pass
            else:
                print(-1)
                sys.exit()
        else:
            a2=c
            c2=1
    if s==3:
        if c3==1:
            if a3==c:
                pass
            else:
                print(-1)
                sys.exit()
        else:
            a3=c
            c3=1
if n==1:
    pass
else:
    if c1==0:
        a1=1
if n==1:
    ans=a1
elif n==2:
    ans=a1*10+a2
else:
    ans=a1*100+a2*10+a3
k=ans//10**(n-1)
if k==0:
    if n==1:
        print(ans)
    else:
        print(-1)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
import sys
n,m=map(int,input().split())
l=[0]*n
k=-1
for i in range(n):
    s,c=map(int,input().split())
    if s==1:
        if c==0:
            print(-1)
            sys.exit()
    if l[s-1]!=0:
        if l[s-1]==c:
            pass
        else:
            print(-1)
            sys.exit()
    l[s-1]=c
a=""
for j in range(n):
    a+=str(l[j])
if a[0]=="0":
    a[0]=="1"
print(int(a))
Problem p02768 (python)

Fixed submission:
def cmb(n, r, mod):
    c=1
    for i in range(1, r+1):
        c = (c * (n-i+1) * pow(i, mod-2, mod)) % mod
    return c

n, a, b = map(int, input().split())
MOD = 10**9 + 7
print((pow(2, n, MOD) - cmb(n, a, MOD) - cmb(n, b, MOD) - 1) % MOD)

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
ans=2**n-1
n1=1
n2=1
for i in range(a):
    n1*=n-i
    n1/=i+1
for j in range(b):
    n2*=n-i
    n2/=i+1
print(int(ans-n1-n2))

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
ans=2**n
n1=1
n2=1
for i in range(1,1+a):
    n1 = n1 * (n - i + 1) / i
    n1%=10**9+7
for j in range(1,1+b):
    n2 = n2 * (n - j + 1) /j
    n2%=10**9+7
ans-=n1+n2
ans=ans%(10**9+7)
print(int(ans-1))
Problem p02848 (python)

Fixed submission:
l=["A",'B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',"A",'B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
n=int(input())
s=input()
ans=""
for i in range(len(s)):
    ans+=l[l.index(s[i])+n]
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

l=["A",'B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',"A",'B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
n=int(input())
s=input()
ans=""
for i in range(len(s)):
    ans+=l[l.index(s[i])+n]
print(ans)
Problem p02882 (python)

Fixed submission:
import math

a,b,x=map(int,input().split())
x/=a
half=a*b/2
if x>half:
    print(math.degrees(math.atan(2*(a*b-x)/a/a)))
else:
    print(math.degrees(math.atan(b/(2*x/b))))

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
import math

a,b,x=map(int,input().split())
cm2=a*a*b
long1=(cm2-x)/(a*a)
if b-long1*2>=0:
    ans=(math.degrees(math.atan((b-long1*2)/a)))
else:
    ans=math.degrees(math.atan(a**3/2(a*a*b-x)))
print(ans)
Problem p02903 (python)

Fixed submission:
import sys
input = sys.stdin.readline

h,w,a,b=map(int,input().split())
l=[]
for i in range(b):
    l.append([0]*a+[1]*(w-a))
for _ in range(h-b):
    l.append([1]*a+[0]*(w-a))
for k in range(h):
    s=""
    for v in range(w):
        s+=str(l[k][v])
    print(s)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

h,w,a,b=map(int,input().split())
l=[]
for i in range(b):
    l.append([0]*a+[1]*(h-a))
for _ in range(w-b):
    l.append([1]*a+[0]*(h-a))
for k in range(h):
    s=""
    for v in range(w):
        s+=str(l[k][v])
    print(s)
Problem p02911 (python)

Fixed submission:
n,k,q=map(int,input().split())
m=[0]*n
ans=0
for i in range(q):
    answer=int(input())
    m[answer-1]+=1
for _ in range(n):
    if k-q+m[_]>0:
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
n,k,q=map(int,input().split())
m=[0]*n
ans=0
for i in range(q):
    answer=int(input())
    m[answer-1]+=1
for _ in range(q):
    if k-q+m[_]>0:
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
n,k,q=map(int,input().split())
l=[k]*n
m=[0]*n
ans=0
for i in range(q):
    answer=int(input())
    m[answer-1]+=1
for _ in range(q):
    if l[_]-q+m[_]>0:
        ans+=1
print(ans)
Problem p02993 (python)

Fixed submission:
s=input()
for i in range(3):
    if s[i]==s[i+1]:
        ans=1
        break
    else:
        ans=0
print("Bad" if ans==1 else "Good")

Buggy submission (verdict: Runtime Error):
s=input()
for i in range(3):
    if s[i]==s[i+1]:
        ans=1
print("Bad" if ans==1 else "Good")
Problem p03000 (python)

Fixed submission:
n,x=map(int,input().split())
l=list(map(int,input().split()))
ans=1
place=0
for i in l:
    place+=i
    if place>x:
        break
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
l=list(map(int,input().split()))
ans=0
pop=0
i=0
while(pop<=x or i<n):
    pop+=l[i]
    ans+=1
    i+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
l=list(map(int,input().split()))
ans=0
pop=0
i=0
while(pop<=x):
    pop+=l[i]
    i+=1
    ans+=1
print(ans)
Problem p03001 (python)

Fixed submission:
W,H,x,y=map(int,input().split())
print(W*H/2,1 if x==W/2 and y==H/2 else 0)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

W,H,x,y=map(int,input().split())
l=[0,0]
if H/W==y/x or -H/W==(H-h)/x or (x==0 and y==H) or (x==0 and y==0) or (x==W and y==0) or (x==W and y==H):
    l.append(H*W/2)
v=min(x*H,(W-x)*H)
l.append(v)
h=min(y*W,(H-y)*W)
l.append(h)
l.sort()
if l[-1]==l[-2]:
    print(l[-1],1)
else:
    print(l[-1],0)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

W,H,x,y=map(int,input().split())
l=[0]
if H/W==y/x:
    l.append(H*W/2)
v=min(x*H,(W-x)*H)
l.append(v)
h=min(y*W,(H-y)*W)
l.append(h)
l.sort()
if l[-1]==l[-2]:
    print(l[-1],1)
else:
    print(l[-1],0)
Problem p03076 (python)

Fixed submission:
l=[]
for i in range(5):
    l.append(int(input()))
indexn=10
indx=0
for v in range(5):
    if l[v]%10==0:
        pass
    else:
        if l[v]%10<indexn:
            indexn=l[v]%10
            indx=v
for k in range(5):
    l[k]=((l[k]-1)//10+1)*10
        
print(sum(l)-10+indexn)

Buggy submission (verdict: Runtime Error):
l=[]
for i in range(5):
    l.append(int(input()))
indexn=10
indx=0
for v in range(5):
    if l[v]%10==0:
        pass
    else:
        if l[v]%10<indexn:
            indexn=l[v]%10
            indx=v
for k in range(5):
    if k!=indx:
        l[v]=((l[v]-1)//10+1)*10
    else:
        
print(sum(l))
Problem p03103 (python)

Fixed submission:
n,m=map(int,input().split())
l=[list(map(int,input().split())) for i in range(n)]
l.sort()
money=0
bottle=0
for i in range(n):
    if bottle+l[i][1]<=m:
        bottle+=l[i][1]
        money+=l[i][0]*l[i][1]
    else:
        money+=l[i][0]*(m-bottle)
        break
print(money)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
l={}
nedan=[]
ans=0
num=0
small=0
for i in range(n):
    kane,kazu=map(int,input().split())
    if kane in nedan:
        l[kane]+=kazu
    else:
        l[kane]=kane
    nedan.append(kane)
nedan.sort()
set(nedan)
while True:
    if num+l[nedan[small]]<m:
        ans+=nedan[small]*l[nedan[small]]
        num+=l[nedan[small]]
        small+=1
    else:
        ans+=(m-num)*nedan[small]
        break
print(ans)
Problem p03136 (python)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
l.sort()
m=l[-1]
s=0
for i in range(n-1):
    s+=l[i]
print("Yes" if m<s else "No")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
x=list(map(int,input().split()))
if n==1:
    print(max(x)-min(x))
elif m==1 or n>=m:
    print(0)
else:
    goukei=0
    l=[0]
    i=0
    x.sort()
    a=0
    b=0
    while i<m-1:
        a=x[i]
        b=x[i+1]
        goukei+=b-a
        l.append(b-a)
        i+=1
    for v in range(n-1):
        goukei-=max(l)
        l.remove(max(l))
    print(goukei)
Problem p03141 (python)

Fixed submission:
la=[]
lb=[]
n=int(input())
kari=[]
tak=0
ao=0
s=-1
for i in range(n):
    a,b=map(int,input().split())
    la.append(a)
    lb.append(b)
    kari.append(a+b)
    ao+=b
kari.sort()
if n%2==0:
    for v in range(int(n/2)):
        tak+=kari[s]
        s+=-2
else:
    for k in range(int(n/2)+1):
        tak+=kari[s]
        s+=-2
print(tak-ao)

Buggy submission (verdict: Runtime Error):
la=[]
lb=[]
n=int(input())
kari=[]
tak=0
ao=0
for i in range(n):
    a,b=map(int,input().split())
    la.append(a)
    lb.append(b)
    kari.append(a-b)
while la!=[]:
    if max(kari)+min(kari)>0:
        tak+=la[kari.index(max(kari))]
        kari.remove(max(kari))
        la.remove(la[kari.index(max(kari))])
        lb.remove(lb[kari.index(max(kari))])
    else:
        tak+=la[kari.index(min(kari))]
        kari.remove(min(kari))
        la.remove(la[kari.index(min(kari))])
        lb.remove(lb[kari.index(min(kari))])
    if la==[]:
        break
    if max(kari)+min(kari)>0:
        ao+=la[kari.index(min(kari))]
        kari.remove(max(kari))
        la.remove(la[kari.index(min(kari))])
        lb.remove(lb[kari.index(min(kari))])
    else:
        ao+=la[kari.index(min(kari))]
        kari.remove(max(kari))
        la.remove(la[kari.index(max(kari))])
        lb.remove(lb[kari.index(max(kari))])
print(int(tak-ao))

Buggy submission (verdict: Runtime Error):
la=[]
lb=[]
n=int(input())
kari=[]
tak=0
ao=0
for i in range(n):
    a,b=map(int,input().split())
    la.append(a)
    lb.append(b)
    kari.append(a-b)
while la!=[]:
    if max(kari)+min(kari)>0:
        tak+=la[kari.index(max(kari))]
        kari.remove(max(kari))
        la.remove(la[kari.index(max(kari))])
        lb.remove(lb[kari.index(max(kari))])
    else:
        tak+=la[kari.index(min(kari))]
        kari.remove(min(kari))
        la.remove(la[kari.index(min(kari))])
        lb.remove(lb[kari.index(min(kari))])
    if max(kari)+min(kari)>0:
        ao+=la[kari.index(min(kari))]
        kari.remove(max(kari))
        la.remove(la[kari.index(min(kari))])
        lb.remove(lb[kari.index(min(kari))])
    else:
        ao+=la[kari.index(min(kari))]
        kari.remove(max(kari))
        la.remove(la[kari.index(max(kari))])
        lb.remove(lb[kari.index(max(kari))])
print(int(tak-ao))
Problem p03150 (python)

Fixed submission:
s=input()
if (s[:7]=="keyence" or s[:6]+s[-1:]=="keyence" or s[:5]+s[-2:]=="keyence" or s[:4]+s[-3:]=="keyence" or s[:3]+s[-4:]=="keyence" or s[:2]+s[-5:]=="keyence" or s[:1]+s[-6:]=="keyence" or s[-7]=="keyence"):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
import sys

s=input()
a,b,c,d,e,f,g=0
while s[a]!="k":
    a+=1
    if a==len(s):
        print("NO")
        sys.exit()
b=a+1
while s[b]!="e":
    b+=1
    if b==len(s):
        print("NO")
        sys.exit()
c=b+1
while s[c]!="y":
    c+=1
    if c==len(s):
        print("NO")
        sys.exit()
d=c+1
while s[d]!="e":
    d+=1
    if d==len(s):
        print("NO")
        sys.exit()
e=d+1
while s[e]!="n":
    e+=1
    if e==len(s):
        print("NO")
        sys.exit()
f=e+1
while s[f]!="c":
    f+=1
    if f==len(s):
        print("NO")
        sys.exit()
g=f+1
while s[g]!="e":
    g+=1
    if not "e" in s[g]:
        print("NO")
        sys.exit()
if s=="keyence":print("YES")
else:
    if b+g==c+f==d+e:
        print("YES")
    elif a==0 and b!=1 and(c==b+1 and d==c+1 and e==d+1 and f==e+1 and g==f+1):
        print("YES")
    elif a==0 and b==1 and c!=2 and(d==c+1 and e==d+1 and f==e+1 and g==f+1):
        print("YES")
    elif a==0 and b==1 and c==2 and d!=3 and (e==d+1 and f==e+1 and g==f+1):
        print("YES")
    elif a==0 and b==1 and c==2 and d==3 and e!=4 and (f==e+1 and g==f+1):
        print("YES")
    elif a==0 and b==1 and c==2 and d==3 and e==4 and f!=5 and g==f+1:
        print("YES")
    elif a==0 and b==1 and c==2 and d==3 and e==4 and f!=5 and g!=6:
        print("YES")
    else:
        print("NO")
Problem p03192 (python)

Fixed submission:
a = input()
a = str(a)
b = 0
for i in range(len(a)):
    if a[i]=="2":
        b=b+1
    else:
        b=b
print(b)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a==0:
    print(b)
elif b==1:
    print(b)
else:
    print(b)

Buggy submission (verdict: Runtime Error):
a = str(input())
b = 0
for i in range(4):
if a[i]==2:
b=b+1
else:
b=b

print(b)

Buggy submission (verdict: Runtime Error):
a = input()
b = 0
for i in range(len(a)):
if a[i]==2:
b=b+1
else:
b=b
print(b)

Buggy submission (verdict: Runtime Error):
a = input()
b = 0
for i in range(len(a)):
if a[i]==2:
b=b+1
print(b)

Buggy submission (verdict: Runtime Error):
a = input()
b = 0
for i in range(len(a)):
Problem p03206 (python)

Fixed submission:
D = int(input())

if D == 25:
  print("Christmas")
elif D == 24:
  print("Christmas Eve")
elif D == 23:
  print("Christmas Eve Eve")
else:
  print("Christmas Eve Eve Eve")

Buggy submission (verdict: Runtime Error):
D = int(input())

if D ==25:
  print("Christmas")
elif D ==24:
  print("Christmas Eve")
elif D ==23:
  print("Christmas Eve Eve")
else D ==22:
  print("Christmas Eve Eve Eve")

Buggy submission (verdict: Runtime Error):
D = int(input())

if D==25:
  print("Christmas")
  elif D==24:
    print("Christmas Eve")
    elif D==23:
      print("Christmas Eve Eve")
      else D==22:
        print("Christmas Eve Eve Eve")
Problem p03219 (python)

Fixed submission:
X,Y = map(int,input().split())
a = int(X + Y/2)
print(a)

Buggy submission (verdict: Runtime Error):
X = int(input())
Y = int(input())
a = int(X + Y/2)
print(a)
Problem p03220 (python)

Fixed submission:
n=int(input())
t,a=map(int,input().split())
l=list(map(int,input().split()))
for i in range(n):
    l[i]=abs(a-(t-l[i]*0.006))
print(l.index(min(l))+1)

Buggy submission (verdict: Runtime Error):
n=int(inut())
t,a=map(int,input().split())
l=list(map(int,input().split()))
for i in range(n):
    l[i]=abs(a-(t-l[i]*0.006))
print(l.index(min(l))+1)