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

Fixed submission:
N, Q = map(int, input().split())
data = input()
result = [0] * N
for i in range(N-1):
  if data[i] == "A" and data[i+1] == "C":
    result[i+1] = result[i] + 1
  else:
    result[i+1] = result[i]

for i in range(Q):
  l, r = map(int, input().split())
  print(result[r-1]-result[l-1])

Buggy submission (verdict: Runtime Error):
N, Q = map(int, input().split())
data = input()
result = [0] * N
for i in range(N-1):
  if data[i] == "A" and data[i+1]:
    result[i+1] = result[i] + 1
  else:
    result[i+1] = result[i

for i in range(Q):
  l, r = map(int, input().split())
  print(result[r-1]-result[l-1])

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

for count in range(3):
    l, r = map(int, input().split())
    ans = 0
    count = 0

    for i in S[l-1: r]:
        if i =="A" or i == "T":    
            count += 1
        else:
            ans = max(count, ans)
            count = 0
    ans = max(count, ans)
    print(ans)
Problem p03102 (python)

Fixed submission:
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
cnt = 0
for i in range(N):
  A = list(map(int, input().split()))
  tmp = 0
  for j in range(M):
    tmp += A[j]*B[j]
  tmp += C
  if tmp > 0:
    cnt += 1
    
print(cnt)

Buggy submission (verdict: Runtime Error):
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
cnt = 0
for i in range(M):
  A = list(map(int, input().split()))
  tmp = 0
  for j in range(N):
    tmp += A[j]*B[j]
  tmp += C
  if tmp > 0:
    cnt += 1
    
print(cnt)
Problem p03105 (python)

Fixed submission:
A, B, C = map(int,input().split())

print(min(B//A, C))

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
num = max(A, B)
a = [1]
cnt = 1
for i in range(1,num):
  if A % i == 0 and B % i == 0:
    cnt += 1
    a.append(i)
a.sort(reverse=True)
print(a[K])
Problem p03106 (python)

Fixed submission:
A, B, K = map(int, input().split())
l = []
for i in range(1, max(A, B)+1):
  if A % i == 0 and B % i == 0:
    l.append(i)
    
l.sort(reverse=True)
print(l[K-1])

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
l = []
for i in range(1, max(A, B)):
  if A % i == 0 and B % i == 0:
    l.append(i)
    
l.sort(reverse=True)
print(l[K-1])

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
num = max(A, B)
a = []
cnt = 0
for i in range(1,num):
  if A%i == 0 and B % i == 0:
    cnt += 1
    a.append(i)

print(a[cnt-K])
Problem p03125 (python)

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

if B % A == 0:
    print(A+B)
else:
    print(B-A)

Buggy submission (verdict: Runtime Error):
N = int(input())
life_list = list(map(int, input().split()))
life_list.sort()
while life_list[1] - life_list[0] > 0:
    if life_list[1] == life_list[0]:
        break
	life_list[1] = life_list[1] - life_list[0]
    life_list.sort()
        
print(life_list[0])
Problem p03130 (python)

Fixed submission:
data = []

for i in range(3):
    data.append(list(map(int, input().split())))
data = sum(data, [])

result = [0]*4
for i in data:
    result[i-1]+=1
if 3 in result:
    print("NO")
else:
    print("YES")

Buggy submission (verdict: Runtime Error):
data = []
for i in range(3):
    data.append(list(map(int, input().split())))
data = sum(data, [])

for i in data:
    result[i-1]+=1
if 3 in result:
    print("NO")
else:
    print("YES")
Problem p03146 (python)

Fixed submission:
s = int(input())
l = []
flag = False
cnt = 0
tmp = 0
while flag==False:
  if tmp in l:
    cnt += 1
    flag = True
  else:
    if s % 2 == 0:
      tmp = s / 2
      l.append(s)
      s = tmp
      cnt += 1
    else:
      tmp = 3*s +1
      l.append(s)
      s = tmp
      cnt += 1
      
print(cnt)

Buggy submission (verdict: Runtime Error):
s = input()
l = []

while flag=False:
  if tmp in l:
    flag = True
  else:
    if s % 2 == 0:
      tmp = s / 2
      l.append(tmp)
      s = tmp
    else:
      tmp = 3*s +1
      l.append(tmp)
      s = tmp
      
l.sort()
print(l[-2])
Problem p03238 (python)

Fixed submission:
N = int(input())

if N==1:
    print('Hello World')
else:
    
    A = int(input())
    B = int(input())

    print(A+B )

Buggy submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())

print('Hello World' if N == 1 else A+B )
Problem p03280 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 0
if N < 105:
  pass
else:
  for i in range(105, N+1, 2):
    cnt = 0
    for j in range(1, N+1):
      if i % j == 0:
        cnt += 1
    if cnt == 8:
      ans += 1
      
print(ans)
Problem p03281 (python)

Fixed submission:
N = int(input())
ans = 0
if N < 105:
  pass
else:
  for i in range(105, N+1, 2):
    cnt = 0
    for j in range(1, N+1):
      if i % j == 0:
        cnt += 1
    if cnt == 8:
      ans += 1
      
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 0
if N < 105:
  pass
else:
  for i in range(1, N+1):
    cnt = 0
    for j in range(1, N+1):
	    if j % i == 0:
          cnt += 1
    if cnt == 8:
      ans += 1
      
print(ans)
Problem p03293 (python)

Fixed submission:
s = input()
t = input()

for _ in range(len(s)):
    if s == t:
        print('Yes')
        exit()
    s = s[-1]+s[:-1]
print('No')

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

for _ in range(len(s)):
    if s = t:
        print('Yes')
        exit()
    s = s[-1]+s[:-1]
print('No')
Problem p03309 (python)

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

for i in range(N):
    A[i] -= i+1

A.sort()
median = A[N//2]

for i in range(N):
    A[i] -= median
    A[i] = abs(A[i])
print(sum(A))

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

for i in range(N):
    A[i] -= i+1

A.sort()
print(A)
if N % 2 == 0:
    median = A[N//2]
else:
    median = A[(N + 1)//2]

for i in range(N):
    A[i] -= median
print(sum(A))
Problem p03338 (python)

Fixed submission:
# https://atcoder.jp/contests/abc098/submissions/5418660
N = int(input())
S = input()
ans = 0
moji = 'abcdefghijklmnopqrstuvwxyz'
for i in range(1, N):
  l, r = S[:i], S[i:]
  cnt = 0
  for c in moji:
    if c in l and c in r:
      cnt += 1
  ans = max(ans, cnt)
  
print(ans)

Buggy submission (verdict: Runtime Error):
# https://atcoder.jp/contests/abc098/submissions/5418660
N = int(input())
S = input()
ans = 0
moji = 'abcdefghijklmnopqrstuvwxyz'
for i in range(1, N):
  l, r = S[:i], S[i:]
  cnt = 0
  for c in moji:
    if c in l an c in r:
      cnt += 1
  ans = max(ans, cnt)
  
print(ans)
Problem p03359 (python)

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

if a <= b:
  print(a)
else:
  print(a-1)

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

ans = A + B + C - max(A, B, C) * (K - 1) *2
  
print(int(ans))

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

if a < b:
  print(a)
else:
  print(a-1)
Problem p03370 (python)

Fixed submission:
N, X = map(int, input().split())
A = []
for i in range(N):
  A.append(int(input()))
A.sort()
ans = N
X -= sum(A)
ans += X//A[0]
print(ans)

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
A = []
for i in range(N):
  A.append(int(input())
A.sort()
ans = N
X -= sum(A)
ans += X//A[0]
print(ans)
Problem p03377 (python)

Fixed submission:
l = input().split()
if int(l[0])+int(l[1])>=int(l[2]) and int(l[0])<=int(l[2]):
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
n=int(input())
a1=input().split()
tag_list=()
dic={}
for i in a1:
    tag_list.append(int(i))
 
for j in range(0,n):
    numnum=tag_list[j]
    if numnum in dic:
        print(dic[numnum])
    else:
        A=list(tag_list)
        A.pop(j)
        A.sort()
        num=int(n/2-1)
        print(A[num])
        dic[numnum]=A[num]

Buggy submission (verdict: Runtime Error):
n=int(input())
a1=input().split()
tag_list=[]
for i in a1:
    tag_list.append(int(i))

for j in range(0,n):
    numnum=tag_list[j]
    if numnum in dic:
        print(dic[numnum])
    else:
        A=tag_list[0:j]
        test=tag_list[j+1:n]
        A.extend(test)
        A.sort()
        num=int(n/2-1)
        print(A[num])
        dic[numnum]=A[num]

Buggy submission (verdict: Runtime Error):
l = map(int, raw_input().split())
if l[0]+l[1]<l[2]:
    print('YES')
else:
    print('NO')
Problem p03386 (python)

Fixed submission:
A, B, K = map(int, input().split())
l = []

for i in range(A, min(B, A+K)):
  l.append(i)
for i in range(max(A, B-K+1), B+1):
  l.append(i)

l = list(set(l))
l.sort()
for i in l:
  print(i)

Buggy submission (verdict: Runtime Error):
x,y,z=[int(i) for i in input().split()]
S=list(range(x,y+1))
if x<z and z<y:
    S.pop(z-x)
for num in S:
    print(num)

Buggy submission (verdict: Runtime Error):
x,y,z=[int(i) for i in input().split()]
S=list(range(x,y+1))

if x<z:
    for j in range(0,min(z-x,y-x+1)):
        print(S[j])
if z<y:
    for j in range(max(z-x+1,x),y-x+1):
        print(S[j])

Buggy submission (verdict: Runtime Error):
x,y,z=[int(i) for i in input().split()]
S=list(range(x,y+1))

if x<z:
    for j in range(0,z-x):
        print(S[j])
if z<y:
    for j in range(z-x+1,y-x+1):
        print(S[j])

Buggy submission (verdict: Runtime Error):
x,y,z=map(int,input().split())
S=list(range(x,y+1))

if x<z:
    for j in range(0,z-x):
        print(S[j])
if z<y:
    for j in range(z-x+1,y-x+1):
        print(S[j])
Problem p03407 (python)

Fixed submission:
A, B, C = map(int, input().split())

if (A+B) >= C:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input())

if (A+B) > C:
  print("Yes")
else:
  print("No")
Problem p03408 (python)

Fixed submission:
N = int(input())
b = []
r = []
all_l = []
for i in range(N):
  tmp = input()
  b.append(tmp)
  all_l.append(tmp)
N = int(input())
for i in range(N):
  tmp = input()
  r.append(tmp)
  all_l.append(tmp)
all_l = list(set(all_l))
ans = 0
for i in all_l:
  ans = max(ans, b.count(i)-r.count(i))
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
b = []
r = []
_all = []
for i in range(N):
  b.append(input())
  _all.append(input())
N = int(input())
for i in range(N):
  r.append(input())
  _all.append(input())
_all = list(set(_all))
ans = 0
for i in _all:
  ans = max(ans, b.count(i)-r.count(i))
print(ans)
Problem p03415 (python)

Fixed submission:
A=input()
B=input()
C=input()

print(A[0]+B[1]+C[-1])

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
cnt = 0
for i in range(A, B+1):
  tmp = str(i)
  if tmp[0] == tmp[-1] and tmp[1] == tmp[3]:
    cnt += 1
print(cnt)
Problem p03434 (python)

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

a.sort(reverse=True)
alice = a[0::2]
bob = a[1::2]

alice = sum(alice)
bob = sum(bob)
print(alice - bob)

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

a.sort(reverse=True)
alice = a[0::2]
bob = a[1::2]

alice = sum(alice)
bob = sum(bob)
print(alice - bob)
Problem p03448 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
cnt = 0

for i in range(A+1):
  for j in range(B+1):
    for k in range(C+1):
      if 500*i + 100*j + 50*k == X:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
cnt = 0

for i in range(A+1):
  for j in range(B+1):
    for k in range(C+1):
      if 500*i + 100*j + 50*k == X:
        cnt += 1
ans(cnt)
Problem p03469 (python)

Fixed submission:
a=input().split('/')
a[0]=int(a[0])+1

print(str(a[0])+'/'+a[1]+'/'+a[2])

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

S[3]="8"
print(S)
Problem p03473 (python)

Fixed submission:
a=input()
print(48-int(a))

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

if S[A] == "-" and S.count("-") == 1:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
l = input().split()
a=input()

b=a.split("-")


if len(b[0]) == l[0] and len(b[1])==l[1] and and len(b)<3:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
a=raw_input()
print(48-int(a))
Problem p03474 (python)

Fixed submission:
A, B = map(int, input().split())
S = input()

if S[A] == "-" and S.count("-") == 1:
  print("Yes")
else:
  print("No")

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

if S[A] = "-" and S.count("-") == 1:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
l = input().split()
a=input()

b=a.split("-")


if len(b[0]) == l[0] and len(b[1])==l[1] and and len(b)<3:
    print('Yes')
else:
    print('No')
Problem p03543 (python)

Fixed submission:
N = input()
N_list = [int(i) for i in N]

if N_list[0] == N_list[1] == N_list[2] or N_list[1] == N_list[2] == N_list[3]:
  print("Yes")
else:
  print("No")

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

if len(set(list)) <= 2:
  print("Yes")
else:
  print("No")
Problem p03574 (python)

Fixed submission:
H, W = map(int, input().split())
S = []
for i in range(H):
  S.append(list(i for i in input()))
# 参考https://atcoder.jp/contests/abc075/submissions/5409794
for i in range(H):
  for j in range(W):
    if S[i][j] == ".":
      cnt = 0
      if i != 0:
        cnt += S[i-1][max(0, j-1) : min(j+1, W-1) + 1].count("#")
      cnt += S[i][max(0, j-1) : min(j+1, W-1) + 1].count("#")
      if i != H-1:
        cnt += S[i+1][max(0, j-1) : min(j+1, W-1) + 1].count("#")
      S[i][j] = str(cnt)
for i in range(H):
	print("".join(S[i]))

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
data = []
for i in range(H):
  S.append(input())
# 参考https://atcoder.jp/contests/abc075/submissions/5409794
for i in range(H):
  for j in range(W):
    if S[i][j] == ".":
      cnt = 0
      if i != 0:
        cnt += S[i-1][min(0, j-1) : min(j+1, W-1) + 1].count("#")
      cnt += S[i][min(0, j-1) : min(j+1, W-1) + 1].count("#")
      if i != H-1:
        cnt += S[i+1][min(0, j-1) : min(j+1, W-1) + 1].count("#")
      S[i][j] = cnt
for i in range(H):
	print("".join(S[i]))
Problem p03598 (python)

Fixed submission:
N = int(input())
K = int(input())
A = list(map(int, input().split()))
cnt = 0
for i in A:
  cnt += min(abs(K-i), (i))*2
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
cnt = 0
for i in range(N):
  tmp = int(input())
  cnt += min(abs(K-tmp), (tmp))*2
print(cnt)
Problem p03607 (python)

Fixed submission:
from collections import Counter
N = int(input())
A = []

for i in range(N):
  tmp = int(input())
  A.append(tmp) 
B = Counter(A).values()
cnt = 0
for i in B:
  if i % 2 != 0:
    cnt += 1
  
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = []

for i in range(N):
  tmp = int(input())
  if tmp not in A:
    A.append(tmp)
  else:
    A.romove(tmp)
    
print(len(A))
Problem p03611 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = [0]*(100000+2)

for i in A:
  ans[i-1] += 1
  ans[i] += 1
  ans[i+1] += 1

  
print(max(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
ans = [0]*(max(A)+1)

for i in A:
  ans[i-1] += 1
  ans[i] += 1
  ans[i+1] += 1

  
print(max(ans))
Problem p03680 (python)

Fixed submission:
N = int(input())
a = []
for i in range(N):
  a.append(int(input()))
j = 0
count = 1
flag = False

for i in range(N):
  if a[j] == 2:
    flag = True
    break
  else:
    count += 1
    j = a[j]-1


if flag:
  print(int(count))
else:
  print("-1")

Buggy submission (verdict: Runtime Error):
N = int(input())
a = []
for i in range(N):
  a.append(int(input()))
j = 0
count = 0
flag = False
for i in range(N):
  if a[j] == 2:
    flag = True
    break
  else:
    j = a[j]
    count += 1

if flag:
  print(count)
else:
  print(-1)
Problem p03694 (python)

Fixed submission:
_ = input()
A = list(map(int, input().split()))
A.sort()
print(A[-1]-A[0])

Buggy submission (verdict: Runtime Error):
_
A = list(map(int, input().split()))
A.sort()
print(A[-1]-A[0])
Problem p03737 (python)

Fixed submission:
A, B, C = input().split()

print(A[0].upper()+B[0].upper()+C[0].upper())

Buggy submission (verdict: Runtime Error):
A = input()
B = input()
flag = False
if len(A) > len(B):
  print("GREATER")
elif len(A) < len(B):
  print("LESS")
elif len(A) == len(B):
  for i in range(len(A)):
    if int(A[i]) > int(B[i]):
      print("GREATER")
      break
    elif int(A[i]) < int(B[i]):
      print("LESS")
      break
  flag = True
  
if flag:
  print("EQUAL")
Problem p03738 (python)

Fixed submission:
A = input()
B = input()
flag = True
if len(A) > len(B):
  print("GREATER")
  flag = False
elif len(A) < len(B):
  print("LESS")
  flag = False
elif len(A) == len(B):
  for i in range(len(A)):
    if int(A[i]) > int(B[i]):
      print("GREATER")
      flag = False
      break
    elif int(A[i]) < int(B[i]):
      print("LESS")
      flag = False
      break

  
if flag:
  print("EQUAL")

Buggy submission (verdict: Runtime Error):
import numpy as np
A = np.log10(int(input()))
B = np.log10(int(input()))

if A > B:
  print("A")
else:
  print("B")
Problem p03759 (python)

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

if b-a == c-b:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
data = [k for k in input()]

ans = Counter(data)
for i in range(n-1):
  tmp = Counter([k for k in input()])
  for j in set(data):
    ans[j] = min(ans[j], tmp[j])
#    print(j, ans[j], tmp[j], min(ans[j], tmp[j]))
ans_list = list(set(list(ans.elements())))
ans_list.sort()
answer = ""
for i in ans_list:
  answer += i*ans[i]
print(answer)
Problem p03778 (python)

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

if a+W < b:
  tmp = b-a-W
  if tmp <= 0:
    print(0)
  else:
    print(tmp)
elif a > b+W:
  tmp = a-W-b
  if tmp <= 0:
    print(0)
  else:
    print(tmp)
else:
  print(0)

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

if a+W = b:
  tmp = b-a-W
  if tmp <= 0:
    print(0)
  else:
    print(tmp)
elif a > b+W:
  tmp = a-W-b
  if tmp <= 0:
    print(0)
  else:
    print(tmp)
else:
  print(0)
Problem p03814 (python)

Fixed submission:
S = input()
min_ = 0
max_ = 0
flag_min = True
for i in range(len(S)):
  if flag_min:
    if S[i] == "A":
      min_ = i
      flag_min = False
  else:
    if S[i] == "Z":
      max_ = i
      
print(max_ - min_ + 1)

Buggy submission (verdict: Runtime Error):
S = input()
min_ = 0
max_ = 0
flag_min = False
for i in len(S):
  if flag_min:
    if S[i] == "A":
      min_ = i
      flag_min = True
  else:
    if S[i] == "Z":
      max_ = i
      
print(max_ - min_ + 1)
Problem p03844 (python)

Fixed submission:
A, op, B = input().split()
A, B = int(A), int(B)

if op == "+":
  print(A+B)
else:
  print(A-B)

Buggy submission (verdict: Runtime Error):
_ = input()
T = list(map(int, input().split()))
M = int(input())
for i in range(M):
  P, X = map(int, input().split())
  ans = sum(T[:P]+T[P+1])+X
  print(ans)
Problem p03845 (python)

Fixed submission:
_ = input()
T = list(map(int, input().split()))
M = int(input())
for i in range(M):
  P, X = map(int, input().split())
  ans = sum(T[:P-1])+sum(T[P:])+X
  print(ans)

Buggy submission (verdict: Runtime Error):
_ = input()
T = list(map(int, input().split()))
M = int(input())
for i in range(M):
  P, X = map(int, input().split())
  ans = sum(T[:P]+T[P+1])+X
  print(ans)

Buggy submission (verdict: Runtime Error):
_ = input()
T = list(map(int, input().split()))
M = int(input())
for i in range(M):
  P, X = map(int, input().split())
  ans = sum(T[:P]+T[P+1])+X
Problem p03943 (python)

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

if max(a,b,c) == (a+b+c)-max(a,b,c):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
W, H, N = map(int, input().split())
X, Y = 0, 0
for i in range(N):
  x, y, a = map(int, input().split())
  if a == 1:
    X = max(x, X)
  elif a == 2:
    W = min(W, x)
  elif a == 3:
    Y = max(y, Y)
  elif a == 4:
    H = min(H, y)
ans = (W-X)*(H-Y)
if ans <= 0:
  print(0)
else:
  print(ans)

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

if max(a,b,c) == sum(a,b,c)-max(a,b,c):
  print("Yes")
else:
  print("No")
Problem p03944 (python)

Fixed submission:
W, H, N = map(int, input().split())
X, Y = 0, 0

for i in range(N):
  x, y, a = map(int, input().split())
  if a == 1:
    X = max(X, x)
  elif a == 2:
    W = min(W, x)
  elif a == 3:
    Y = max(Y, y)
  elif a == 4:
    H = min(H, y)
    
if (W-X) < 0 or (H-Y) < 0:
  print(0)
else:
  print((W-X)*(H-Y))

Buggy submission (verdict: Runtime Error):
W, H, N = map(int, input().split())
X, Y = 0, 0
for i in range(N+1):
  x, y, a = map(int, input().split())
  if a == 1:
    X = max(X, x)
  elif a == 2:
    W = min(W, x)
  elif a == 3:
    Y = max(Y, y)
  elif a == 4:
    H = min(H, y)
ans = max(0, (W-X)*(H-Y))
print(ans)
Problem p04012 (python)

Fixed submission:
w = input()
flag = False
arr = []
for i in w:
  arr.append(i)
  
set_arr = list(set(arr))
for i in set_arr:
  count_num = arr.count(i)
  if count_num % 2 != 0:
    flag = True
    break
if flag:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
w = input()
flag = False
arr = []
for i in range(w):
  arr.append(i)
  
set_arr = list(set(arr))
for i in set_arr:
  cout_num = arr.count(i)
  if count_num % 2 != 0:
    flag = True
    break
if flag:
  print("No")
else:
  print("Yes")
Problem p02999 (python)

Fixed submission:
if __name__=="__main__":
    X,A=input().split()
    X=int(X)
    A=int(A)
    if X<A:
        print("0")
    elif X>=A:
        print("10")

Buggy submission (verdict: Runtime Error):
k=[]
k=list(map(int,input().split())
if k[0]<k[1]:
       print("0")
else:
       print("10")
Problem p03000 (python)

Fixed submission:
N,X=map(int,input().split())
L=list(map(int,input().split()))
n=1
prev=0
for i in range(N):
    curr=prev+L[i]
    if(curr>X):
        break
    else:
        n=n+1
    prev=curr
print(n)

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
n=0
i=0
D=0
while(D<=X):
    D=D+L[i]
    n=n+1
    i=i+1
print(n)
Problem p02999 (python)

Fixed submission:
lst = list(map(int, input().split()))
 
if (lst[0] < lst[1]):
  print(0)
else:
  print(10)

Buggy submission (verdict: Runtime Error):
lst = list(int, input().split())

if (lst[0] < lst[1]):
  print(0)
else:
  print(10)
Problem p03543 (python)

Fixed submission:
n = list(input())
m = 0
for i in range(2):
    if n[i]==n[i+1]==n[i+2]:
        m += 1
        print("Yes")
        break
if m==0:
    print("No")

Buggy submission (verdict: Runtime Error):

        print("Yes")

Buggy submission (verdict: Runtime Error):
n = list(int(input()))
for i in range(2):
    if n[i]==n[i+1]==n[i+2]:
        break
        print("Yes")
if n[1]!=n
print("No")

Buggy submission (verdict: Runtime Error):
n = list(input())
for i in range(2):
    if n[i]==n[i+1]==n[i+2]:
        break
        print("Yes")
if n[1]!=n
print("No")
Problem p03577 (python)

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

Buggy submission (verdict: Runtime Error):
S = input()
print(S - "FESTIVAL")
Problem p03719 (python)

Fixed submission:
a, b, c = map(int, input().split())
 
if a<=c and c<=b:
    print("Yes")
else:
    print("No")

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

if a<=c and c<=b:
    print("Yes")
else:
    print("No")

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

if a<=c and c<=b:
    print("Yes")
else:
    print(”No”)