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

Fixed submission:
#E
from collections import deque
n = int(input())
matches = [list(a -1 for a in map(int,input().split()))
     for _ in range(n)]
q = deque(range(n))
depth = [0] * n
waiting = [-1] * n

while q:
    a = q.popleft()
    ma = matches[a]
    if not ma:
        continue
    # gyaku kara kanngaeteru
    b = ma.pop()
    if waiting[b] == a:
        depth[a] = depth[b] = max(depth[a],depth[b]) +1
        q.append(a)
        q.append(b)
    else:
        waiting[a] = b
if any(matches):
    print(-1)
else:
    print(max(depth))

Buggy submission (verdict: Runtime Error):
#E
from collections import deque
n = int(input())
matches = [list(a -1 for a in map(int,input().split()))
     for _ in range(N)]
q = deque(range(n))
depth = [0] * n
waiting = [-1] * n

while q:
    a = q.popleft()
    ma = matches[a]
    if not ma:
        continue
    # gyaku kara kanngaeteru
    b = ma.pop()
    if waiting[b] == a:
        depth[a] = depth[b] = max(depth[a],depth[b]) +1
        q.append(a)
        q.append(b)
    else:
        waiting[a] = b
if any(matches):
    print(-1)
else:
    print(max(depth))
Problem p02948 (python)

Fixed submission:
from heapq import heappop,heappush
from collections import defaultdict

n,m = map(int,input().split())
data = defaultdict(list)
for _ in range(n):
    a,b = map(int,input().split())
    data[a].append(b)

ans = 0
h_queue =[]
for i in range(1,m+1):
    for j in data[i]:
        heappush(h_queue,-j)
    if len(h_queue) > 0:
        ans -= heappop(h_queue)

print(ans)

Buggy submission (verdict: Runtime Error):
from heapq import heappop,heappush
from collections import defaultdict
n,m = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(n)]
ab_sort = sorted(ab,key=lambda x:x[0])
h_queue = []
j = 0
ans = 0
for i in range(1,m+1):
    while (j < n) and (ab_sort[j] <= i):
        heappush(h_queue,ab_sort[j])
        j += 1
    if len(h_queue):
        ans -= heappop(h_queue)
print(ans)
Problem p03075 (python)

Fixed submission:
#A
a = [int(input()) for i in range(5)]
k = int(input())

if (a[-1] - a[0] <= k ):
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
a = [int(input()) for i in range(5)]
k = int(input())

if (a[-1] - a[0] =< k ):
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
a = [int(input()) for i in range(5)]
k = int(input())

if a[-1] - a[0] =< k:
    print("Yay!")
else:
    print(":(")
Problem p03250 (python)

Fixed submission:
a = list(int(i) for i in input().split())
a.sort()
print(10*a[2]+a[1] + a[0])

Buggy submission (verdict: Runtime Error):
n, m, X,Y = map(int,input().split())
x = list(int(i) for i in input().split())
y = list(int(i) for i in input().split())

x.sort()
y.sort()

if x[-1] < Y and y[0] >X and x[-1] < y[0]:
    print("No War")
else:
    print("War")
Problem p03805 (python)

Fixed submission:
N,M = map(int,input().split())
pat = [[int(i) for i in input().split()] for _ in range(M)]
Graph = [[0 for i in range(N)] for _ in range(N)]
for i,j in pat:
    Graph[i-1][j-1] = 1
    Graph[j-1][i-1] = 1

def dfs(v,N,visit_list):

    all_visit = True

    for i in range(N):
        if visit_list[i] == False:
            all_visit = False
    
    if all_visit:
        return 1

    ret = 0

    for k in range(N):
        if Graph[v][k] == False:
            continue
        if visit_list[k] :
            continue
        
        visit_list[k] = True
        ret += dfs(k,N,visit_list)
        visit_list[k] = False
    return ret

visit_list = [False for i in range(N)]
visit_list[0] = True
print(dfs(0,N,visit_list))

Buggy submission (verdict: Runtime Error):
def dfs(v,N,visit_list):

    all_visit = True

    for i in range(N):
        if visit_list[i] == False:
            all_visit = False
    
    if all_visit:
        return 1

    ret = 0

    for k in range(N):
        if Graph[v][k] == False:
            continue
        if visit_list[k] :
            continue
        
        visit_list[k] = True
        ret += dfs(k,N,visit_list)
        visit_list[k] = False
    return ret

visit_list = [False for i in range(N)]
visit_list[0] = True
print(dfs(0,N,visit_list))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
pat = [[int(i) for i in input().split()] for _ in range(M)]
Graph = [[0 for i in range(N)] for _ in range(N)]
for i,j in pat:
    Graph[i-1][j-1] = 1
    Graph[j-1][i-1] = 1

def dfs(v,N=N,visit_list):

    all_visit = True

    for i in range(N):
        if visit_list[i] == False:
            all_visit = False
    
    if all_visit:
        return 1

    ret = 0

    for k in range(N):
        if Graph[v][k] == False:
            continue
        if visit_list[k] :
            continue
        
        visit_list[k] = True
        ret += dfs(k,N,visit_list)
        visit_list[k] = False
    return ret

visit_list = [False for i in range(N)]
visit_list[0] = True
print(dfs(0,N,visit_list))
Problem p02701 (python)

Fixed submission:
n = int(input())

st = set()
for i in range(n):
  st.add(input())
  
print(len(st))

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

st = set()
for i in range(n):
  set.add(input())
  
print(len(st))
Problem p02951 (python)

Fixed submission:
A,B,C = map(int, input().split())
print(max(C-(A-B), 0))

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

cnt=0
for i in range(1,n+1):
  if len(str(i)) % 2 == 1:
    cnt += 1
print(cnt)
Problem p02859 (python)

Fixed submission:
r = int(input())
print(r**2)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
 
stat = False
if n%2==0:
    m = n//2
    stat = (s[:m]==s[m:])
if stat:   
    ans = 'Yes'
else:
    ans = 'No'
print(ans)
Problem p02987 (python)

Fixed submission:
S = input()
wk1 = (S[0]==S[1]) and (S[2]==S[3]) and (S[0]!=S[2])
wk2 = (S[0]==S[3]) and (S[1]==S[2]) and (S[0]!=S[1])
wk3 = (S[0]==S[2]) and (S[1]==S[3]) and (S[0]!=S[1])
if wk1 or wk2 or wk3:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
p = [int(_) for _ in input().split()]

cnt = 0
for i in range(0, n-2):
    print(p[i], p[i+1], p[i+2])
    if (p[i] < p[i+1] < p[i+2]) or (p[i] > p[i+1] > p[i+2]):
        cnt += 1
print(cnt)
Problem p03041 (python)

Fixed submission:
n, k = [int(x) for x in input().split()]
s = list(input())

s[k-1] = s[k-1].lower()
s = "".join(s)
print(s)

Buggy submission (verdict: Runtime Error):
n, k = [x for x in input()]
s = input()

s[k-1] = s[k-1].lower()
print(s)
Problem p03307 (python)

Fixed submission:
n = int(input())
if n%2==0:
    print(n)
else:
    print(2*n)

Buggy submission (verdict: Runtime Error):
n = int(input())
in n%2==0:
    print(n)
else:
    print(2*n)
Problem p03631 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
if n[::-1]==n:
    print("Yes")
else:
    print("No")
Problem p02862 (python)

Fixed submission:

x,y = map(int, input().split())

from operator import mul
from functools import reduce

def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**6
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )



move = (x+y) / 3
if int(move) != move or x < move or y < move:
    print(0)
else:
    move = int(move)
    diff = max(x,y) - min(x,y)
    res = cmb(move, move//2 - diff//2, mod)
    print(res)

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

from operator import mul
from functools import reduce

def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**4
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )



move = (x+y) / 3
if int(move) != move or x < move or y < move:
    print(0)
else:
    move = int(move)
    diff = max(x,y) - min(x,y)
    res = cmb(move, move//2 - diff//2, mod)
    print(res)
Problem p02912 (python)

Fixed submission:
import math
import heapq
n, ticket = map(int, input().split())
L = list(map(int, input().split()))
h = []
for num in L:
    heapq.heappush(h, -num)
for _ in range(ticket):
    top = heapq.heappop(h)
    top /= 2
    heapq.heappush(h, top)
print(sum(map(lambda x: math.floor(-x), h)))

Buggy submission (verdict: Runtime Error):
import math
import bisect
from collections import deque
n, ticket = map(int, input().split())
L = list(map(int, input().split()))


if len(L) == 1:
    print(math.floor(L[0] / (2**ticket)))
else:
    L.sort()
    L = deque(L)
    for _ in range(ticket):
        top = L.pop()
        top /= 2
        bisect.insort_left(L,top)
    print(sum(map(math.floor, L)))
Problem p02701 (python)

Fixed submission:
n=int(input())
set_=set()
#print(set_)
for n in range(n):
  set_.add(input())
  #print(set_)
print(len(set_))

Buggy submission (verdict: Runtime Error):
n=int(input())
set={}
for n in range(n):
  set.append(input())
print(len(set))
Problem p02707 (python)

Fixed submission:
N=int(input())
A=list(map(int, input().split()))
ans=[0]*N
#print(ans)
for a in A:
    ans[a-1] += 1
    #print(ans)
for i in ans:
    print(i)

Buggy submission (verdict: Runtime Error):
n=int(input())
list1=list(map(int,input().split()))
for i in range(n):
  print(count.list1(i))
Problem p02879 (python)

Fixed submission:
a,b=map(int,input().split())
if 1<=a<=9 and 1<=b<=9:
  print(a*b)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(a*b if 1<=a,b<=9 else -1)
Problem p02915 (python)

Fixed submission:
n=int(input())
ans=1
for i in range(3):
  ans*=n
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
ans=1
for i in range 3:
  ans*=n
print(ans)
Problem p02987 (python)

Fixed submission:
s=input()
a=s[0]
b=s[1]
c=s[2]
d=s[3]
if a==b and c==d and a!=c:
  print("Yes")
elif a==c and b==d and a!=b:
  print("Yes")
elif a==d and b==c and a!=b:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
p=list(map(int,input().split()))
#print(n)
#print(p)
i=1
l=[]
while i<n-1:
  if p[i-1]<p[i]<p[i+1] or p[i-1]>p[i]>p[i+1]:
    l.append(i)
  else:
    pass
  i+=1
print(len(l))
Problem p03041 (python)

Fixed submission:
n,k= map(int,input().split())
s=input()
a=""

#print(s)
#print(s[0])
#print(s[2])
for i in range(k-1):
  a=a+s[i]
#print(a)
a=a+s[k-1].lower()
#print(a)
for i in range(n-k):
  a=a+s[i+k]
print(a)

Buggy submission (verdict: Runtime Error):
n,k= map(int,input().split())
s=input()
s[k-1]=s[k-1].lower
print(s)
Problem p03075 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if e-a>k:
  print(":(")
else:
  print("Yay!")

Buggy submission (verdict: Runtime Error):
s = [input() for i in range(6)]
if s[4]-s[0]>s[5]:
  print(":(")
else:
  print("Yay!")
Problem p02699 (python)

Fixed submission:
s, w = map(int, input().split())
print('safe') if s > w else print('unsafe')

Buggy submission (verdict: Runtime Error):
s = int(input())
w = int(input())
 
if w>=s :
  print("unsafe")
else : 
  print("safe")

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

if w>=s :
  print("unsafe")
else : 
  print("safe")
Problem p03806 (python)

Fixed submission:
N,Ma,Mb=[int(x) for x in input().split()]
A=[]
B=[]
C=[]
for i in range(N):
	a,b,c=[int(x) for x in input().split()]
	A.append(a)
	B.append(b)
	C.append(c)


ANS=[[[-1 for k in range(401)] for j in range(401)] for i in range(41)]

INF=1000000000000000000000

def f(ind,wa,wb):
	global Ma
	global Mb
	global N
	if ANS[ind][wa][wb]==-1:
		if ind==0:
			if (wa+A[0])*Mb==(wb+B[0])*Ma:
				ANS[ind][wa][wb] = C[0]
			elif wa*Mb==wb*Ma and (wa!=0 and wb!=0):
				ANS[ind][wa][wb] = 0
			else:
				ANS[ind][wa][wb] = INF
		else:
			ANS[ind][wa][wb] = min(f(ind-1,wa,wb),f(ind-1,wa+A[ind],wb+B[ind])+C[ind])
	return ANS[ind][wa][wb]

ans=f(N-1,0,0)

if ans==INF:
	print(-1)
else:
	print(ans)

Buggy submission (verdict: Runtime Error):
n,a,b=[int(x) for x in str(input()).split()]
A=[]
for i in range(n):
  A.append([int(x) for x in str(input()).split()])
 
ans=[]
for i in range(10):
  y=[]
  for j in range(10):
    x=[]
    for k in range(n):
      x.append(-1)
    y.append(x)
  ans.append(y)

#print(ans)
#print(A)
def f(ma,mb,cost,index):

  if ans[ma][mb][index]==-1:
    newa=ma+A[index][0]
    newb=mb+A[index][1]
    newc=cost+A[index][2]
    
    #print(index,newa,newb,newc)
    if newa*b==a*newb:
      ans[ma][mb][index]=newc
    elif index==n-1:
      ans[ma][mb][index]=100000000000000000000
    else:
      ith=f(newa,newb,newc,index+1)
      ans[ma][mb][index]= min(ith,f(ma,mb,cost,index+1))
  return ans[ma][mb][index]
  
 
if f(0,0,0,0)<100000000000000000000:
  print(f(0,0,0,0))
else:
  print(-1)
Problem p02881 (python)

Fixed submission:
import math
 
N=int(input())

A=[]

for i in range(1,int(math.sqrt(N))+1):
  if N % i ==0:
    A.append(i)
    A.append(int(N/i))
    
A.sort()
base = int(len(A)/2)

print(A[base]-1 +A[base-1] -1)

Buggy submission (verdict: Runtime Error):
import math
 
N=int(input())

A=[]

for i in range(1,int(math.sqrt(N))):
  if N % i ==0:
    A.append(i)
    A.append(int(N/i))
    
A.sort()
base = int(len(A)/2)
print(A[base]-1 +A[base-1] -1)

Buggy submission (verdict: Runtime Error):
import math
 
N=int(input())



A=[]

for i in range(1,int(math.sqrt(N))):
  if N % i ==0:
    A.append(i)
    A.append(int(N/i))
    
A.sort()
base = int(len(A)/2)
print(A[base]-1 +A[base-1] -1)
Problem p02693 (python)

Fixed submission:
K= int(input())
A, B = map(int, input().split())
i = 0
while A <= B:
  if A / K == A // K:
    i = i + 1
    A = A + 1
  else:
    i = i + 0
    A = A + 1
    
if i == 0:
  print("NG")
else:
  print("OK")

Buggy submission (verdict: Runtime Error):
K= int(input())
A, B = map(int, input().split())
i = 0
while A <= B:
  if A / K == A // K:
    i = i + 1
    A = A + 1
  else:
    i = i + 0
    A = A + 1
    
if i = 0:
  print("NG")
else:
  print("OK")

Buggy submission (verdict: Runtime Error):
K= int(input())
A, B = map(int, input().split())
i = 0
while A <= B:
  if K / 4 == K // 4:
    i = i + 1
    A = A + 1
  else:
    i = i + 0
    A = A + 1
    
if i = 0:
  print("NG")
else:
  print("OK")
Problem p02759 (python)

Fixed submission:
N = int(input())
if N / 2 == N // 2:
  print(int(N / 2))
else:
  print(int(N // 2 + 1))

Buggy submission (verdict: Runtime Error):
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
N = int(input())
i = 0
j = 0
k = 0

while N > 0:
  dice = int(input())
  while i < 3:
    if A[i] == int(dice):
      A[i] = "z"
      i = i + 1
  while j < 3:
    if B[j] == dice:
      B[j] = "z"
      j = j + 1
  while k < 3:
    if C[k] == dice:
      C[k] = "z"
      k = k + 1
  N = N - 1
      
if A[0] == A[1] == A[2] == "z" or B[0] == B[1] == B[2] == "z" or C[0] == C[1] == C[2] == "z" or A[0] == B[0] == C[0] == "z" or A[1] == B[1] == C[1] == "z" or A[2] == B[2] == C[2] == "z" or A[0] == B[1] == C[2] == "z" or A[2] == B[1] == C[0] == "z":
  print("Yes")
else:
  print("No")
Problem p02847 (python)

Fixed submission:
S = input()
if S == 'SUN':
  print(7)
elif S == 'MON':
  print(6)
elif S == 'TUE':
  print(5)
elif S == 'WED':
  print(4)
elif S == 'THU':
  print(3)
elif S == 'FRI':
  print(2)
elif S == 'SAT':
  print(1)

Buggy submission (verdict: Runtime Error):
S = input()
if S = 'SUN':
  print(7)
elif S = 'MON':
  print(6)
elif S = 'TUE':
  print(5)
elif S = 'WED':
  print(4)
elif S = 'THU':
  print(3)
elif S = 'FRI':
  print(2)
elif S = 'SAT':
  print(1)
Problem p02933 (python)

Fixed submission:
a = int(input())
s = input()
if a >= 3200 and a < 5000:
  print(s)
elif a >= 2800 and a < 3200:
  print('red')

Buggy submission (verdict: Runtime Error):
a = int(input())
s = input()
if a < 3200, a >=2800:
  print(s)
else:
  print('red')
Problem p03135 (python)

Fixed submission:
T, X = map(int, input().split())
t = T / X
print(t)

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
S = A * B // 2
print(S)
Problem p02773 (python)

Fixed submission:
def main():
    d = {}
    N = int(input())
    for i in range(N):
        s = input()
        d.setdefault(s, 1)
        d[s] += 1
    
    d = sorted(d.items())
    d = sorted(d, key=lambda x:x[1], reverse=True)
    n = d[0][1]
    for i in range(len(d)):
        if d[i][1] != n:
            break
        print(d[i][0])

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    d = {}
    N = int(input())
    for i in range(N):
        s = input()
        d.setdefault(s, 1)
        d[s] += 1
    
    d = sorted(d.items())
    d = sorted(d, key=lambda x:x[1], reverse=True)
    n = d[0][1]
    for i in range(N):
        if d[i][1] != n:
            break
        print(d[i][0])

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    d = {}
    N = int(input())
    for i in range(N):
        s = input()
        d.setdefault(s, 1)
        d[s] += 1
    
    d = sorted(d.items())
    d = sorted(d, key=lambda x:x[1], reverse=True)
    for i in range(N):
        print(d[i][0])

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

Fixed submission:
s, w = map(int, input().split())

if s <= w:
	print("unsafe")
else:
	print("safe")

Buggy submission (verdict: Runtime Error):
a = input("羊の数")
b = input("狼の数")

S = int(a)
W = int(b)

if S <= W:
  print("unsafe")
else:
  print("safe")
Problem p02754 (python)

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

t = n%(a+b)

if n < a:
    print(n)
else:
    if a > t > 0:
        print(n//(a+b)*a+t)
    elif t >= a:
        print(n//(a+b)*a+a)
    else:
        print(n//(a+b)*a)

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

t = []
if n <= a+b:
    print(a)
else:
    for i in range(1,n+1):
        t += "b"*a +"r"*b
        i += 1
    s = t[:n]
    print(s.count("b"))
Problem p02682 (python)

Fixed submission:
A, B, C, K = map(int, input().split())
if K <= A:
  print(K)
elif K <= A+B:
  print(A)
else:
  print(2*A+B-K)

Buggy submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())
if (K=<A):
  print(K)
elif (K=<A+B):
  print(A)
else:
  print(2*A+B-K)

Buggy submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())
if (K=<A):
  print(K)
elif (K=<A+B):
  print(A)
else:
  print(2*A+B-K)

Buggy submission (verdict: Runtime Error):
A=input() B=input() C=input() K=input()
if (K<=A):
  print(K)
elif (A<K<=A+B):
  print(A)
else:
  print(2A+B-K)

Buggy submission (verdict: Runtime Error):
A=input() B=input() C=input() K=input()
if (K<=A):
  print(K)
elif (A<K<=A+B):
  print(A)
else:
  print(2A+B-k)
Problem p02682 (python)

Fixed submission:
A, B, C, K = map(int, input().split())
if A >= K:
    print(K)
elif (A + B) >= K:
    print(A)
elif (A + B + C) > K:
    print(A - (K - A - B))
elif (A + B + C) == K:
    print(A - C)

Buggy submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())
if A >= K:
    print(A)
elif (A + B) >= K:
    print(A)
elif (A + B + C) > K:
    print(A - (K - A - B)
elif (A + B + C) == K:
    print(A - C)

Buggy submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())
result = 0

if A >= K:
    print(A)
elif (A + B) >= K:
    print(A)
else:
    if (A + B + C) > K:
        print(A - (K - (A + B))
    elif (A + B + C) <= K:
        print(A - C)

Buggy submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())
result = 0
p

if A >= K:
    print(A)
elif (A + B) >= K:
    print(A)
else:
    for i in range(K):
        print(i)
        if A > (i + 1):
            result += 1
            continue
        elif A == (i + 1):
            result += 1
            continue

        if B > (i + 1 - A):
            continue
        elif B == (i + 1 - A):
            continue

        if C > (i + 1 - A - B):
            result -= 1
            continue
        elif C == (i + 1 - A - B):
            result -= 1
            break
        else:
            break
    print(result)
Problem p02723 (python)

Fixed submission:
n = input()
if n[2] == n[3] and n[4] == n[5]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = input()
if n[3] == n[4] and n[5] == n[6]:
  print("Yes")
else:
  print("No")
Problem p02847 (python)

Fixed submission:
s = input()


if s=='SUN':
    ans = 7
elif s=='MON':
    ans = 6
elif s=='TUE':
    ans = 5
elif s=='WED':
    ans = 4
elif s=='THU':
    ans = 3
elif s=='FRI':
    ans = 2
elif s=='SAT':
    ans = 1

print(ans)

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


if s=='SUN':
    ans = 7
elif s=='MON':
    ans = 6
elif s=='TUE':
    ans = 5
elif s=='TWED':
    ans = 4
elif s=='THU':
    ans = 3
elif s=='FRI':
    ans = 2
elif s=='SAT':
    ans = 1

print(ans)
Problem p02771 (python)

Fixed submission:
def main():
    s = str(input()).split(' ');
    cnt = []
    for n1 in s:
        cnt.append(0)
        for n2 in s:
            if n1 == n2:
                cnt[-1] += 1
#    print(cnt)
    for i in cnt[:-1]:
        if i == 2:
            print('Yes')
            break
    else:
        print('No')


main()

Buggy submission (verdict: Runtime Error):
def main():
    s = str(input()).split(' ');
    cnt = []
    for n1 in s:
        cnt.append(0)
        for n2 in s:
            if n1 == n2:
                cnt[-1] += 1
#    print(cnt)
    for i in cnt[:-1]:
        if i == 2:
            print('Yes')
            break
    else:
        print('No')


main()

Buggy submission (verdict: Runtime Error):

def main():
    s = input().split(' ');
    cnt = []
    for n1 in s:
        cnt.append(0)
        for n2 in s:
            if n1 == n2:
                cnt[-1] += 1
#    print(cnt)
    for i in cnt[:-1]:
        if i == 2:
            print('Yes')
            break
    else:
        print('No')


main()

Buggy submission (verdict: Runtime Error):

def main():
    s = input().split(' ');
    cnt = []
    for n1 in s:
        cnt.append(0)
        for n2 in s:
            if n1 == n2:
                cnt[-1] += 1
#    print(cnt)
    for i in cnt[:-1]:
        if i == 2:
            print('Yes')
            break
    else:
        print('No')


main()
Problem p02682 (python)

Fixed submission:
a, b, c, k = [int(x) for x in input().split()]
res = 0
i = 0
t = [a, b, c]
j = [1, 0, -1]
while k > 0:
  m = min(k, t[i])
  k -= m
  res += j[i] * m
  i += 1
print(res)

Buggy submission (verdict: Runtime Error):
A, B, C, K = [int(x) for x in input().strip().split()]
k = K
res = 0
if A > K:
	print(K)
else:
	k -= A
	res += A
    if b > k:
        print(res)
    else:
        k -= b
        if k > 0:
            res -= k * -1
            print(res)
Problem p02790 (python)

Fixed submission:
get = list(map(int, input().split()))
a = get[0]
b = get[1]
if a <= b:
  print(str(a) * b)
elif a > b:
  print(str(b) * a)

Buggy submission (verdict: Runtime Error):
get = map(int, input().split())
a = get[0]
b = get[1]
if a <= b:
  print(str(a) * b)
elif a > b:
  print(str(b) * a)
Problem p02879 (python)

Fixed submission:
get = list(map(int, input().split()))
A = get[0]
B = get[1]
if A >= 10 or B >= 10:
  print(-1)
else:
  print(A * B)

Buggy submission (verdict: Runtime Error):
get = map(int, input().split())
A = get[0]
B = get[1]
if A >= 10 or B >= 10:
  print(-1)
else:
  print(A * B)