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

Fixed submission:
#A
x=list(map(int,input().split()))
for i in range(len(x)):
    if x[i] ==0:
        print(i+1)

Buggy submission (verdict: Runtime Error):
#D
from sys import stdin
def main():
    readline=stdin.readline
    n = int(readline())
    a = list(map(int,readline().split()))
    count=0
    for i in a:
        num_div=0
        for j in a:
            if i%j==0:
                num_div+=1
        if num_div==1:
            count+=1
    print(count)
main()
Problem p02677 (python)

Fixed submission:
#C
A, B, H, M= map(int,input().split())
import math
theta_S=-(30*H+(1/2)*M)+90
theta_L=-(6*M)+90
S_x=A*math.cos(math.radians(theta_S))
S_y=A*math.sin(math.radians(theta_S))
L_x=B*math.cos(math.radians(theta_L))
L_y=B*math.sin(math.radians(theta_L))
distance=((S_x-L_x)**2+(S_y-L_y)**2)**0.5
print(distance)

Buggy submission (verdict: Runtime Error):
import math
theta_S=30*H+(1/10)*M
theta_L=6*M
S_x=A*math.sin(math.radians(theta_S))
S_y=A*math.cos(math.radians(theta_S))
L_x=B*math.sin(math.radians(theta_L))
L_y=B*math.cos(math.radians(theta_L))
distance=((S_x-L_x)**2+(S_y-L_y)**2)**0.5
print(distance)
Problem p02615 (python)

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

a.sort(reverse=True)

count = 0
if N % 2 == 0:
  for i in range(int(N/2)):
    count += 2 * a[i]
  count -= a[0]
else:
  for i in range(int((N+1)/2)):
    count += 2 * a[i]
  count -= a[0]
  count -= a[int((N-1)/2)]
    
print(count)

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

a.sort(reverse=True)

count = 0
if N % 2 == 0:
  for i in range(int(N/2)):
    count += 2 * a[i]
    count -= a[0]
else:
  for i in range(int(N+1)/2):
    count += 2 * a[i]
    count -= a[0]
    count -= a[(N-1)/2]
    
print(count)
Problem p02681 (python)

Fixed submission:
S=input()
T=input()
if S==T[:len(T)-1]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N,K = map(int, input().split())
A =[0]
B=list(map(int, input().split()))
for m in range(N):
    A.append(B[m])
place=set([])
p=[]
i=1
count=0
while i not in place:
    place.add(i)
    p.append(i)
    i=A[i]
    count+=1
if count>=K:
    print(place[K+1])
else:
    loop=[i]
    start=i
    j=A[i]
    count+=1
    while j!=start:
        loop.append(j)
        j=A[j]
        count+=1
    num=(K-count)%len(loop)
    print(loop[num])
Problem p04043 (python)

Fixed submission:
N=list(map(int,input().split()))
if sorted(N)==[5,5,7]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
N=list(map(int,input(),split()))
if sorted(N)==[5,7,7]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
N=list(map(int.input(),split()))
if sorted(N)==[5,7,7]:
    print("YES")
else:
    print("NO")
Problem p02639 (python)

Fixed submission:
x = list(map(int,input().split()))
for i in range(len(x)):
  if x[i] == 0:
    print(i+1)

Buggy submission (verdict: Runtime Error):
x = list(map(int,input().split()))
for i in range(len(x)):
	if x[i] == 0:
      print(i+1)
Problem p02641 (python)

Fixed submission:
X,N = map(int,input().split())
n = list(map(int,input().split()))
xn = list(range(0,102))
answer = 0
for i in range(N):
  xn.remove(n[i])
mindis = 100
for i in range(len(xn)):
  dis = abs(X-xn[i])
  if dis < mindis:
    mindis = dis
    answer = xn[i]
print(answer)

Buggy submission (verdict: Runtime Error):
X,N = map(int,input().split())
n = list(map(int,input().split()))
xn = list(range(1,101))
for i in range(N):
  xn.remove(n[i])
mindis = 100
for i in range(len(xn)):
  dis = abs(X-xn[i])
  if dis < mindis:
    mindis = dis
    answer = xn[i]
print(answer)

Buggy submission (verdict: Runtime Error):
X,N = map(int,input().split())
n = list(map(int,input().split()))
xn = list(range(1,101))
for i in range(N):
  xn.remove(n[i])
n
mindis = 100
for i in range(100-len(n)):
  dis = abs(X-xn[i])
  if dis < mindis:
    mindis = dis
    answer = xn[i]
print(answer)
Problem p02713 (python)

Fixed submission:
from math import gcd
sum = 0
K = int(input())
for k in range(1,K+1):
  for j in range(1,K+1):
    t = gcd(k,j)
    for i in range(1,K+1):
      sum += gcd(t,i)
print(sum)

Buggy submission (verdict: Runtime Error):
import math
sum = 0
K = input()
for k in range(K):
  for j in range(K):
    for i in range(K):
      sum += math.gcd(math.gcd(k+1,j+1),i+1)
print(sum)

Buggy submission (verdict: Runtime Error):
import math
sum = 0
K = int(input())
for k in range(K):
  for j in range(K):
    for i in range(K):
      sum = sum + gcd(math.gcd(k+1,j+1),i+1)
print(sum)

Buggy submission (verdict: Runtime Error):
import math
sum = 0
K = input()
for k in range(K):
  for j in range(K):
    for i in range(K):
      sum = sum + gcd(math.gcd(k+1,j+1),i+1)
print(sum)
Problem p02718 (python)

Fixed submission:
N, M = map(int, input().split())
N = input().split()
N = [int(n) for n in N]
A = []
soutoku = 0
for i in N:
    soutoku += int(i)
N = sorted(N, reverse=True)
for i in range(M):
    A.append(N[i])
b = soutoku / (4*M)

if int(N[int(M-1)]) < b:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
N = input().split()
A = []
soutoku = 0
for i in N:
    soutoku += int(i)
N = sorted(N, reverse=True)
for i in range(M):
    A.append(N[i])

b = soutoku / 4 * M

if int(N[int(M)]) < int(b):
    print("No")
else:
    print("Yes")
Problem p02760 (python)

Fixed submission:
a,b,c = [input().split() for i in range(3)]

a.extend(b)
a.extend(c)
N = int(input())
b = [input() for i in range(N)]
for b1 in b:
    a = ['a' if b1 == s in s else s for s in a]

if a[0] == 'a' and a[1] == 'a' and a[2] == 'a':
    print("Yes")
elif a[3] == 'a' and a[4] == 'a' and a[5] == 'a':
    print("Yes")
elif a[6] == 'a' and a[7] == 'a' and a[8] == 'a':
    print("Yes")
elif a[0] == 'a' and a[3] == 'a' and a[6] == 'a':
    print("Yes")
elif a[1] == 'a' and a[4] == 'a' and a[7] == 'a':
    print("Yes")
elif a[2] == 'a' and a[5] == 'a' and a[8] == 'a':
    print("Yes")
elif a[0] == 'a' and a[4] == 'a' and a[8] == 'a':
    print("Yes")
elif a[2] == 'a' and a[4] == 'a' and a[6] == 'a':
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a,b,c = [input().split() for i in range(3)]

a.extend(b)
a.extend(c)
b = [input() for i in range(10)]
for b1 in b:
    a = ['a' if b1 == s in s else s for s in a]

if a[0] == 'a' and a[1] == 'a' and a[2] == 'a':
    print("Yes")
elif a[3] == 'a' and a[4] == 'a' and a[5] == 'a':
    print("Yes")
elif a[6] == 'a' and a[7] == 'a' and a[8] == 'a':
    print("Yes")
elif a[0] == 'a' and a[3] == 'a' and a[6] == 'a':
    print("Yes")
elif a[1] == 'a' and a[4] == 'a' and a[7] == 'a':
    print("Yes")
elif a[2] == 'a' and a[5] == 'a' and a[8] == 'a':
    print("Yes")
elif a[0] == 'a' and a[4] == 'a' and a[8] == 'a':
    print("Yes")
elif a[2] == 'a' and a[4] == 'a' and a[6] == 'a':
    print("Yes")
Problem p03161 (python)

Fixed submission:
N, K = map(int, input().split())
h = [int(i) for i in input().split()]
dp = [10**6] * 100005
dp[0] = 0
# dp[1] = abs(h[1]-h[0])
for i in range(1, N):
    dp[i] = min(dp[i-j] + abs(h[i-j] - h[i]) for j in range(1,min(K,i)+1))
    # print([dp[i-j] + abs(h[i-j] - h[i]) for j in range(1,min(K,i)+1)])
    # for j in range(1, min(K,i)+1):
    #     dp[i] = min(dp[i], dp[i-j] + abs(h[i-j] - h[i]))

print(dp[N-1])

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = [int(i) for i in input().split()]
dp = [10**6] * N
dp[0] = 0
dp[1] = abs(h[1]-h[0])
for i in range(1, N):
    for j in range(1, K+1):
        dp[i] = min(dp[i], dp[i-j] + abs(h[i]-h[i-j]))

print(dp[N-1])
Problem p02675 (python)

Fixed submission:
N=input()
if int(N[-1]) in [2,4,5,7,9]:
  print("hon")
elif int(N[-1]) in [0,1,6,8]:
  print("pon")
else:
  print("bon")

Buggy submission (verdict: Runtime Error):
N=input()
if N[-1] in [2,4,5,7,9]:
  print("hon")
elif N[-1] in [0,1,6,8]:
  print("pon"
else:
  print("bon")
Problem p02727 (python)

Fixed submission:
X,Y,A,B,C=list(map(int,input().split()))
p=list(map(int,input().split()))
q=list(map(int,input().split()))
r=list(map(int,input().split()))
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
eat=[]
eat.extend(p[:X])
eat.extend(q[:Y])
eat.sort(reverse=True)
i=0
j=0
result=0
for v in eat:
  if i<C and eat[j]<r[i]:
    result+=r[i]
    i+=1
  else:
    result+=eat[j]
    j+=1
  if i+j==X+Y:
    break
print(result)

Buggy submission (verdict: Runtime Error):
X,Y,A,B,C=list(map(int,input().split()))
p=list(map(int,input().split()))
q=list(map(int,input().split()))
r=list(map(int,input().split()))
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
eat=[]
eat.extend(p[:X])
eat.extend(q[:Y])
eat.sort(reverse=True)
i=0
result=0
for v in eat:
  if v<r[i]:
    result+=r[i]
    i+=1
  else:
    result+=v
print(result)
Problem p02601 (python)

Fixed submission:
A,B,C=map(int,input().split())
K=int(input())
a=K
while A>=B:
    B*=2
    a-=1

    
while B>=C:
    C*=2
    a-=1
    
if a>=0:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
 A,B,C=map(int,input().split())
K=int(input())
a=K
while A<B:
    B*=2
    a-=1

while B<C:
    C*=2
    a-=1

if a>=0:
    print('Yes')
else:
    print('No')
Problem p02613 (python)

Fixed submission:
N=int(input())
s=[]
for i in range(N):
    s.append(input())
a=s.count('AC')
b=s.count('WA')
c=s.count('TLE')
d=s.count('RE')
print('AC x ' +str(a))
print('WA x ' +str(b))
print('TLE x ' +str(c))
print('RE x ' +str(d))

Buggy submission (verdict: Runtime Error):
N=int(input())
s = [input() for i in range(N)]

print('AC x '+'s.count('AC')')
print('WA x '+'s.count('WA')')
print('TLE x '+'s.count('TLE')')
print('RE x '+'s.count('RE')')

Buggy submission (verdict: Runtime Error):
N=int(input())
s = [int(input()) for i in range(N)]

print('AC x '+s.count('AC'))
print('WA x '+s.count('WA'))
print('TLE x '+s.count('TLE'))
print('RE x '+s.count('RE'))
Problem p02700 (python)

Fixed submission:
A, B, C, D = map(int,input().split())
for i in range(100):
    C-=B
    A-=D
    if C<=0 and A<=0:
        print("Yes")
        break
    elif C>0 and A<=0:
        print("No")
        break
    else:
        continue

Buggy submission (verdict: Runtime Error):
A, B, C, D = map(int,input().split())
for i in 100:
    C-=B
    A-=D
    if C<=0 and A<=0:
        print("Yes")
    elif C>0 and A<=0:
        print("No")
    else:
        continue
Problem p02717 (python)

Fixed submission:
x,y,z=map(int,input().split())
print(z,x,y)
#print("{} {}".format(z,x,y))

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

print("{} {}".format(z,x,y))

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

print(z, x, y)

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

print(z,x,y)
Problem p02718 (python)

Fixed submission:
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
s=sum(A)

if A[M-1]>=s/(4*M):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=list(map(int,input().split()))
A=A.sort(reverse=True)
s=sum(A)

P=0 #選べる個数
for a in A:
    if a>=s/(4*M):
        P+=1
    else:
        break
        
if P==M:
    print("Yes")
else:
    print("No")
Problem p03434 (python)

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

A.sort(reverse = True)
Alice =Bob =0

for i in range(N):
    if i%2==0:
        Alice += A[i]
    else:
        Bob += A[i]
        
print(Alice-Bob)

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

A.sort(reverse = True)
Alice =Bob =0

for i in range(1, N+1):
    if i%2==0:
        Bob += A[i]
    else:
        Alice += A[i]
        
print(Alice-Bob)
Problem p02576 (python)

Fixed submission:
n, x, t = map(int, input().split())
print((n//x)*t if n%x == 0 else (n//x+1)*t)

Buggy submission (verdict: Runtime Error):
map(int, input().split())
print((n//x+1)*t)
Problem p02582 (python)

Fixed submission:
s = input()
S = s.split('S')

print(max([len(i) for i in S]))

Buggy submission (verdict: Runtime Error):
s = input()
s = s.split('S')
print(max(len(s)))

Buggy submission (verdict: Runtime Error):
s = input()

if s.count('R') == 2:
  print(s.count('RR'+1)
else:
  print(s.count('R')
Problem p02583 (python)

Fixed submission:
n = int(input())
L = list(map(int, input().split()))

from itertools import combinations

cnt = 0
for i in combinations(L, 3):
    longest = max(i)
    rest = sum(i) - max(i)
    if longest < rest and i[0] != i[1] and i[0] != i[2] and i[1] != i[2] :
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
L = list(map(int, input().split()))

cnt = 0
for i in combinations(L, 3):
    longest = max(i)
    rest = sum(i) - max(i)
    if longest < rest and i[0] != i[1] and i[0] != i[2] and i[1] != i[2] :
        cnt += 1
print(cnt)
Problem p03455 (python)

Fixed submission:
a, b = input().split()
a = int(a)
b = int(b)
print('Even' if a * b % 2 == 0 else 'Odd')

Buggy submission (verdict: Runtime Error):
a, b = input().split()
a = int(a)
b = int(b)
print('Even' if a * b % == 0 else 'Odd')

Buggy submission (verdict: Runtime Error):
a, b = input().split()
a = int(a)
b = int(b)
print('Even' if a*b%==0 else 'Odd')
Problem p03469 (python)

Fixed submission:
S = input()

print(S.replace('2017', '2018'))

Buggy submission (verdict: Runtime Error):
S = input()

print(S.replace('2017','2018')
Problem p03470 (python)

Fixed submission:
n = int(input())
cake = []
for i in range(n):
    cake.append(int(input()))
    
cake.sort()
kagami = [cake[0]]
num = cake[0]
for i in cake:
    if i > num:
        kagami.append(i)
        num = i
print(len(kagami))

Buggy submission (verdict: Runtime Error):
n = int(input())
cake = [input() for i range(n)]
    
print(len(set(cake)))

Buggy submission (verdict: Runtime Error):
n = int(input())
cake = input() for i range(n)
    
print(len(set(cake)))
Problem p03485 (python)

Fixed submission:
a, b = map(int, input().split())
if (a+b) % 2 == 0:
    ans = (a+b) / 2
else:
    ans = (a+b) // 2 + 1
print(int(ans))

Buggy submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
print(math.celi((a+b)/2)))
Problem p03624 (python)

Fixed submission:
s = input()

import string
a = list(string.ascii_lowercase)

for item in a:
    if item not in s:
        print(item)
        break
else:
    print('None')

Buggy submission (verdict: Runtime Error):
s = input()

import string
a = list(string.ascii_lowercase)

for item in a:
    if item not in s:
        print(a[i])
        break
else:
    print('None')
Problem p02630 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
B,C = [0 for i in range(Q)],[0 for i in range(Q)]
for i in range(Q):
    B[i],C[i] = map(int,input().split())

n = [0 for i in range(100001)]
S = 0
for i in range(N):
    n[A[i]] = n[A[i]] + 1
    S = S + A[i]

for i in range(Q):
    S = S + (C[i]-B[i])*n[B[i]]
    n[C[i]] = n[C[i]] + n[B[i]]
    n[B[i]] = 0
    print(S)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
B,C = [0 for i in range(Q)],[0 for i in range(Q)]
for i in range(Q):
    B[i],C[i] = map(int,input().split())

n = [0 for i in range(100000)]
S = 0
for i in range(N):
    n[A[i]] = n[A[i]] + 1
    S = S + A[i]

for i in range(Q):
    S = S + (C[i]-B[i])*n[B[i]]
    n[C[i]] = n[C[i]] + n[B[i]]
    n[B[i]] = 0
    print(S)
Problem p02640 (python)

Fixed submission:
X,Y = map(int,input().split())
Ans = "No"
if Y%2 == 0:
    if 2*X<=Y and Y<=4*X:
        Ans = "Yes"

print(Ans)

Buggy submission (verdict: Runtime Error):
X,Y = map(int,input().split())
Ans = "No"
if Y%2 = 0:
    if 2*X<=Y and Y<=4*X:
        Ans = "Yes"

print(Ans)
Problem p03059 (python)

Fixed submission:
a,b,t = map(int,input().split())
r = b * int(t/a)
print(r)

Buggy submission (verdict: Runtime Error):
a,b,t = map(input().split())
r = b * int(t/a)
print(r)
Problem p03060 (python)

Fixed submission:
n = int(input())
b = list(map(int,input().split()))
c = list(map(int,input().split()))
r=0
for i in range(n):
  if b[i]-c[i]>0:
    r = r + b[i] - c[i]
    
print(r)

Buggy submission (verdict: Runtime Error):
n = int(input())
b = list(input().split())
c = list(input().split())
r=0
for i in range(n):
  if b[i]-c[i]>0:
    r = r + b[i] - c[i]
    
print(r)
Problem p03062 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
neg = 0
r=0
for i in a:
  r = r + abs(i)
  if i < 0 :
     neg = neg + 1
if neg % 2 != 0:
  s = 10000000000
  for i in a:
    s = min(s,abs(i))
  r = r - 2*s
  
print(r)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
neg = 0
r = 
for i in a:
  r = r + abs(i)
  if i < 0 :
     neg = neg + 1
if neg % 2 != 0:
  s = 10000000000
  for i in a:
    s = min(s,abs(i))
  r = r - 2*s
  
print(r)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
neg = 0
for i in a:
  r = r + abs(i)
  if i < 0 :
     neg = neg + 1
if neg % 2 != 0:
  s = 10000000000
  for i in a:
    s = min(s,abs(i))
  r = r - 2*s
  
print(r)
Problem p03244 (python)

Fixed submission:
n = int(input())
v = list(map(int,input().split()))

if max(v)==min(v):
	print(int(n/2))
else:
	dic1 = {}
	dic2 = {}
	
	for i in range(n):
		if i % 2 == 1:
			if str(v[i]) in dic1.keys():
				dic1[str(v[i])] = dic1[str(v[i])] + 1
			else:
				dic1[str(v[i])] = 1
	
		if i % 2 == 0:
			if str(v[i]) in dic2.keys():
				dic2[str(v[i])] = dic2[str(v[i])] + 1
			else:
				dic2[str(v[i])] = 1
	
	max1 = max(dic1, key=dic1.get)
	max2 = max(dic2, key=dic2.get)
	p1 = dic1[max1]
	p2 = dic2[max2]
	if max1 == max2:
		dic1.pop(max1)
		dic2.pop(max2)
		if dic1 == {}:
			p3 = 0
		else:
			max3 = max(dic1, key=dic1.get)
			p3 = dic1[max3]
		if dic2 == {}:
			p4 = 0
		else:
			max4 = max(dic2, key=dic2.get)
			p4 = dic2[max4]
		if p1 + p4 > p2 + p3:
			p2 = p4
		else:
			p1 = p3
	
	print(n-p1-p2)

Buggy submission (verdict: Runtime Error):
n = int(input())
v = list(map(int,input().split()))

if max(v)==min(v):
	print(int(n/2))
else:
	dic1 = {}
	dic2 = {}
	
	for i in range(n):
		if i % 2 == 1:
			if str(v[i]) in dic1.keys():
				dic1[str(v[i])] = dic1[str(v[i])] + 1
			else:
				dic1[str(v[i])] = 1
	
		if i % 2 == 0:
			if str(v[i]) in dic2.keys():
				dic2[str(v[i])] = dic2[str(v[i])] + 1
			else:
				dic2[str(v[i])] = 1
	
	max1 = max(dic1, key=dic1.get)
	max2 = max(dic2, key=dic2.get)
	p1 = dic1[max1]
	p2 = dic2[max2]
	if max1 == max2:
		dic1.pop(max1)
		dic2.pop(max2)
		if dic1 == {}:
			p3 = 0
		else:
			max3 = max(dic1, key=dic1.get)
			p3 = dict[max3]
		if dic2 == {}:
			p4 = 0
		else:
			max4 = max(dic2, key=dic2.get)
			p4 = dic4[max4]
		if p1 + p4 > p2 + p3:
			p2 = p4
		else:
			p1 = p3
	
	print(n-p1-p2)

Buggy submission (verdict: Runtime Error):
n = int(input())
v = list(map(int,input().split()))

if max(v)==min(v):
	print(int(n/2))
else:
	dic1 = {}
	dic2 = {}
	
	for i in range(n):
		if i % 2 == 1:
			if str(v[i]) in dic1.keys():
				dic1[str(v[i])] = dic1[str(v[i])] + 1
			else:
				dic1[str(v[i])] = 1
	
		if i % 2 == 0:
			if str(v[i]) in dic2.keys():
				dic2[str(v[i])] = dic2[str(v[i])] + 1
			else:
				dic2[str(v[i])] = 1
	
	max1 = max(dic1, key=dic1.get)
	max2 = max(dic2, key=dic2.get)
	p1 = dic1[max1]
	p2 = dic2[max2]
	if max1 == max2:
		dic1.pop(max1)
		dic2.pop(max2)
		max3 = max(dic1, key=dic1.get)
		max4 = max(dic2, key=dic2.get)
		p3 = dic3[max3]
		p4 = dic4[max4]
		if p1 + p4 > p2 + p3:
			p2 = p4
		else:
			p1 = p3
	
	print(n-p1-p2)
Problem p03285 (python)

Fixed submission:
N = int(input())
q = 0
flug = 0
while q <= N :
	if N%7 == 0:
		flug = 1
		break
	
	if (N-q)%4 == 0:
		flug = 1
		break
	q = q + 7
 
if flug == 1:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
q = 0
flug = 0
while q <= N :
        if N%7 == 0:
                flug = 1
                break
	if N - q % 4 == 0:
		flug = 1
		break
	q = q + 7

if flug == 1:
	print("Yes")
else:
	print("No")
Problem p03323 (python)

Fixed submission:
A,B = map(int,input().split())
p = 0
if A>8:
	p = 1
if B>8:
	p = 1
if p==0:
	print("Yay!")
else:
	print(":(")

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
p = 0
if A>8:
	p = 1
if B>8:
	p = 1
if p==0:
	print("Yay!")
else:
	print(":(")

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
p = 0
if A>8:
	p = 1
if B>8:
	p = 1
if p==0:
	print("Yay!")
if p==1:
	print(":(")
Problem p03039 (python)

Fixed submission:
def dist(arr, n):
	res = 0; su = 0
	for i in range(n):
		res = (res + (arr[i] * i) - su) % mod
		su = (su + arr[i]) % mod

	return res % mod

n,m,k = map(int,input().split())
mod = int(1e9+7)
fact = [1]
for i in range(1,n*m+1):
	fact.append((fact[-1] * i)%mod)

x = []
y = []

for i in range(1,n+1):
	for j in range(1,m+1):
		x.append(i)
		y.append(j)

y.sort()

tot = (dist(x,n*m) + dist(y,n*m))%mod
N = n*m - 2
Need = k-2
num = fact[N]
den = (fact[Need] * fact[N-Need])%mod
ncr = (num * pow(den,mod-2,mod)) % mod
ans = (tot * ncr) % mod
print(ans)

Buggy submission (verdict: Runtime Error):
def dist(arr, n):
	res = 0; su = 0
	for i in range(n):
		res = (res + (arr[i] * i) - su) % mod
		su = (su + arr[i]) % mod

	return res % mod

n,m,k = map(int,input().split())
mod = int(1e9+7)
fact = [1]
for i in range(1,int(1e5)+1):
	fact.append((fact[-1] * i)%mod)

x = []
y = []

for i in range(1,n+1):
	for j in range(1,m+1):
		x.append(i)
		y.append(j)

y.sort()

tot = (dist(x,n*m) + dist(y,n*m))%mod
N = n*m - 2
Need = k-2
num = fact[N]
den = (fact[Need] * fact[N-Need])%mod
ncr = (num * pow(den,mod-2,mod)) % mod
ans = (tot * ncr) % mod
print(ans)
Problem p03150 (python)

Fixed submission:

s = input()

f = "keyence"
h = 0
n = len(s)
for i in range(8):

    first = f[:i+1]
    second = f[i+1:]
    check = len(first)
    find1 = s.find(first)
    find2 = s.find(second,n-len(second))

    if i!=7:
        if find1!=0:
            continue

        if find2==-1:
            continue

        if find2+len(second)!=n:
            continue

        else:
            print("YES")
            h = 1
            break

    else:
        if find1 == 0 or find1+len(first) == n :
            print("YES") 
            h = 1
            break



if h == 0:
    print("NO")

Buggy submission (verdict: Runtime Error):

s = input()

f = "keyence"
h = 0
for i in range(7):

    first = f[:i+1]
    second = f[i+1:]
    check = len(first)
    find1 = s.find(first)
    find2 = s.find(second,find1+check)

    if find2 + len(second) < n:
        continue

    if find1 != -1 and find2!=-1:
        print("YES")
        h = 1
        break



if h == 0:
    print("NO")
Problem p02922 (python)

Fixed submission:
a,b=(int(x) for x in input().split())
tap = 1
count = 0

while tap < b:
    tap = tap + a - 1
    count = count + 1
    
print(count)

Buggy submission (verdict: Runtime Error):
>>> a,b=(int(x) for x in input().split())
tap = 1
count = 0

while tap < b:
    tap = tap + a - 1
    count = count + 1
    
print(count)

Buggy submission (verdict: Runtime Error):
>>> a,b=(int(x) for x in input().split())
tap = 1
count = 0

while tap < b:
    tap = tap + a - 1
    count = count + 1
    
print(count)