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

Fixed submission:
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a

A,B,C,D = map(int, input().split())

nrofC = (B // C) - ((A-1) // C)
nrofD = (B // D) - ((A-1) // D)

cdlcm = (C * D) // gcd(D,C)
nrofCD = (B // cdlcm) - ((A-1) // cdlcm)

print((B-(A-1)) - nrofC - nrofD + nrofCD)

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

nrofC = (B // C) - ((A-1) // C)
nrofD = (B // D) - ((A-1) // D)

cdlcm = C * D // math.gcd(C,D)
nrofCD = (B // cdlcm) - ((A-1) // cdlcm)

print((B-(A-1)) - nrofC - nrofD + nrofCD)
Problem p03044 (python)

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys
#import numpy
#from collections import deque
sys.setrecursionlimit(10**5)

def input():
    return sys.stdin.readline().rstrip('\n')

N = int(input())

childsof = [[] for _ in range(N+1)]

for _ in range(N-1):
    u,v,w = list(map(int, input().split()))
    childsof[u].append((v,w))
    childsof[v].append((u,w))

distances = [-1]*(N+1)
distances[1] = 0

def dfs(i):
    childs = childsof[i]

    for c in childs:
        j = c[0]
        if distances[j] == -1:
            distances[j] = distances[i] + c[1]
            dfs(j)

dfs(1)

for d in distances[1:]:
    if d % 2 == 0: #even
        print(0)
    else:
        print(1)

Buggy submission (verdict: Runtime Error):
import sys
import numpy
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import dijkstra

def input():
    return sys.stdin.readline().rstrip('\n')

N = int(input())

# めちゃくちゃ遅くて TLE
#V = [[0]*N for _ in range(N)]

V = numpy.zeros((N,N), dtype=numpy.int8)

for i in range(N-1):
    u,v,w = list(map(int, input().split()))
    V[u-1][v-1] = w

D = dijkstra(csr_matrix(V), directed=False, indices=0)
#print(D)

for d in D:
    if d % 2 == 0: #even
        print(0)
    else:
        print(1)

Buggy submission (verdict: Runtime Error):
import array

N = int(input())

EVEN = {}
ODD = {}
COLOR = array.array('i', [-1]*(N+1))

for i in range(1,N+1):
    EVEN[i] = []
    ODD[i] = []

for i in range(N-1):
    u,v,w = list(map(int, input().split()))
    if w % 2 == 0:
        EVEN[u].append(v)
    else:
        ODD[u].append(v)

print(EVEN)
print(ODD)

def determine_color(i):
    for j in EVEN[i]:
        if COLOR[j] == 0:
            return 0
        elif COLOR[j] == 1:
            return 1
    for j in ODD[i]:
        if COLOR[j] == 0:
            return 1
        elif COLOR[j] == 1:
            return 0

def reverse_color(color):
    if color == 0:
        return 1
    if color == 1:
        return 0
    
COLOR[1] = 0

for i in range(1,N+1):
    if COLOR[i] == -1:
        color = determine_color(i)
        COLOR[i] = color
    else:
        color = COLOR[i]

    for j in EVEN[i]:
        COLOR[j] = color
    for j in ODD[i]:
        COLOR[j] = reverse_color(color)


for i in range(1,N+1):
    print(COLOR[i])
Problem p03061 (python)

Fixed submission:
from collections import deque
from copy import copy
from array import array

def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a

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

def get_prefix_gcd_list(Adeque):
    prefix_gcd = array('i', [0]*N)
    # marker
    prefix_gcd[0] = 0
    # the first itself is gcd
    prefix_gcd[1] = Adeque.popleft()
    for i in range(2,N):
        a = Adeque.popleft()
        prefix_gcd[i] = gcd(prefix_gcd[i-1], a)
        pass
    return prefix_gcd
        
    
# PREFIX_GCD[i]...i より前の要素のGCD
PREFIX_GCD = get_prefix_gcd_list(deque(copy(A)))

# PREFIX_GCD[i]...i より後の要素のGCD
POSTFIX_GCD=list(reversed(get_prefix_gcd_list(deque(reversed(A)))))

gcd_max=1

for i in range(N):
    pre = PREFIX_GCD[i]
    pos = POSTFIX_GCD[i]
    if pre == 0:
        _gcd = pos
    elif pos == 0:
        _gcd = pre
    else:
        _gcd = gcd(pre,pos)
    gcd_max = max(gcd_max, _gcd)
        
print(gcd_max)

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

gcd_max=1

import functools
import math

for i in range(N):
    a = A.popleft()
    gcd_max = max(gcd_max, functools.reduce(math.gcd, A))
    A.append(a)

print(gcd_max)

Buggy submission (verdict: Runtime Error):
from collections import deque
from copy import copy

def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a

def gcd_of_array(_array):
    _array_copy = copy(_array)
    array_of_gcd = deque([])
    n = len(_array_copy)
    if n == 1:
        return _array[0]
    if n % 2 == 1:
        a = _array_copy.pop()
        array_of_gcd.append(a)
    for i in range(0,N-1,2):
        array_of_gcd.append(gcd(_array_copy.pop(),_array_copy.pop()))

    return gcd_of_array(array_of_gcd)

    
N = int(input())
A = deque(list(map(int, input().split())))

gcd_max=1

for i in range(N):
    a = A.popleft()
    gcd_max = max(gcd_max, gcd_of_array(A))
    A.append(a)

print(gcd_max)

Buggy submission (verdict: Runtime Error):
from collections import deque
from copy import copy
from copy import deepcopy

def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a

def gcd_of_array(_array):
    _array_copy = _array.copy()
    array_of_gcd = deque([])
    n = len(_array_copy)
    if n == 1:
        return _array[0]
    if n % 2 == 1:
        a = _array_copy.pop()
        array_of_gcd.append(a)
    for i in range(0,N-1,2):
        array_of_gcd.append(gcd(_array_copy.pop(),_array_copy.pop()))

    return gcd_of_array(array_of_gcd)

    
N = int(input())
A = deque(list(map(int, input().split())))

gcd_max=1

for i in range(N):
    a = A.popleft()
    gcd_max = max(gcd_max, gcd_of_array(A))
    A.append(a)

print(gcd_max)
Problem p02887 (python)

Fixed submission:
n=int(input())
ch=input()
a=ch[0]
x=n
for i in range(1,n):
    if a==ch[i]:
        x-=1
    a=ch[i]
print(x)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=[*input()]
a=l[0]
x=n
for i in range(1,n):
    if a==l[i]:
        x-=1
    a=l[i]
print(x)
Problem p02909 (python)

Fixed submission:
s=input()
if s=='Sunny':
  print('Cloudy')
elif s=='Cloudy':
  print('Rainy')
else:
  print('Sunny')

Buggy submission (verdict: Runtime Error):
s=input()
Sunny, Cloudy, Rainy, Sunny, Cloudy, Rainy, ...
if s=='Sunny':
  print('Cloudy')
elif s=='Cloudy':
  print('Rainy')
else:
  print('Sunny')
Problem p02921 (python)

Fixed submission:
s=input()
t=input()
a=0
for i in range(len(s)):
  if s[i]==t[i]:
    a+=1
print(a)

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
s=0
for i in range(len(s)):
  if s[i]==t[i]:
    s+=1
print(s)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if b==1:
    print(0)
elif a>=b:
    print(1)
else:
    i=2
    while 1:
        if (a-1)*(i-1)+a>=b:
            break
        else:
            i+=1
    print(i)
Problem p02923 (python)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
l=[0]*n
for i in range(1,n):
    if h[i]<=h[i-1]:
        l[i]=1+l[i-1]
print(max(l))

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
if n>1:
    l=[]
    a=0
    for i in range(n-1):
        if h[i]>=h[i+1]:
            a+=1
        else:
            l.append(a)
            a=0
    a=0
    h.reverse()
    for i in range(n-1):
        if h[i]<=h[i+1]:
            a+=1
        else:
            l.append(a)
            a=0
    print(max(l))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
l=[]
a=0
for i in range(n-1):
    if h[i]>=h[i+1]:
        a+=1
    else:
        l.append(a)
        a=0
print(max(l))

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
l=[]
a=0
for i in range(n-1):
    if h[i]>=h[i+1]:
        a+=1
    else:
        l.append(a)
        a=0
a=0
h.reverse()
for i in range(n-1):
    if h[i]<=h[i+1]:
        a+=1
    else:
        l.append(a)
        a=0
print(max(l))
Problem p02994 (python)

Fixed submission:
n,l=map(int,input().split())
t=[]
p=[]
for i in range(n):
    t.append(l+i)
    if l+i>=0:
        p.append(l+i)
if p==[]:
    print(sum(t)-max(t))
else:
    print(sum(t)-min(p))

Buggy submission (verdict: Runtime Error):
n,l=map(int,input().split())
t=[]
p=[]
for i in range(n):
    t.append(l+i)
    if l+i>=0:
        p.append(l+i)
if p=[]:
    print(sum(t)-max(t))
else:
    print(sum(t)-min(p))
Problem p03030 (python)

Fixed submission:
n=int(input())

l=[]
a=[]
b=[]
d={}
s=[]

for i in range(1,n+1):
    t=list(input().split())
    l.append([t[0],int(t[1])])
    if t[0] not in a:
        a.append(t[0])
    b.append(t[0])
c=l.copy()
for e in a:
    d[e]=b.count(e)
c.sort()
i=0
while i<n:
    if d[c[i][0]]==1:
        s.append(l.index(c[i])+1)
        i+=1
    else:
        for j in range(d[c[i][0]]):
            s.append(l.index(c[i+d[c[i][0]]-1-j])+1)
        i+=d[c[i][0]]

for i in range(n):
    print(s[i])

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

l=[]
a=[]
b=[]
d={}
s=[]

for i in range(1,n+1):
    t=list(input().split())
    l.append([t[0],int(t[1])])
    if t[0] not in a:
        a.append(t[0])
    b.append(t[0])
c=l.copy()
for e in a:
    d[e]=b.count(e)
c.sort()
i=0
while i<n:
    if d[c[i][0]]==1:
        s.append(l.index(b[i]))
        i+=1
    else:
        for j in range(d[c[i][0]]):
            s.append(l.index(c[i+d[c[i][0]]-1-j])+1)
        i+=d[c[i][0]]

for i in range(n):
    print(s[i])
Problem p03076 (python)

Fixed submission:
l=[]
l.append(int(input()))
l.append(int(input()))
l.append(int(input()))
l.append(int(input()))
l.append(int(input()))
t=[]
for e in l:
    t.append(e%10)
s=0
i=0
while 0 in t:
    j=t.index(0)
    t[j]=-1
    s+=l[j]
    i+=1
while i<4:
    j=t.index(max(t))
    t[j]=-1
    s+=l[j]-l[j]%10+10
    i+=1
if i==4:
    j=t.index(max(t))
    s+=l[j]
print(s)

Buggy submission (verdict: Runtime Error):
n=int(input())
ss=n
l=[]
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
t=0
bb,cc,dd,ee,ff=0,0,0,0,0
while ff==0:
    if ee>0:
        ff+=min(ee,e)
        ee-=min(ee,e)
    if dd>0:
        ee+=min(dd,d)
        dd-=min(dd,d)
    if cc>0:
        dd+=min(cc,c)
        cc-=min(cc,c)
    if bb>0:
        cc+=min(bb,b)
        bb-=min(bb,b)
    if n>0:
        bb+=min(n,a)
        n-=min(n,a)
    t+=1
if ss==ff:
    print(t)
else:
    print(ss//ff+t)
Problem p03085 (python)

Fixed submission:
c=input()
if c=='A':
  print('T')
elif c=='T':
  print('A')
elif c=='G':
  print('C')
else:
  print('G')

Buggy submission (verdict: Runtime Error):
c=input()
if c='A':
  print('T')
elif c='T':
  print('A')
elif c='G':
  print('C')
else:
  print('G')
Problem p03087 (python)

Fixed submission:
n,q=map(int,input().split())
s=input()
a=[0]*(n+1)
for i in range(0,n):
    if s[i-1:i+1]=="AC":
        a[i]=a[i-1]+1
    else:
        a[i]=a[i-1]

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

Buggy submission (verdict: Runtime Error):
n,q=map(int,input().split())
s=input()
a=len(s)
l=[0]*a
z=0
i=0
while i<a:
    if s[i]=='A' and s[i+1]=='C':
        z+=1
        l[i],l[i+1]=['A',z],['C',z]
        i+=2
    else:
        l[i]=['O',z]
        i+=1
for _ in range(q):
    x,y=map(int,input().split())
    for i in range(x-1,y):
        if l[i][0]=='A':
            a=l[i][1]
            break
    for i in range(y-1,x-2,-1):
        if l[i][0]=='C':
            b=l[i][1]
            break
    print(b-a+1)
Problem p02830 (python)

Fixed submission:
inp_1 = int(input())
inp_2 = input().split(" ")
r = ""

for i in range(inp_1):
  r += inp_2[0][i]
  r += inp_2[1][i]

print(r)

Buggy submission (verdict: Runtime Error):
inp_1 = int(input())
inp_2 = input().split(" ")
r = ""

for i in range(inp_1):
  r += inp_2[0][i]
  r += inp_2[1][i]

print(o)
Problem p02861 (python)

Fixed submission:
import math
import itertools

N = int(input())
x = [list(map(int, input().split())) for i in range(N)]


# print(x)
# print(y)

def root(xi, yi, xj, yj):
    return math.sqrt((xi - xj) ** 2 + (yi - yj) **2)

# print(root(1, 0, 0, 0))
# print(root(0, 0, 0, 1))


# a = root(4, 3, 6, 2)
# print(a)



# x1 = (-406, 10)
# x2 = ( 512, 859)
# x3 = ( 494, 362)
# x4 = (-955, -475)
# x5 = ( 128, 553)
# x6 = (-986, -885)
# x7 = ( 763, 77)
# x8 = ( 449, 310)
#

l = x
# print(l)
# l = [x1, x2, x3, x4, x5, x6, x7, x8]

m = 0
for i in itertools.permutations(l, len(l)):
    k = 0
    for j in range(len(i) -1):
        k += root(*(i[j] + i[j+1]))
    m += k
print(m/math.factorial(len(l)))

Buggy submission (verdict: Runtime Error):
import math
import itertools

N = int(input())
x = [0] * N
y = [0] * N

for n in range(N):
    x[n], y[n] = map(int, input().split())


# print(x)
# print(y)

def root(xi, yi, xj, yj):
    return math.sqrt((xi - xj) ** 2 + (yi - yj) **2)

# print(root(1, 0, 0, 0))
# print(root(0, 0, 0, 1))


# a = root(4, 3, 6, 2)
# print(a)



# x1 = (-406, 10)
# x2 = ( 512, 859)
# x3 = ( 494, 362)
# x4 = (-955, -475)
# x5 = ( 128, 553)
# x6 = (-986, -885)
# x7 = ( 763, 77)
# x8 = ( 449, 310)
#

l = x +y
# l = [x1, x2, x3, x4, x5, x6, x7, x8]
m = 0
for i in itertools.permutations(l, len(l)):
    k = 0
    for j in range(len(i) -1):
        k += root(*(i[j] + i[j+1]))
    m += k
print(m/math.factorial(len(l)))

Buggy submission (verdict: Runtime Error):
import math
import itertools

N = int(input())
x = [0] * N
y = [0] * N

for n in range(N):
    x[n], y[n] = map(int, input().split())


def root(xi, yi, xj, yj):
    return math.sqrt((xi - xj) ** 2 + (yi - yj) **2)

# print(root(1, 0, 0, 0))
# print(root(0, 0, 0, 1))


# a = root(4, 3, 6, 2)
# print(a)



# x1 = (-406, 10)
# x2 = ( 512, 859)
# x3 = ( 494, 362)
# x4 = (-955, -475)
# x5 = ( 128, 553)
# x6 = (-986, -885)
# x7 = ( 763, 77)
# x8 = ( 449, 310)
#

# l = [x1, x2, x3, x4, x5, x6, x7, x8]
m = 0
for i in itertools.permutations(l, len(l)):
    k = 0
    for j in range(len(i) -1):
        k += root(*(i[j] + i[j+1]))
    m += k
print(m/math.factorial(len(l)))
Problem p02886 (python)

Fixed submission:
import sys
N = int(sys.stdin.readline())
d = list(map(int, input().split()))

recover = []

c = 0
for i in d:
    c += 1
    recover.append(i * sum(d[c:N]))

print(sum(recover))

Buggy submission (verdict: Runtime Error):
N = int(sys.stdin.readline())
d = list(map(int, input().split()))

recover = []

c = 0
for i in d:
    c += 1
    recover.append(i * sum(d[c:N]))

print(sum(recover))
Problem p02898 (python)

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


count = 0
for i in h:
    if i >= K:
        count += 1

print(count)

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


count = 0
for i in h:
    if i >= K:
        count += 1

print(count)
Problem p03260 (python)

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

a, b = map(int, input().split())                                                                        

for c in range(1,4):
    answer = a * b * c
    mod = answer % 2  
    if mod == 1:
        print('Yes')  
        break
    print('No') 
    break

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

for c in range(1,4):
    answer = a * b * c
    mod = answer % 2
    if mod == 1:
        print('Yes')
        break
    print('No')
    break

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

a = int(input())
b = int(input())

for c in range(1,4):
    answer = a * b * c
    mod = answer % 2
    if mod == 1:
        print('Yes')
        break
    print('No')
    break

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

a = int(input())
b = int(input())

for c in range(1,4):
    answer = a * b * c
    mod = answer % 2
    if mod == 1:
        print('Yes')
        break
    print('No')
    break

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

a = int(a)
b = int(b)


for c in range(1,4):
    answer = a * b * c
    mod = answer % 2
    if mod == 1:
        print('Yes')
        break
    print('No')
    break
Problem p02923 (python)

Fixed submission:
import sys
sys.setrecursionlimit(100000) 

n = int(input())
high = list(map(int,input().split()))
lists = []

def func(i,t):
    if i == n - 1:
        lists.append(t)
        return
    if high[i] < high[i+1]:
        lists.append(t)
        func(i+1,0)
    else:
        t += 1
        func(i+1,t)

func(0,0)
print(max(lists))

Buggy submission (verdict: Runtime Error):
n = int(input())
high = list(map(int,input().split()))
lists = []

def func(i,t):
    if i == n - 1:
        lists.append(t)
        return
    if high[i] < high[i+1]:
        lists.append(t)
        func(i+1,0)
    else:
        t += 1
        func(i+1,t)

func(0,0)
print(max(lists))

Buggy submission (verdict: Runtime Error):
n = int(input())
high = list(map(int,input().split()))
lists = []

def func(i,t):
    if i == n - 1:
        lists.append(t)
        return
    if high[i] < high[i+1]:
        lists.append(t)
        t = 0
        func(i+1,0)
    else:
        t += 1
        func(i+1,t)

func(0,0)
print(max(lists))

Buggy submission (verdict: Runtime Error):
n = int(input())
high = list(map(int,input().split()))
lists = []

def func(i,t):
    if i == n - 1:
        lists.append(t)
        return
    if high[i] < high[i+1]:
        lists.append(t)
        t = 0
        func(i+1,0)
    else:
        t += 1
        func(i+1,t)

func(0,0)
print(max(lists))

Buggy submission (verdict: Runtime Error):
n = int(input())
lists = list(map(int,input().split()))
res = []
def func(i, sum):
    if i == n-1:
        return sum
    if lists[i] < lists[i+1]:
        return sum
    return func(i+1, sum+1)

for j in range(n):
    res.append(func(j, 0))
print(max(res))

Buggy submission (verdict: Runtime Error):
n = int(input())
lists = list(map(int,input().split()))
res = []
def func(i, sum):
    if i == n-1:
        return sum
    if lists[i] < lists[i+1]:
        return sum
    return func(i+1, sum+1)

for j in range(n):
    res.append(func(j, 0))
print(max(res))
Problem p03455 (python)

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

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

Fixed submission:
import copy

n = int(input())
t_li = list(map(int, input().split()))
m = int(input())
px_li = []
result = []

for i in range(m):
  p, x = map(int, input().split())
  px_li.append([p, x])

for j in range(m):
  c_li = copy.copy(t_li)
  c_li[px_li[j][0] - 1] = px_li[j][1]
  result.append(str(sum(c_li)))

string = "\n".join(result)
print(string)

Buggy submission (verdict: Runtime Error):
import copy

n = int(input())
t_li = list(map(int, input().split()))
m = int(input())
px_li = []
result = []

for i in range(m):
  p, x = map(int, input().split())
  px_li.append([p, x])

for j in range(m):
  c_li = copy.copy(t_li)
  c_li[j] = px_li[j][1]
  result.append(str(sum(c_li)))

string = "\n".join(result)
print(string)
Problem p03308 (python)

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

print(max(ls) - min(ls))

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

print(max(ls) - min(ls))
Problem p03145 (python)

Fixed submission:
import math

AB, BC, CA = map(int, input().split())
s = (AB + BC + CA) / 2

print(int(math.sqrt(s* (s - AB) * (s - BC) * (s - CA))))

Buggy submission (verdict: Runtime Error):
AB, BC, CA = map(int, input().split())

print(int(AB + BC + CA) / 2))
Problem p03219 (python)

Fixed submission:
X, Y = map(int, input().split())

print(X + int(Y / 2))

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

print(X + int(Y / 2))
Problem p03296 (python)

Fixed submission:
n = int(input())
l = input().split()
prev = 0
flag = False
result = 0
for i in l:
    if flag == False and i == prev:
        flag = True
        result += 1
    elif flag == True:
        flag = False
    prev = i
print(result)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [[int(i) for i in input().split()] for i in range(n)]
prev = 0
flag = False
result = 0
for i in l:
    if flag == False and i == prev:
        flag = True
        result += 1
    elif flag == True:
        flag = False
    prev = i
print(result)
Problem p02830 (python)

Fixed submission:
n = int(input())
s,t = map(str,input().split())
u = ""
for i in range(n):
    u = u + s[i] + t[i]

print(u)

Buggy submission (verdict: Runtime Error):
n = int(input())
s,t = input().split()
 
for i in range(n):
    u = u + s[i] + t[i]
 
print(u)
Problem p02911 (python)

Fixed submission:
from collections import deque, defaultdict, Counter

n, k, q = map(int,input().split())

A = [int(input()) for i in range(q)]

cntA = Counter(A)

for i in range(1, n +1):
    if (k - q + cntA[i] >= 1 ):
        print('Yes')
    else :
        print('No')

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

A = [int(input()) for i in range(q)]

cntA = Counter(A)

for i in range(1, n +1):
    if (k - q + cntA[i] >= 1 ):
        print('Yes')
    else :
        print('No')
Problem p03155 (python)

Fixed submission:
N = int(input())
H = int(input())
W = int(input())
print((N - H + 1) * (N - W + 1))

Buggy submission (verdict: Runtime Error):
N = input()
H = input()
W = input()
print((N - H + 1) * (N - W + 1))
Problem p03351 (python)

Fixed submission:
l = input().split()
if abs(int(l[2]) - int(l[0])) <= int(l[3]):
    print("Yes")
elif abs(int(l[0]) - int(l[1])) <= int(l[3]) and abs(int(l[1]) - int(l[2])) <= int(l[3]):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
l = input().split()
if abs(l[2] - l[1]) > l[3]:
    print("Yes")
elif abs(l[0] - l[1]) > l[3] and abs(l[1] - l[2]) > l[3]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
l = input().split()
if abs(l[2] - l[1]) > l[3]:
    print("Yes")
elif abs(l[0] - l[1]) > l[3] and abs(l[1] - l[2]) > l[3]:
    print("Yes")
else:
    print("No")
Problem p03471 (python)

Fixed submission:
N, Y = map(int, input().split())
flag = 0
for num_so in range(N+1):
    if flag == 1:
        break
    for num_fs in range(N+1):
        num_ts = N - num_so - num_fs
        sum = num_ts * 10000 + num_fs * 5000 + num_so * 1000
        if flag == 1:
            break
        elif sum == Y and num_ts >= 0:
            print(num_ts, num_fs, num_so)
            flag = 1
            break

if flag == 0:
    print("-1 -1 -1")

Buggy submission (verdict: Runtime Error):
for x in range(N + 1):
    for y in range(N + 1 - x):
        if N - x - y >= 0 and 10000*x + 5000*y + 1000*(N - x - y) == Y:
            res = (x, y, N - x - y)
print(res[0], res[1], res[2])

Buggy submission (verdict: Runtime Error):
N = int(input())
Y = int(input())
flag = 0
for num_so in range(N):
    if flag == 1:
        break
    for num_fs in range(N):
        num_ts = N - num_so - num_fs
        sum = num_ts * 10000 + num_fs * 5000 + num_so * 1000
        if flag == 1:
            break
        elif sum == Y and num_ts > 0:
            print(num_ts, num_fs, num_so)
            flag = 1
            break

if flag == 0:
    print("-1 -1 -1")

Buggy submission (verdict: Runtime Error):
N = int(input())
Y = int(input())
flag = 0
for num_so in range(N):
    if flag == 1:
        break
    for num_fs in range(N):
        num_ts = N - num_so - num_fs
        sum = num_ts * 10000 + num_fs * 5000 + num_so * 1000
        if flag == 1 or num_ts < 0:
            break
        elif num_ts + num_fs + num_so == N and sum == Y:
            print(num_ts, num_fs, num_so)
            flag = 1
            break

if flag == 0:
    print("-1 -1 -1")

Buggy submission (verdict: Runtime Error):
N = int(input())
Y = int(input())
flag = 0
for num_fs in range(N):
    if flag == 1:
        break
    for num_so in range(N):
        num_ts = N - num_so - num_fs
        sum = num_ts * 10000 + num_fs * 5000 + num_so * 1000
        if flag == 1 or num_ts < 0:
            break
        elif num_ts + num_fs + num_so == N and sum == Y:
            print(num_ts, num_fs, num_so)
            flag = 1
            break

if flag == 0:
    print("-1 -1 -1")