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

Fixed submission:
def c_IrohaObsession(N, K, D):
    d = [str(i) for i in D]
    i = N
    while True:
        for c in str(i):
            if c in d:
                break
        else:
            return i
        i += 1
N,K = [int(i) for i in input().split()]
D = [int(i) for i in input().split()]
print(c_IrohaObsession(N, K, D))

Buggy submission (verdict: Runtime Error):
def c_iroha_obsession(N, K, D):
    for ans in range(N, 10 * N + 1):
        for digit in str(ans):  # 1桁ずつ調べる
            if int(digit) in D:  # 嫌いな数字があった
                break
        else:  # 嫌いな数字がなかった。このときのansが解
            break
    return ans
N,K = [int(i) for i in input().split()]
D = [int(i) for i in input().split()]
print(c_IrohaObsession(N, K, D))
Problem p02681 (python)

Fixed submission:
S=input()
T=input()
yes=True
l=len(S)
for i in range(0,l):
  if S[i]!=T[i]:
    yes=False
    break
if yes:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
yes=True
l=len(S)
for i in range l:
  if S[i]!=T[i]:
    yes=False
    break
if yes:
  print("Yes")
else:
  print("No")
Problem p02789 (python)

Fixed submission:
N,M=map(int,input().split())
if(N==M):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N,M=map(int,input())
if(N==M):
  print("AC")
else:
  print("WA")
Problem p03071 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np

def main():
    i=list(map(int, input().split()))
    coin=0
    if (i[0]<i[1]):
        coin =coin+i[1]
        i[1] =i[1]-1
    else:
        coin = coin + i[0]
        i[0] = i[0] - 1
    if (i[0] < i[1]):
        coin = coin + i[1]
        i[1] = i[1] - 1
    else:
        coin = coin + i[0]
        i[0] = i[0] - 1
    print(coin)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np

def main():
    a=int(input())
    b=int(input())
    c=max(a,b)
    print(c+(c-1))

if __name__ == '__main__':
    main()
Problem p02945 (python)

Fixed submission:
a = list(map(int,input().split()))
print(max(a[0]+a[1],a[0]-a[1],a[0]*a[1]))

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split())
print(max(a[0]+a[1],a[0]-a[1],a[0]*a[1]))
Problem p02969 (python)

Fixed submission:
a=input()
print(int(a)*int(a)*3)

Buggy submission (verdict: Runtime Error):
a=input()
print(3*a*a)
Problem p03577 (python)

Fixed submission:
print(input()[:-8])

Buggy submission (verdict: Runtime Error):
prunt(input()[:-8])

Buggy submission (verdict: Runtime Error):
prunt(input[:-8])
Problem p03587 (python)

Fixed submission:
s=input()
ans=0
for i in range (6):
  if int(s[i])==1:
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
s=input()
ans=0
for i range (6):
  if int(s[i])==1:
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
s=input()
ans=0
for i range 6:
  if int(s[i])==1:
    ans+=1
print(ans)
Problem p03591 (python)

Fixed submission:
s=input()
print("Yes" if len(s)>=4 and s[:4]=="YAKI" else "No")

Buggy submission (verdict: Runtime Error):
s=input()
print("Yes" if （len(s)>=4 and s[:4]=="YAKI"）else "No")

Buggy submission (verdict: Runtime Error):
s=input()
print("Yes" if len(s)>=4 && s[:4]=="YAKI" else "No")
Problem p03777 (python)

Fixed submission:
l = input().split()
a = l[0]
b = l[1]
flag = True
if (a=='H' and b=='H'):
    flag = True
if (a=='H' and b=='D'): 
    flag = False
if (a=='D' and b=='H'): 
    flag = False
if (a=='D' and b=='d'): 
    flag = True
print('H' if flag else 'D')

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
flag = True
if (a=='H' and b=='H'):
    flag = True
if (a=='H' and b=='D'): 
    flag = False
if (a=='D' and b=='H'): 
    flag = False
if (a=='D' and b=='d'): 
    flag = True
print('H' if flag else 'D')

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
flag = true
if (a=='H') and (b=='H')
    flag = true
if (a=='H') and (b=='D') 
    flag = false
if (a=='D') and (b=='H') 
    flag = false
if (a=='D') and (b=='d') 
    flag = true
print(flag?H:D)
Problem p03852 (python)

Fixed submission:
x = input()
if x == 'a' or x == 'i' or x == 'u' or x=='e' or x=='o':
  print ('vowel')
else:
  print ('consonant')

Buggy submission (verdict: Runtime Error):
x = input()
if x == 'a' or x == 'i' or x == 'u' or x=='e' or x=='o':
  print ('vowel')
else
  print ('consonant')

Buggy submission (verdict: Runtime Error):
x = input()
if x == 'a' || x == 'i' || x == 'u'||x=='e'||x=='o':
  print ('vowel')
else:
  print ('consonant')

Buggy submission (verdict: Runtime Error):
x = input()
if x == 'a' || x == 'i' || x == 'u'||x=='e'||x=='o':
  print ('vowel')
else
  print ('consonant')

Buggy submission (verdict: Runtime Error):
x = input()
if x == 'a' || x == 'i' || x == 'u'||x=='e'||x=='o':
  print ('vowel')
else
  print ('consonant')
Problem p04043 (python)

Fixed submission:
a,b,c =map(int,input().split())
if a == 5 and b==5 and c==7:
  print("YES")
elif a == 5 and b==7 and c==5:
  print("YES")
elif a == 7 and b==5 and c==5:
  print("YES")
else :
  print("NO")

Buggy submission (verdict: Runtime Error):
a,b,c =map(int,input().split())
if a == 5 && b==5 && c==7:
  print("YES")
elif a == 5 && b==7 && c==5:
  print("YES")
elif a == 7 && b==5 && c==5:
  print("YES")
else :
  print("NO")
Problem p02641 (python)

Fixed submission:
X, N = input().split()
X = int(X)
N = int(N)
p = list(map(int, input().split()))

tmp = [i for i in range(-101, 200)]
for i in p:
  tmp.remove(i)
for i in range(len(tmp)):
  tmp[i] = abs(tmp[i] - X)

ans = 0
for i in p:
  if X-min(tmp)==i:
    ans = 1

if ans==0:
  print(X-min(tmp))
else:
  print(X+min(tmp))

Buggy submission (verdict: Runtime Error):
X, N = input().split()
X = int(X)
N = int(N)
p = list(map(int, input().split()))

tmp = [i for i in range(1, 101)]
for i in p:
  tmp.remove(i)
for i in range(len(tmp)):
  tmp[i] = abs(tmp[i] - X)

ans = 0
for i in p:
  if X-min(tmp)==i:
    ans = 1

if ans==0:
  print(X-min(tmp))
else:
  print(X+min(tmp))
Problem p02748 (python)

Fixed submission:
A, B, M = input().split()
A=int(A)
B=int(B)
M=int(M)
a = list(map(int, input().split()))
b = list(map(int, input().split()))
x = [list(map(int, input().split())) for i in range(M)]
 
dis = []
for i in range(M):
    m = x[i][0]-1
    n = x[i][1]-1
    dis.append(a[m] + b[n] - x[i][2])
    
a.sort()
b.sort()
 
dis.append(a[0]+b[0])
 
print(min(dis))

Buggy submission (verdict: Runtime Error):
A, B, M = input().split()
A=int(A)
B=int(B)
M=int(M)
a = list(map(int, input().split()))
b = list(map(int, input().split()))
x = [list(map(int, input().split())) for i in range(M)]
 
dis = []
for i in range(M):
    m = x[i][0]-1
    n = x[i][0]-1
    dis.append(a[m] + b[n] - x[i][2])
    
a.sort()
b.sort()
 
dis.append(a[0]+b[0])
 
print(min(dis))

Buggy submission (verdict: Runtime Error):
A, B, M = input().split()
A=int(A)
B=int(B)
M=int(M)
a = list(map(int, input().split()))
b = list(map(int, input().split()))
x = [list(map(int, input().split())) for i in range(M)]

dis = []
for i in range(M):
    m = x[i][0]
    n = x[i][0]
    dis.append(a[m] + b[n] - x[i][2])
    
a.sort()
b.sort()

dis.append(a[0]+b[0])

print(min(dis))
Problem p02784 (python)

Fixed submission:
H, N = input().split()
H = int(H)
N = int(N)
A = input().split()
A = list(map(int, A))

if sum(A)>=H:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
H, N = input().split()
H = int(H)
N = int(N)

A = input().split()

if sum(A)>=H:
  print('Yes')
else:
  print('No')
Problem p02842 (python)

Fixed submission:
import math
N = int(input())
A = []
I = []
cnt=0

for i in range(50000):
  I.append(i)
  A.append(math.floor(1.08*i))

for i in range(len(A)):
  if A[i]==N:
    cnt+=i

if cnt!=0:
  print(cnt)
elif cnt==0:
  print(':(')

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
A = []
I = []
cnt=0

for i in range(50000):
  I.append(i)
  A.append(math.floor(1.08*i))

for i in range(len(A)+1):
  if A[i]==N:
    cnt+=i

if cnt!=0:
  print(cnt)
elif cnt==0:
  print(':(')
Problem p02921 (python)

Fixed submission:
S = input()
T = input()
S = [i for i in S]
T = [i for i in T]
cnt=0

for i in range(3):
  if S[i]==T[i]:
    cnt+=1

print(cnt)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
S = [i for i in S]
T = [i for i in T]

for i in range(3):
  if S[i]==T[i]:
    cnt+=1

print(cnt)
Problem p03000 (python)

Fixed submission:
N, X = map(int, input().split())
L = list(map(int, input().split()))
cnt = 1
D = 0

for i in L:
    D += i
    if D<=X:
        cnt += 1

print(min(N+1, cnt))

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
L = list(map(int, input().split()))
z = 0
cnt = 0

while z<=X:
    z += L[cnt]
    cnt += 1

print(min(cnt, N+1))

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
L = list(map(int, input().split()))
z = 0
cnt = 0

while z<=X:
    z += L[cnt]
    cnt += 1

print(cnt)
Problem p03086 (python)

Fixed submission:
S = list(map(str, input()))
cnt = 0
CNT = []
for i in range(len(S)):
    if S[i]=='A' or S[i]=='C' or S[i]=='G' or S[i]=='T':
        cnt += 1
        if i==len(S)-1:
            CNT.append(cnt)
    if S[i]!='A' and S[i]!='C' and S[i]!='G' and S[i]!='T':
        CNT.append(cnt)
        cnt = 0

print(max(CNT))

Buggy submission (verdict: Runtime Error):
S = list(map(str, input()))
cnt = 0
CNT = []
for i in range(len(S)):
    if S[i]=='A' or S[i]=='C' or S[i]=='G' or S[i]=='T':
        cnt += 1
    if S[i]!='A' and S[i]!='C' and S[i]!='G' and S[i]!='T':
        CNT.append(cnt)
        cnt = 0

print(max(CNT))
Problem p03106 (python)

Fixed submission:
A, B, K = map(int, input().split())
s = []
for i in range(1, 101):
    if A%i==0 and B%i==0:
        s.append(i)
print(s[len(s)-K])

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
s = []
for i in range(100):
  if A%i==0 and B%i==0:
    s.append(i)
print(s[K-1])
Problem p03238 (python)

Fixed submission:
N = int(input())
if N==1:
    print('Hello World')
elif N==2:
    A = int(input())
    B = int(input())
    print(A+B)

Buggy submission (verdict: Runtime Error):
N = int(input())
if N==1:
  print('Hello World')
elif N==2:
  A, B = map(int, input().split())
  print(A+B)
Problem p03477 (python)

Fixed submission:
A, B, C, D = map(int, input().split())
if A+B>C+D:
  print('Left')
elif A+B<C+D:
  print('Right')
else:
  print('Balanced')

Buggy submission (verdict: Runtime Error):
A, B, C, D = map(int, input())
if A+B>C+D:
  print('Left')
elif A+B<C+D:
  print('Right')
else:
  print('Balanced')
Problem p03501 (python)

Fixed submission:
N, A, B = map(int, input().split())
print(min(A*N, B))

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input(),split())
print(min(A*N, B))
Problem p03555 (python)

Fixed submission:
C11, C12, C13 = map(str, input())
C21, C22, C23 = map(str, input())
if C11+C12+C13==C23+C22+C21:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
C11, C12, C13 = map(str, input().split())
C21, C22, C23 = map(str, input().split())
if C11+C12+C13==C23+C22+C21:
  print('YES')
else:
  print('NO')
Problem p02945 (python)

Fixed submission:
a, b = input().split(" ")
a = int(a)
b = int(b)

add = a + b
diff = a - b
mul = a * b

print(max(add, diff, mul))

Buggy submission (verdict: Runtime Error):
k, x = map(int, input().split(' ')

minimum = max(x - k + 1, -1000000)
maximum = min(x + k - 1, 1000000)

ran = [str(i) for i in range(minimum, maximum+1)]
print(' '.join(ran)
Problem p03493 (python)

Fixed submission:
n = input()

n0 = int(n[0])
n1 = int(n[1])
n2 = int(n[2])

s = n0 + n1 + n2
print(s)

Buggy submission (verdict: Runtime Error):
def two_power(num: int) -> int:
    count = 0

    while num % 2 == 0:
        try:
            num = num / 2
            count += 1
        except ValueError:
            pass
    return count


n = int(input())
li = (input().split(' '))

l = []
for i in range(0, n):
    l.append(int(li[i]))

ans_list = []
for i in range(0, n):
    ans_list.append(two_power(l[i]))

print(min(ans_list))

Buggy submission (verdict: Runtime Error):
def two_power(num: int) -> int:
    count = 0

    while num % 2 == 0:
        try:
            num = num / 2
            count += 1
        except ValueError:
            pass
    return count


n = int(input())
li = (input().split(' '))

l = []
for i in range(0, n):
    l.append(int(li[i]))

ans_list = []
for i in range(0, n):
    ans_list.append(two_power(l[i]))

print(max(ans_list))
Problem p02618 (python)

Fixed submission:
def input_one_number():
    return int(input())


D = input_one_number()

def input_multiple_number_as_list():
    return list(map(int, input().split()))

c = input_multiple_number_as_list()

s = [[]*26 for _ in range(D)]

for i in range(D):
	s[i] = input_multiple_number_as_list()

for day in range(D):
	m = max(s[day])
	print(s[day].index(m)+1)

Buggy submission (verdict: Runtime Error):
def input_one_number():
    return int(input())


D = input_one_number()

def input_multiple_number_as_list():
    return list(map(int, input().split()))

c = input_multiple_number_as_list()
last = [-1]*26


s = [[]*26 for _ in range(D)]

def dot(day):
	k = [0]*26
	for i in range(26):
		k[i] = c[i]*(day+1-last[i])
	return k


for i in range(D):
	s[i] = input_multiple_number_as_list()

for day in range(D):
	maxSatis = max(s[day])
	damage = dot(day)
	maxDamage = max(damage)

	if(maxSatis > maxDamage):
		idx = s[day].index(maxSatis)
		print(idx+1)
		last[idx] = day
	else:
		idx = s[day].index(maxDamage)
		print(idx+1)
		last[idx] = day
Problem p02646 (python)

Fixed submission:
# -*- coding: utf-8 -*-

def input_one_number():
    return int(input())

def input_multiple_number():
    return map(int, input().split())

def input_multiple_number_as_list():
    return list(map(int, input().split()))


A , V = input_multiple_number()
B, W = input_multiple_number()
T = input_one_number()

D = abs(B-A)
v = V-W

if D - v*T > 0 :
	print("NO")
else:
	print("YES")

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

def input_one_number():
    return int(input())

def input_multiple_number():
    return map(int, input().split())

def input_multiple_number_as_list():
    return list(map(int, input().split()))


A , V = input_multiple_number()
B, W = input_multiple_number()
T = input_one_number()

D = abs(B-A)
v = W-V

if D - v*T > 0 or :
	print("NO")
else:
	print("YES")
Problem p02678 (python)

Fixed submission:
# -*- coding: utf-8 -*-

def input_one_number():
    return int(input())

def input_multiple_number():
    return map(int, input().split())

def input_multiple_number_as_list():
    return list(map(int, input().split()))

N,M = input_multiple_number()

shilve = [-1]*(N+1)
michi = [[] for _i in range(N+1)]

for i in range(M):
	a,b = input_multiple_number()
	michi[a].append(b)
	michi[b].append(a)

que = [1]

while len(que) > 0:
	now_heya = que.pop(0)
	for nexthop in michi[now_heya]:
		if shilve[nexthop] == -1:
			shilve[nexthop] = now_heya
			que.append(nexthop)


print("Yes")
for i in shilve[2:]:
	print(i)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

def input_one_number():
    return int(input())

def input_multiple_number():
    return map(int, input().split())

def input_multiple_number_as_list():
    return list(map(int, input().split()))



N,M = input_multiple_number()

ans = [0]*(N)
ans[0] = 1
michi = [[] for i in range(N+1)]
isVisit = [False]*N
isVisit[0] = True

for i in range(M):
	a,b = input_multiple_number()
	michi[a].append(b)
	michi[b].append(a)

def DFS(K):
	for heya in michi[K]:
		if ans[heya-1] == 0:
			ans[heya-1] = K

	for heya in michi[K]:
		if not isVisit[heya-1]:
			isVisit[heya-1] = True
			DFS(heya)

DFS(1)
print("Yes")
for i in ans[1:]:
	print(i)
Problem p02924 (python)

Fixed submission:
n=int(input())-1
print((1+n)*n//2)

Buggy submission (verdict: Runtime Error):
n=int(input)-1
print((1+n)*n//2)
Problem p02573 (python)

Fixed submission:
import networkx as nx
n,m=map(int,input().split())
if m==0:print(1);exit()
a=[[i for i in input().split()] for _ in range(m)]
g=nx.Graph()
for x in a:
     g.add_edge(x[0],x[1])
print(len(sorted(nx.connected_components(g),key=len,reverse=True)[0]))

Buggy submission (verdict: Runtime Error):
import networkx as nx
n,m=map(int,input().split())
a=[[i for i in input().split()] for _ in range(m)]
g=nx.Graph()
for x in a:
     g.add_edge(x[0],x[1])
print(len(sorted(nx.connected_components(g),key=len,reverse=True)[0]))

Buggy submission (verdict: Runtime Error):
import networkx as nx
n,m=map(int,input().split())
a=[[tuple(i) for i in input().split()] for _ in range(m)]
g=nx.Graph()
g.add_edges_from(a)
print(sorted([len(i) for i in nx.connected_components(g)])[-1])
Problem p02584 (python)

Fixed submission:
x,k,d=map(int,input().split())

if x==0 and k%2==0:print(0)
if x==0 and k%2==1:print(d)

if x>0 and x>=k*d:print(x-k*d)
if x>0 and x<k*d:
    if ((x-x%d)//d)%2==k%2:print(x%d)
    else:print(abs(x%d-d))
if x<0 and -x>=k*d:print(-x-k*d)
if x<0 and -x<k*d:
    if ((abs(x)-abs(x)%d)//d)%2==k%2:print(-x%d)
    else:print(abs(-x%d-d))

Buggy submission (verdict: Runtime Error):

x,k,d=map(int,input().split())

if x==0 and k%2==0:print(0)
if x==0 and k%2==1:print(d)

if x>0 and x>=k*d:print(x-k*d)
if x>0 and x<k*d:
    if ((x-x%d)//d)%2==k%2:print(x%d)
    else:print(abs(x%d-d))
if x<0 and -x>=k*d:print(-x-k*d)
if x<0 and -x<k*d:
    fewa
Problem p02678 (python)

Fixed submission:
import networkx as nx
n,m=map(int,input().split())
s=[list(map(int,input().split())) for i in range(m)]

g=nx.Graph()
g.add_nodes_from([i for i in range(1,n+1)])

for x in s:
    g.add_edge(x[0],x[1])
di=nx.predecessor(g,source=1)

if len(di)!=n:
    print("No")
    exit()

print("Yes")
for x in range(2,n+1):
    print(di[x][0])

Buggy submission (verdict: Runtime Error):
import networkx as nx
import matplotlib.pyplot as plt
n,m=map(int,input().split())
s=[list(map(int,input().split())) for i in range(m)]

g=nx.Graph()
g.add_nodes_from([i for i in range(1,n+1)])

for x in s:
    g.add_edge(x[0],x[1])
di=nx.single_target_shortest_path(g,target=1)

if len(di)!=n:
    print("No")
    exit()

print("Yes")
for x in range(2,n+1):
    print(di[x][1])
Problem p02684 (python)

Fixed submission:
n,k=map(int,input().split())
a=list(map(int,input().split()))
visited=[False]*(n+1)
visited[1]=True
l=[1]
i=a[0]

for x in range(n):
    if visited[i]:break
    visited[i]=True
    l.append(i)
    i=a[i-1]

d=-1
for x in range(n):
    if l[x]==i:
        d=x
        break

f=l[:d]
b=l[d:]

if len(f)==0:
    print(b[k%len(b)])
    exit()
 
if len(b)==0:
    print(f[k%len(f)])
    exit()

if k<=d:
    print(l[k])
    exit()
 
k-=len(f)
print(b[k%len(b)])

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
a=[p-1 for p in a]
l=[0]
i=a[0]
p=-1
q=-1
for x in range(n):
    if i in set(l):break
    l.append(i)
    i=a[i]
d=-1
for x in range(n):
    if a[x]==i:
        d=x
        break
f=l[:d]
b=l[d:]
print(l,f,b,d)
if len(f)==0 or len(b)==0:
    print(l[k%(n-1)]+1)
    exit()

if k<=d:
    print(l[k]+1)
    exit()

k-=len(f)
print(b[k%len(b)]+1)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
a=[p-1 for p in a]
l=[0]
i=a[0]
p=-1
q=-1
for x in range(n):
    if i in (l):break
    l.append(i)
    i=a[i]
d=-1
for x in range(n):
    if a[x]==i:
        d=x
        break
f=l[:d]
b=l[d:]
if d==0 or d==n-1 or d==-1:
    print(l[k%(n-1)]+1)
    exit()

if k<=d:
    print(l[k]+1)
    exit()

k-=len(f)
print(b[k%len(b)]+1)
Problem p02718 (python)

Fixed submission:
n,m=map(int,input().split())
a=list(map(int,input().split()))
a=sorted(a)[::-1]
s=sum(a)
print("Yes" if a[m-1]>=s/4/m else "No")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=list(map(int,input().split()))
a=sorted(a)[::-1]
s=sum(a)
print("Yes" if a[m]>=s/4/m else "No")
Problem p02899 (python)

Fixed submission:
n=int(input())
s=list(map(int,input().split()))
d={}
for x in range(len(s)):
    d[x]=s[x]
d=sorted(d.items(),key=lambda e: e[1])
p=list(map(str,[i+1 for i,j in d]))
print(" ".join(p))

Buggy submission (verdict: Runtime Error):
a=list(map(int,input().split()))
l=[]
for x in range(1,n+1):
    l.append(str(a.index(x)+1))
print(" ".join(l))
Problem p03150 (python)

Fixed submission:
s=input()
t="keyence"
f=False
if s[0:7]==t:f=True
for x in range(8):
    if s[:x]==t[:x] and s[-7+x:]==t[-7+x:]:f=True
print("YES" if f else "NO")

Buggy submission (verdict: Runtime Error):
s=input()
t="keyence"
i=0
for x in s:
    if t[i]==x:i+=1
print("YES" if i>6 else "NO")
Problem p03502 (python)

Fixed submission:
n=int(input())
l=list(str(n))
i=0
for x in l:
    i+=int(x)
if n%i==0:print("Yes")
else:print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
i=int(list(str(n))[0])+int(list(str(n))[1])
if n%i==0:print("Yes")
else:print("No")
Problem p03695 (python)

Fixed submission:
n=int(input())
s=list(map(int,input().split()))
l=[0 for _ in range(13)]
for x in s:
    l[x//400]+=1
j=sum(r>0 for r in l[:8])
print(max(1,j),j+sum(l[8:]))

Buggy submission (verdict: Runtime Error):
n=int(input())
s=list(map(int,input().split()))
l=[0 for _ in range(12)]
for x in s:
    l[x//400]+=1
j=sum(r>0 for r in l[:8])
print(j,j+sum(l[8:]))
Problem p02553 (python)

Fixed submission:
a, b, c, d = map(int, input().split())

ans = -(10**18)
ans = max(a*c, ans)
ans = max(a*d, ans)
ans = max(b*c, ans)
ans = max(b*d, ans)
print(ans)

Buggy submission (verdict: Runtime Error):
ans = -(10**9)
ans = max(a*c, ans)
ans = max(a*d, ans)
ans = max(b*c, ans)
ans = max(b*d, ans)
print(ans)

Buggy submission (verdict: Runtime Error):
ans = a*c
if ans < a*d:
    ans = a*d
elif ans < b*c:
    ans = b*c
elif ans < b*d:
    ans = b*d
print(ans)

Buggy submission (verdict: Runtime Error):
ans = -(10**9)
ans = max(a*d, ans)
ans = max(b*d, ans)
ans = max(a*c, ans)
ans = max(b*c, ans)
print(ans)
Problem p03281 (python)

Fixed submission:
# import sympy

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

n = int(input())
count = 0
for i in range(1, n+1):
    if i % 2 == 1:
        # if len(sympy.divisors(i)) == 8:
        if len(make_divisors(i)) == 8:
            count += 1
print(count)

Buggy submission (verdict: Runtime Error):
import sympy

n = int(input())
count = 0
for i in range(1, n+1):
    if i % 2 == 1:
        if len(sympy.divisors(i)) == 8:
            # print(i)
            count += 1
print(count)