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

Fixed submission:
n,m,k=map(int,input().split())
arr=list(map(int,input().split()))
brr=list(map(int,input().split()))

sumA=sum(arr)
bpointer=0
ans=0
sumB=0
for i in range(len(arr),-1,-1):
    if i<n:
        sumA-=arr[i]
    if sumA<=k:
        while bpointer<m and sumA+sumB+brr[bpointer]<=k:
            sumB+=brr[bpointer]
            bpointer+=1
        ans=max(ans,i+bpointer)
print(ans)

Buggy submission (verdict: Runtime Error):
n,m,k=map(int,input().split())
arr=list(map(int,input().split()))
brr=list(map(int,input().split()))

sumA=sum(arr)
bpointer=0
ans=0
sumB=0
for i in range(len(arr),-1,-1):
    if i<n:
        sumA-=arr[i]
    if sumA<=k:
        while bpointer<m and sumA+sumB+brr[bpointer]<=k:
            sumB+=brr[bpointer]
            bpointer+=1
    	ans=max(ans,i+bpointer)
print(ans)
Problem p02829 (python)

Fixed submission:
a = int(input())
b = int(input())
print(a^b)

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
print(3^a^b)
Problem p02577 (python)

Fixed submission:
n = int(input())
if n%9 ==0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
if sum(n)%9 ==0:
    print("Yes")
else:
    print("No")
Problem p02595 (python)

Fixed submission:
n,d = map(int,input().split())
cnt = 0
for i in range(n):
    p,q = map(int,input().split())
    cnt += p*p+q*q <= d*d
print(cnt)

Buggy submission (verdict: Runtime Error):
n,d = map(int,input().split())
cnt = 0
for i in raneg(n):
    p,q = map(int,input().split())
    cnt += p*p+q*q <= d*d
print(cnt)
Problem p02659 (python)

Fixed submission:
from decimal import Decimal
a,b = map(Decimal,input().split())

print(int(a*b))

Buggy submission (verdict: Runtime Error):
import decimal
a,b = input().split()
a = decimal(a)
b = decimal(b)
print(int(a*b))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
ans = a[0]
for i in range(n-1):
    ans *= a[i+1]
    if ans > 10**18:
        break
if ans > 10**18:
    print(-1)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().spolit())
print(int(a*b))
Problem p02711 (python)

Fixed submission:
n = input()
if n.count("7") == 0:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
n = input()
if n.count(7) == 0:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
n = input()
if n.count(7) == 0:
    print("No)
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
n = [input()]
if n.count(7) == 0:
    print("No)
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
n = input()
if 7 in n:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = input()
if n.count(7) == 0:
    print("No")
else:
    print("Yes")
Problem p02725 (python)

Fixed submission:
k,n = map(int,input().split())
a = list(map(int,input().split()))
ans = a[0]+(k-a[-1])
for i in range(n-1):
    ans = max(ans,a[i+1]-a[i])
print(k-ans)

Buggy submission (verdict: Runtime Error):
k,n = map(int,input().spliut())
a = list(map(int,input().split()))
ans = a[0]+(k-a[-1])
for i in range(n-1):
    ans = max(ans,a[i+1]-a[i])
print(k-ans)
Problem p02729 (python)

Fixed submission:
n,m = map(int,input().split())
print((n*(n-1)//2)+(m*(m-1)//2))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
print((n*(n-1)//2))+(m*(m-1)//2))
Problem p02753 (python)

Fixed submission:
s = input()
if len(set(s))==2:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = input()
s.sort()
if s[0] != s[1] or s[1] != s[2]:
    print("Yes")
else:
    print("No")
Problem p02754 (python)

Fixed submission:
n,a,b = map(int,input().split())
c = n//(a+b)
d = (n%(a+b))
if a ==0:
    print(0)
elif n%(a+b)==0:
    print(c*a)
elif n%(a+b)!= 0 and d <=a :
    print((c*a)+d)
else:
    print((c*a)+a)

Buggy submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
c = n//(a+b)
d = (n%(a+b))
if a ==0:
    print(0)
elif n%(a+b)==0:
    print(c*a)
elif n%(a+b)!== 0 and d <=a :
    print((c*a)+d)
else:
    print((c*a)+a)
Problem p02771 (python)

Fixed submission:
a = list(map(int,input().split()))
if len(set(a)) == 2:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a = lsit(map(int,input().split()))
if len(set(a))==2:
    print("Yes")
else:
    print("No")
Problem p02773 (python)

Fixed submission:
from collections import  Counter
n = int(input())
a  = [input() for i in range(n)]
cnt = Counter(a)
l = max(cnt.values())
ans = [s for s,c in cnt.items()if c ==l]
ans.sort()
print('\n'.join(ans))

Buggy submission (verdict: Runtime Error):
n = int(input()
s = {}
for i in range(n):
    si = input()
    if si in s:
        s[si] +=1
    else:
        s[si] = 0
l = max(s.values())
ans = []
for i in s:
    if s[i] == l:
        ans.append(i)
ans.sort()
for i in ans:
    print(i)

Buggy submission (verdict: Runtime Error):
n = int(input()
s = dict()
for i in range(n):
    si = input()
    if si in s:
        s[si] +=1
    else:
        s[si] = 0
l = max(s.values())
ans = []
for i in s:
    if s[i] == l:
        ans.append(i)
ans.sort()
for i in ans:
    print(i)

Buggy submission (verdict: Runtime Error):
n = int(input()
s = dict()
for i in range(n):
    si = input()
    if si in s:
        s[si] +=1
    else:
        s[si] = 0
l = max(s.values())
ans = []
for i in s:
    if s[i] == 1:
        ans.append(i)
ans.sort()
for i in ans:
    print(i)
Problem p02777 (python)

Fixed submission:
s,t = input().split()
a,b = map(int,input().split())
u = input()

if s == u:
    print(a-1,b)
else:
    print(a,b-1)

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

if s == u:
    print(a-1,b)
else:
    print(a,b-1)
Problem p02779 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
if len(set(a)) == n:
    print("YES")
else:
    print("NO")

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

a = list(map(int,input().split())))
if n ==len(set(a)):
    print("YES")
else:
    print("NO")

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

a = list(map(int,input().split())))
if n ==len(set(a)):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
n =int(input())
a = list(map(int,input().split()))
if n = len(set(a)):
    print("Yes")
else:
    print("No")
Problem p02785 (python)

Fixed submission:
n,k = map(int,input().split())
h= list(map(int,input().split()))
h.sort(reverse=True)
print(sum(h[k:]))

Buggy submission (verdict: Runtime Error):
h = int(input())
ans = 0
c = 0
while h >0:
    ans += 2**c
    h //= 2
    c+= 1
print(ans)

Buggy submission (verdict: Runtime Error):
h = int
(input())
ans = 0
c = 0
while h >0:
    ans += 2**c
    h //= 2
    c+= 1
print(ans)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
h= list(map(int,input().split()))
sorted(h)
if n <=k:
    print(0)
else:
print(sum(h[:n-k]))
Problem p02819 (python)

Fixed submission:
x = int(input())
def prime(n):
    for i in range(2,n):
        if n % i == 0:
            return False
    return True
while True:
    if prime(x):
        print(x)
        break
    x += 1

Buggy submission (verdict: Runtime Error):
n.k = map(int,input().split())
r,s,p = map(int,input().split())
t = list(input())
for i in range(n-k):
    if t[k+i] == t[i]:
        t[k+i] = 0
xs = t.count('r')*p+ t.count('s')*r+t.count('p')*s
print(x)
Problem p02820 (python)

Fixed submission:
n,k = map(int,input().split())
r,s,p = map(int,input().split())
t = list(input())
for i in range(n-k):
    if t[k+i] == t[i]:
        t[k+i] = 0
x = t.count('r')*p+ t.count('s')*r+t.count('p')*s
print(x)

Buggy submission (verdict: Runtime Error):
n.k = map(int,input().split())
r,s,p = map(int,input().split())
t = list(input())
for i in range(n-k):
    if t[i+k] == t[i]:
        t[i+k] == 0
x = t.count("r")*p+t.count("S")*r+t.count("p")*s
print(x)

Buggy submission (verdict: Runtime Error):
n.k = map(int,input().split())
r,s,p = map(int,input().split())
t = list(input())
for i in range(n-k):
    if t[k+i] == t[i]:
        t[k+i] = 0
xs = t.count('r')*p+ t.count('s')*r+t.count('p')*s
print(x)

Buggy submission (verdict: Runtime Error):
n.k = map(int,input().split())
r,s,p = map(int,input().split())
t = list(input())
for i in range(n-k):
    if t[k+a] == t[a]:
        t[k+a] = 0
xs = t.count('r')*p+ t.count('s')*r+t.count('p')*s
print(x)
Problem p02831 (python)

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

Buggy submission (verdict: Runtime Error):
from math import gcd
a,b = map(int,input().split())
print(gcd(a,b))
Problem p02836 (python)

Fixed submission:
s = input()
a = s[::-1]
ans = 0

for i in range(len(s)):
    if s[i] != a[i]:
        ans += 1
print(ans//2)

Buggy submission (verdict: Runtime Error):
s = input()
a = reversed(s)
ans = 0

for i in s:
    if s[i] != a[i]:
        ans += 1
print(ans)
Problem p02860 (python)

Fixed submission:
n = int(input())
s = input()
if n%2 == 1:
    print("No")
elif s[0:n//2]==s[n//2:n]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
 int(input())
s = list(input())
 
a = n//2
if n % 2 == 1:
    print("No")
elif s[0:a] == s[a:n]:
    print("Yes")
else:
    print("No")
Problem p02880 (python)

Fixed submission:
n = int(input())
list = []

for i in range(1,10):
    for j in range(1,10):
        c = i*j
        list.append(c)
if n in list:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(10):
    for j in range(i+1):
        if i*j == n:
            ans += 1
if ans == 1:
    print("Yes")
elif n == 2,4,16,25,36,49,64:
  print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a or b >= 10:
    print(-1)
else:
    print(a*b)
Problem p02935 (python)

Fixed submission:
n = int(input())
v = list(map(int,input().split()))
v.sort()
ans = v[0]
for i in range(1,n):
    ans = (ans+v[i])/2
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
v = list(map(int,input().split()))
v.sort()
ans = a[0]
for i in range(1,n):
    ans = (ans+a[i])/2
pritn(ans)
Problem p02954 (python)

Fixed submission:
s = input()
n = len(s)

ans = [1]*n
for i,a in enumerate(s):
    if a =="R":
        a2 = s[i+1]
        if a2 =="R":
            ans[i+2] += ans[i]
            ans[i] = 0

for i in range(n-1,-1,-1):
    a = s[i]
    if a =="L":
        a2 = s[i-1]
        if a2 =="L":
            ans[i-2] += ans[i]
            ans[i] = 0
print(*ans)

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

ans = [1]*n
for i,a in enumerate(s):
    if a =="R":
        a2 = s[i+1]
        if a2 =="R":
            ans[i+2] += ans[i]
            ans[i] = 0

for i in range(n-1,-1,-1):
    a = s[i]
    if a =="L":
        a2 = a[i-1]
        if a2 =="L":
            ans[i-2] += ans[i]
            ans[i] = 0
print(*ans)

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

ans = [1]*n
for i,a = in enumerate(s):
    if a =="R":
        a2 = s[i+1]
        if a2 =="R":
            ans[i+2] += ans[i]
            ans[i] = 0

for i in range(n-1,-1,-1):
    a = s[i]
    if a =="L":
        a2 = a[i-1]
        if a2 =="L":
            ans[i-2] += ans[i]
            ans[i] = 0
print(*ans)

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

ans = [1]*n
for i,a = in enumerate(s):
    if a =="R":
        a2 = s[i+1]
        if a2 =="R":
            ans[i+2] += ans[i]
            ans[i] = 0

for i in range(n-1,-1,-1):
    a = a[i]
    if a =="L":
        a2 = a[i-1]
        if a2 =="L":
            ans[i-2] += ans[i]
            ans[i] = 0
print(*ans)
Problem p02970 (python)

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

Buggy submission (verdict: Runtime Error):
a.b = map(int.input().split())
c = a/2/b
d = round(c)
print(d)

Buggy submission (verdict: Runtime Error):
a.b = map(int.input().split())
c = (a/2/b)
d =count(c)
print(d)

Buggy submission (verdict: Runtime Error):
a.b = map(int.input().split())
if a/2%b === 0 :
    print (a/2/b)
else :
print(a/2//b+1)
Problem p03012 (python)

Fixed submission:
n = int(input())
w = list(map(int,input().split()))
ans = []
for i in range(1,n):
    ans.append(abs(sum(w[:i])-sum(w[i:])))
print(min(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
w = list(map(int,input().split()))
ans = []
for i in range(1,n):
    ans.append(abs(sum(l[:i])-sum(l[i:])))
print(min(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
w = list(map(int,input().split()))
ans = []
for i in range(1,n):
    ans.append(abs(sum(l[:i])-sum(l[i:])))
print(min(ans))
Problem p03013 (python)

Fixed submission:
n,m = map(int,input().split())
a = set([int(input())for i in range(m)])
dp = [0]*(n+1)
dp[0] = 1
if 1 in a :
    dp[1] = 0
else:
    dp[1] = 1
for i in range(2,n+1):
    if i in a:
        continue
    dp[i] = (dp[i-1]+dp[i-2])%1000000007
print(dp[n])

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = set([int(input())for _ in range(m)])
dp = [0]*(n+1)
dp[0] = 1
if 1 in a:
    dp[1] = 0
else:
    dp[1] = 1

for i in range(2,n+1):
    if i in a:
        continue
    dp[i] = (dp[i-1]+dp[i+2])%1000000007
print(dp[n])
Problem p03038 (python)

Fixed submission:
n,m = map(int,input().split())
*a, = map(int,input().split())
bc =[list(map(int,input().split()))for _ in [0]*m]
 
a.sort()
bc.sort(key=lambda x:-x[1])
i =0
for b,c in bc:
    for j in range(i,min(n,i+b)):
        if a[j]< c:a[j]=c
    i = i+b
print(sum(a))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = map(int,input().split())
bc =[list(map(int,input().split()))for _ in [0]*m]

a.sort()
bc.sort(key=lambda x:-x[1])
i =0
for b,c in bc:
    for j in range(i,min(n,i+b)):
        if a[j]< c:a[j]=c
    i = i+b
print(sum(a))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = map(int,input().split())
bc =[list(map(int,input().split()))for _ in [0]*m]

a.sort()
bc.sort(key=lamda x:-x[1])
i =0
for b,c in bc:
    for j in range(i,min(n,i+b)):
        if a[j]< c:a[j]=c
    i = i+b
print(sum(a))
Problem p03041 (python)

Fixed submission:
_, K = map(int, input().split())
S = input()
 
print(S[: K - 1] + S[K - 1].lower() + S[K:])

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

print(s[:k-1]+s.upper[k-1]+s[k:])

Buggy submission (verdict: Runtime Error):
n,k = map(int,inoput().split())
s = input()

print(s[:k-1]+s[k-1].lower()+s[k:])

Buggy submission (verdict: Runtime Error):
n,k = map(int,inoput().split())
s = input()

print(s[:k-1]+s[k-1].lower+s[k:])

Buggy submission (verdict: Runtime Error):
n,k = map(int,inoput().split())
s = input()

print(s[:k-1]+lower.s[k]+s[k+1:])
Problem p03042 (python)

Fixed submission:
S = input()
a = int(S[:2])
b = int(S[2:])
 
if 1 <= a and a <= 12 and 1 <= b and b <= 12:
    print("AMBIGUOUS")
elif 1 <= a and a <= 12 and (b > 12 or b < 1):
    print("MMYY")
elif (a > 12 or a < 1) and 1 <= b and b <= 12:
    print("YYMM")
else:
    print("NA")

Buggy submission (verdict: Runtime Error):
s = input()
a = int(s[:2])
b = int(s[2:])

if 1 <= a and a <= 12 and 1 <= b and b <=12:
    print("AMBIGUOUS")
elif 1 <= a <=　12 and (12 < b or b < 1):
    print("MMYY")
elif (12 < a or a < 1) and 1 <= b <= 12:
    print("YYMM")
else:
    print("NA")
Problem p03072 (python)

Fixed submission:
n = int(input())
h = list(map(int,input().split()))
c = 1
for i in range(1,n):
    if h[i] >= max(h[:i]):
        c += 1
print(c)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
c = 1
for i in range(n):
    if h[i] >= max(h[0:i]):
        c += 1
print(c)
Problem p03075 (python)

Fixed submission:
a = [int(input())for i in range(6)]
if a[4] - a[0] > a[5]:
    print(":(")
else:
    print("Yay!")

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

Fixed submission:
n, m = map(int, input().split())
x = sorted(set(map(int, input().split())))
t = []
for i, j in zip(x, x[1:]):
    t += [abs(i - j)]
t = sorted(t, reverse=True)
print(sum(t[n-1:]))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
x = sorted(map(int,input().split()))
l = sorted([x[i+1]-x[i]for i in range(m-1)])
if n >=m:
    print(0)
else:
    print(sum(l)-sum([-i-1]for i in range(n-1)))
Problem p03207 (python)

Fixed submission:
n = int(input())
p =[int(input())for i in range(n)]

m = max(p)//2
print(m+sum(p)-max(p))

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

m = max(p)/2
print(m+sum(p)-max(p))

Buggy submission (verdict: Runtime Error):
n = int(input())
p =[map(int,input().split())for i in range(n)]

m = max(p)/2
print(m+sum(p)-max(p))

Buggy submission (verdict: Runtime Error):
n = int(input())
p =[list(map(int,input().split()))for i in range(n)]

m = max(p)/2
print(m+sum(p)-max(p))
Problem p03221 (python)

Fixed submission:
N,M=map(int, input().split())
A=[[] for i in range(N)]
 
for i in range(M):
  p,y=map(int, input().split())
  A[p-1].append((y, i))
 
X=[0]*M
for i,d in enumerate(A):
  d.sort()
  for k,(y,j) in enumerate(d):
    X[j]=str(i+1).zfill(6)+str(k+1).zfill(6)
print(*X,sep='\n')

Buggy submission (verdict: Runtime Error):
n,m = [int(i) for i in input().split()]
a = [[]for i in range(n)]


for i in range(m):
    c,d = map(int,input().split())
    a =[c-1].append((d,i))
ans = [0]*m
for i,b in enumerate(a):
    b.sort()
    for k,(d,j) in enumerate(b):
        ans[j] = str(i+1).zfill(6)+str(k+1).zfill(6)
print(*ans,sep="\n")

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

for i in range(m):
    c,d = [int(i)for i in input().split()]
    a =[c-1].append((d,i))
ans = [None]*m
for j,b in enumerate(a):
    b.sort()
    for k,(d,i) in enumerate(b):
        ans[i] = str(j+1).zfill(6)+str(k+1).zfill(6)
print(*ans,sep="\n")
Problem p03252 (python)

Fixed submission:
from collections import Counter
 
S=input()
T=input()
 
S=list(Counter(S).values())
T=list(Counter(T).values())
 
S.sort()
T.sort()
 
if S==T:
  print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
c = []
for i in range(3):
    c.append(list(map(int,input().split())))
a = [0,0,0]
b = [0,0,0]
for i in range(3):
    b[i] = c[i][0]-0
for i in range(3):
    a[i] = c[0][i]-b[0]
for i in range(3):
    for j in range(3):
        if a[j]+b[i] != c[i][j]:
            print("No")
            exit()
print("Yes")
Problem p03272 (python)

Fixed submission:
a,b = map(int,input().split())
print(a-b+1)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input(),split())
print(a-b+1)
Problem p03307 (python)

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

Buggy submission (verdict: Runtime Error):
n = input()
if n % 2 ==0:
    print(n)
else:
    print(n*2)
Problem p03317 (python)

Fixed submission:
n,k = list(map(int,input().split()))
a = list(map(int,input().split()))
print((n-1+k-2)//(k-1))

Buggy submission (verdict: Runtime Error):
n,k = list(map(int,input().split()))
a = lsit(map(int,input().split()))
print((n-1+k-2)//(k-1))
Problem p02629 (python)

Fixed submission:
n = int(input())
c = 1
s = 26
while True:
    if n <= s:
        break
    c += 1
    s += 26 ** c
a = ""
al = 'abcdefghijklmnopqrstuvwxyz'
for i in range(1,c+1):
    a += al[(n - 1) % 26]
    n = (n - 1) // 26
print(a[::-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
c = 1
s = 26
while True:
    if n <= s:
        break
    c += 1
    s += 26 ** c
a = ""
al = 'abcdefghijklmnopqrstuvwxyz'
for i in range(c-1,-1,-1):
    b = n // 26 ** i
    n %= 26 ** i
    a += al[b-1]
print(a)
Problem p02701 (python)

Fixed submission:
a = int(input())
ar = []
for i in range(a):
    l = input()
    ar.append(l)
print(len(set(ar)))

Buggy submission (verdict: Runtime Error):
a = int(input())
ar = []
for i in range(a):
    ar.append(l)
print(len(set(ar)))
Problem p02753 (python)

Fixed submission:
a = input()
if a == "AAA" or a == "BBB":
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
a = input()
if a == "AAA" or b == "BBB":
  print("No")
else:
  print("Yes")
Problem p02754 (python)

Fixed submission:
n,a,b = map(int,input().split(" "))
count = 0
c = a + b
count += a * (n // c)
d = n % c
count += min(a,d)
print(count)

Buggy submission (verdict: Runtime Error):
n,a,b = map(int,input().split(" "))
count = 0
c = a + b
if c > n:
    print(min(n,a))
else:
    count += a * (n // c)
    d = n % c
        count += min(a,d)
print(count)
Problem p02835 (python)

Fixed submission:
a,b,c = map(int,input().split(" "))
if a + b + c >= 22:
	print("bust")
else:
	print("win")

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split(" ")
if a + b + c >= 22:
	print("bust")
else:
	print("win")
Problem p02987 (python)

Fixed submission:
a = list(input())
if len(set(a)) == 2:
  count = 0
  for r in set(a):
    if a.count(r) == 2:
      count += 1
  if count == 2:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = list(input())
if len(set(a)) == 2:
  count = 0
  for r in set(a):
    if r.count(a) == 2:
      count += 1
  if count == 2:
    print("Yes")
  else:
    print("No")
else:
  print("No")
Problem p03803 (python)

Fixed submission:
a = list(map(int,input().split(" ")))
if a[0] == 1 and a[1] == 1:
  print("Draw")
elif a[0] == 1:
  print("Alice")
elif a[1] == 1:
  print("Bob")
else:
  if a[0] > a[1]:
    print("Alice")
  elif a[0] == a[1]:
    print("Draw")
  else:
    print("Bob")

Buggy submission (verdict: Runtime Error):
a = list(map(int,input()))
if a[0] == 1 and a[1] == 1:
  print("Draw")
elif a[0] == 1:
  print("Alice")
elif a[1] == 1:
  print("Bob")
else:
  if a[0] > a[1]:
    print("Alice")
  elif a[0] == a[1]:
    print("Draw")
  else:
    print("Bob")
Problem p02547 (python)

Fixed submission:
n=int(input())
ct=0
for i in range(n):
  a,b=map(int,input().split())
  if a==b:
    ct+=1
    if ct==3:
      print("Yes")
      break
  else:
    ct=0
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
for i in range(n):
  a,b=map(int,input().split())
  if a==b:
    ct+=1
    if ct==3:
      print("Yes")
      break
  else:
    ct=0
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
for i in range(n):
  a,b=map(int,input().split())
  if a==b:
    ct+=1
    if ct==3:
      print("Yes")
      break
  else:
    ct==0
else:
  print("No")
Problem p03307 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
print(n if n%2==0 else 2n)
Problem p02546 (python)

Fixed submission:
word = input()

if word[-1] == 's':
  print(word+'es')
else:
  print(word+'s')

Buggy submission (verdict: Runtime Error):
import os
import io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline


n, q = list(map(int, input().split()))
count = (n - 2) ** 2
c = [n] * n
r = [n] * n
mc = n
mr = n
for _ in range(q):
  m,q = list(map(int, input().split()))
  if m == 1:
    pos = r[q-1]
    if q < mc:
        mc = q
        for p in range(pos):
            c[p] = q
    if q not in [1,n]:
      count -= max(0, pos - 2)
  else:
    pos = c[q-1]
    if q < mr:
        mr = q
        for p in range(pos):
            r[p] = q
    if q not in [1,n]:
      count -= max(0, pos-2)
print(count)