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

Fixed submission:
T = int(input())
    
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

for _ in range(T):
    A, B, C, D = map(int, input().split())
    #print("----", _, A, B, C, D)
    if A < B:
        print("No")
        continue
    
    if C < A%B < B:
        print("No")
        continue
    
    if D % B == 0:
        print("Yes")
        continue
    
    if D < B:
        print("No")
        continue
    
    if C+(gcd(B,D)) < B:
        print("No")
        continue
    
    print("Yes")

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

for _ in range(T):
    A, B, C, D = map(int, input().split())
    #print("----", _, A, B, C, D)
    if A < B:
        print("No")
        continue
    
    if C < A%B < B:
        print("No")
        continue
    
    if D % B == 0:
        print("Yes")
        continue
    
    if D < B:
        print("No")
        continue
    
    if C+(math.gcd(B,D)) < B:
        print("No")
        continue
    
    print("Yes")
Problem p03362 (python)

Fixed submission:
import itertools as it
def erat():
    D = {9:3, 25:5}
    yield from [2, 3, 5]
    MASK = [1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0]
    MODULOS = (1, 7, 11, 13, 17, 19, 23, 29) 

    for q in it.compress(
            it.islice(it.count(7), 0, None, 2),
            it.cycle(MASK)):
        p = D.pop(q, None)
        if p is None:
            D[q*q] = q
            yield q
        else:
            x = q + 2*p
            while x in D or (x%30) not in MODULOS:
                x += 2*p
            D[x] = p


n = int(input())
l = 0
ans = []
for p in erat():
    if p % 5 == 1:
        ans.append(p)
        l += 1
        if l >= n:
            break
print(*ans)

Buggy submission (verdict: Runtime Error):
import itertools as it
def erat():
    D = {9:3, 25:5}
    yield from [2, 3, 5]
    MASK = [1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0]
    MODULOS = (1, 7, 11, 13, 17, 19, 23, 29) 

    for q in it.compress(
            it.islice(it.count(7), 0, None, 2),
            it.cycle(MASK)):
        p = D.pop(q, None)
        if p is None:
            D[q*q] = q
            yield q
        else:
            x = q + 2*p
            while x in D or (x%30) not in MODULOS:
                x += 2*p
            D[x] = p


n = int(input())
l = 0
ans = []
for k in erat():
    if k % 5 == 1:
        buf.append(k)
        l += 1
        if l >= n:
            break
print(*ans)
Problem p02613 (python)

Fixed submission:
n = int(input())
s = []
for i in range(n):
    s += [input()]
c0 = s.count("AC")
c1 = s.count("WA")
c2 = s.count("TLE")
c3 = s.count("RE")
print("AC x " + str(c0))
print("WA x " + str(c1))
print("TLE x " + str(c2))
print("RE x " + str(c3))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = []
for i in range(n):
    s += [input()]
c0 = s.count("AC")
c1 = s.count("WA")
c2 = s.count("TLE")
c3 = s.count("RE")
print("AC × " + str(c0))
print("WA × " + str(c1))
print("TLE × " + str(c2))
print("RE × " + str(c3))6
Problem p02641 (python)

Fixed submission:
import sys
x,n=map(int,input().split())
if n==0:
    print(x)
    sys.exit()
else:
    p=list(map(int,input().split()))
    res=1000
    ans=0
    for i in range(101,-101,-1):
        p.append(i)
        if len(p)==len(set(p)):
            if res>=abs(x-i):
                res=abs(x-i)
                ans=i
        del p[-1]
    print(ans)

Buggy submission (verdict: Runtime Error):
import sys
x,n=map(int,input().split())
if n==0:
    print(x)
    sys.exit()
else:
    p=list(map(int,input().split()))
    res=1000
    for i in range(1,101):
        p.append(i)
        if len(p)==len(set(p)):
            if res>=abs(x-i):
                res=abs(x-i)
                ans=i
        del p[-1]
    for i in range(n):
        if x+(x-ans)!=p[i]:
            print(x+(x-ans))
            sys.exit()
    print(ans)
Problem p02687 (python)

Fixed submission:
s=input()
if s=="ABC":
    print("ARC")
else:
    print("ABC")

Buggy submission (verdict: Runtime Error):
s=input()
if x=="ABC":
    print("ARC")
else:
    print("ABC")
Problem p02724 (python)

Fixed submission:
x=int(input())

coin_1=0
coin_5=0
coin_500=0

def registar(nyukin,coin):
    oturi=nyukin-coin*int(nyukin/coin)
    return oturi,int(nyukin/coin)

x,coin_500=registar(x,500)
#print(coin_500)
x,coin_5=registar(x,5)
x,coin_1=registar(x,1)

#print(coin_500,coin_5,coin_1)
uresisa=coin_500*1000+coin_5*5
print(uresisa)

Buggy submission (verdict: Runtime Error):
def registar(nyukin,coin):
    oturi=nyukin-coin*int(nyukin/coin)
    return oturi,int(nyukin/coin)

x,coin_500=registar(x,500)
#print(coin_500)
x,coin_5=registar(x,5)
x,coin_1=registar(x,1)

#print(coin_500,coin_5,coin_1)
uresisa=coin_500*1000+coin_5*5
print(uresisa)
Problem p02812 (python)

Fixed submission:
n=int(input())
s=input()
l=[]
for i in s:
    l.append(i)
#print(l)
count=0
for i in range(len(l)-2):
    if l[i]=="A" and l[i+1]=="B" and l[i+2]=="C":
            count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
l=[]
for i in s:
    l.append(i)
#print(l)
count=0
for i in range(len(l)):
    if l[i]=="A" and l[i+1]=="B" and l[i+2]=="C":
            count+=1
print(count)
Problem p02830 (python)

Fixed submission:
n=int(input())
S,T=map(str,input().split())

s=[]
t=[]
for i in S:
    s.append(i)
for i in T:
    t.append(i)
l=[]
for i in range(n):
    l.append(s[i])
    l.append(t[i])
t=""
for i in range(len(l)):
    t+=l[i]
print(t)

Buggy submission (verdict: Runtime Error):
s=[]
t=[]
for i in S:
    s.append(i)
for i in T:
    t.append(i)
l=[]
for i in range(n):
    l.append(s[i])
    l.append(t[i])
t=""
for i in range(len(l)):
    t+=l[i]
print(t)
Problem p03103 (python)

Fixed submission:
n,m=map(int,input().split())
drink=[list(map(int,input().split())) for i in range(n)]
#print(drink)

drink.sort()
#print(drink)
money=0
number=0
for i in range(n):
    if number+drink[i][1]<=m:
        money+=drink[i][0]*drink[i][1]
        number+=drink[i][1]
    elif m<number+drink[i][1]:
        money+=drink[i][0]*(m-number)
        number+=m-number
        break
    if m==number:
        break
print(money)

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

drink.sort()
#print(drink)
money=0
number=0
for i in range(n):
    if number+drink[i][0]=<m:
        money+=drink[i][0]*drink[i][1]
        number+=drink[i][1]
    elif m<number+drink[i][0]:
        money+=drink[i][0]*(m-number)
        number+=m-number
        break
    if m==number:
        break
print(money)
Problem p03239 (python)

Fixed submission:
n,time=(map(int,input().split()))
c=[]
t=[]
for i in range(n):
    C,T=map(int,input().split())
    c.append(C)
    t.append(T)
#print(c)
#print(t)
if min(t)>time:
    print("TLE")
else:
    for i in range(len(t)):
        if t[i]>time:
            c[i]=max(c)


    #print(c)
    if len(c)==1:
        print(c[0])
    elif len(c)==2:
        if c[0]>=c[1]:
            print(c[1])
        else:
            print(c[0])
    else:
        print(min(c))

Buggy submission (verdict: Runtime Error):
n,time=(map(int,input().split()))
c=[]
t=[]
for i in range(n):
    C,T=map(int,input().split())
    c.append(C)
    t.append(T)
#print(c)
#print(t)
if min(t)>time:
    print("TLE")
else:
    p=[]
    j=0
    for i in range(len(t)):
        if t[i]>time:
            p.append(i)
            j=i
            del c[i]
    #print(c)
    if len(c)==1:
        print(c[0])
    elif len(c)==2:
        if c[0]>=c[1]:
            print(c[1])
        else:
            print(c[0])
    else:
        print(min(c))

Buggy submission (verdict: Runtime Error):
n,time=(map(int,input().split()))
c=[]
t=[]
for i in range(n):
    C,T=map(int,input().split())
    c.append(C)
    t.append(T)
#print(c)
#print(t)
if min(t)>time:
    print("TLE")
else:
    p=[]
    j=0
    for i in range(len(t)):
        if t[i]>time:
            p.append(i)
            j=i
            del c[i]
    if len(p)==n-1:
        print(c[p[j]])
    print(min(c))

Buggy submission (verdict: Runtime Error):
n,time=(map(int,input().split()))
c=[]
t=[]
for i in range(n):
    C,T=map(int,input().split())
    c.append(C)
    t.append(T)
#print(c)
#print(t)
if min(t)>time:
    print("TLE")
else:
    p=[]
    for i in range(len(t)):
        if t[i]>time:
            p.append(i)
    if len(p)==n-1:
        print(c[p[0]])
    #print(p)
    for i in p:
        del t[i]
        del c[i]
    print(min(c))

Buggy submission (verdict: Runtime Error):
n,time=(map(int,input().split()))
c=[]
t=[]
for i in range(n):
    C,T=map(int,input().split())
    c.append(C)
    t.append(T)
#print(c)
#print(t)
if min(t)>time:
    print("TLE")
else:
    p=[]
    for i in range(len(t)):
        if t[i]>time:
            p.append(i)
    if len(p)==1:
        print(c[p[0]])
    #print(p)
    for i in p:
        del t[i]
        del c[i]
    print(min(c))

Buggy submission (verdict: Runtime Error):
n,time=(map(int,input().split()))
c=[]
t=[]
for i in range(n):
    C,T=map(int,input().split())
    c.append(C)
    t.append(T)
#print(c)
#print(t)
if min(t)>time:
    print("TLE")
else:
    p=[]
    for i in range(len(t)):
        if t[i]>time:
            p.append(i)
    #print(p)
    for i in p:
        del t[i]
        del c[i]
    print(min(c))
Problem p03282 (python)

Fixed submission:
s=input()
k=int(input())
flag=True
i=0
while flag:
    if i==len(s):
        break
    elif s[i]!="1":
        res=s[i]
        flag=False
    else:
        i+=1
if k>i:
    print(res)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
if s[0]=="1":
    print(s[1])
else:
    flag=True
    i=0
    while flag:
        if s[i]!=1:
            print(s[i])
            flag=False
        else:
            i+=1

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
if s[0]=="1":
    print(s[1])
else:
    print(s[0])
Problem p02646 (python)

Fixed submission:
def resolve():
    import sys
    input = sys.stdin.readline
    # 整数 1 つ
    # n = int(input())
    # 整数複数個
    a, v = map(int, input().split())
    b, w = map(int, input().split())
    t = int(input())
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    if v-w <= 0 or (v-w) * t < abs(a-b):
        print("NO")
    else:
        # if (v-w) * t < abs(a-b):
        #     print("NO")
        # else:
        print("YES")
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    import sys
    input = sys.stdin.readline
    # 整数 1 つ
    # n = int(input())
    # 整数複数個
    a, v = map(int, input().split())
    b, w = map(int, input().split())
    t = map(int, input().split())
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    if v-w <= 0:
        print("NO")
    else:
        if (v-w) * t < abs(a-b):
            print("NO")
        else:
            print("YES")


resolve()
Problem p02658 (python)

Fixed submission:
def resolve():
    import sys
    input = sys.stdin.readline
    # 整数 1 つ
    n = int(input())
    # 整数複数個
    # a, b = map(int, input().split())
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    A = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    A = sorted(A)
    cnt = 1
    flag = True
    for i in range(n):
        cnt *= A[i]
        #print(cnt)
        if cnt > 10**18:
            flag = False
            break

    if flag == True:
        print(cnt)
    else:
        print(-1)


resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    import sys
    input = sys.stdin.readline
    # 整数 1 つ
    n = int(input())
    # 整数複数個
    # a, b = map(int, input().split())
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    cnt = 1
    flag = True
    for i in range(n):
        cnt *= A[i]
        if cnt >= 10**18:
            flag = False
            break

    if flag == True:
        print(cnt)
    else:
        print(-1)


resolve()
Problem p03162 (python)

Fixed submission:
def resolve():
    import sys
    input = sys.stdin.readline
    # 整数 1 つ
    n = int(input())
    # 整数複数個
    # a, b = map(int, input().split())
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    A = [list(map(int, input().split())) for i in range(n)]

    Happy = [[0, 0, 0] for _ in range(n+1)]
    for i in range(1, n+1):
        for j in range(3):
            for k in range(3):
                if j != k:
                    Happy[i][j] = max(Happy[i][j], Happy[i-1][k] + A[i-1][j])

    print(max(Happy[n]))
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    import sys
    input = sys.stdin.readline
    # 整数 1 つ
    n = int(input())
    # 整数複数個
    # a, b = map(int, input().split())
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    A = [list(map(int, input().split())) for i in range(n)]

    Happy = [0, 0, 0] * (n+1)
    for i in range(1, n+1):
        for j in range(3):
            for k in range(3):
                if j != k:
                    Happy[i][j] = max(Happy[i][j], Happy[i-1][k] + A[i-1][j])

    print("n")


resolve()
Problem p03361 (python)

Fixed submission:
def resolve():
    # 整数 1 つ
    # n = int(input())
    # 整数複数個
    h, w = map(int, input().split())
    # 整数 N 個 (改行区切り)
    S = [list(input()) for i in range(h)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    flag = True
    for i in range(h):
        for j in range(w):
            if S[i][j] == ".":
                continue
            else:
                neighbor = False
                N = [[i-1, j], [i+1, j], [i, j-1], [i, j+1]]
                for s in N:
                    if s[0] >= 0 and s[0] <= h-1 and s[1] >= 0 and s[1] <= w-1:
                        if S[s[0]][s[1]] == "#":
                            neighbor = True
                            break
#                print(neighbor)
                if neighbor == False:
                    flag = False
                    break
        if flag == False:
            break

    if flag == False:
        print("No")
    else:
        print("Yes")


resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    # 整数 1 つ
    # n = int(input())
    # 整数複数個
    h, w = map(int, input().split())
    # 整数 N 個 (改行区切り)
    S = [list(input()) for i in range(h)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    flag = True
    for i in range(h):
        for j in range(w):
            if S[i][j] == ".":
                continue
            else:
                if S[i][j-1] == "." and S[i][j+1] == "." and S[i-1][j] == "." and S[i+1][j] == ".":
                    flag = False
                    break
        if flag == False
            break

    if flag == False:
        print("No")
    else:
        print("Yes")


resolve()
Problem p03370 (python)

Fixed submission:
def resolve():
    # 整数 1 つ
    # n = int(input())
    # 整数複数個
    n, x = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    M = [int(input()) for i in range(n)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    mmin = min(M)

    reall = x - sum(M)

    cnt = n + int(reall // mmin)

    print(cnt)


resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    # 整数 1 つ
    # n = int(input())
    # 整数複数個
    n, x = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    M = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    mmin = min(M)

    reall = x - sum(M)

    cnt = n + int(reall / mmin)
 #   for i in M:
 #       if reall >= i:
 #           cnt += 1


    print(cnt)


resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    # 整数 1 つ
    # n = int(input())
    # 整数複数個
    n, x = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    M = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    mmin = min(M)

    reall = x - sum(M)

    cnt = n + int(reall / mmin)
 #   for i in M:
 #       if reall >= i:
 #           cnt += 1


    print(cnt)
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    # 整数 1 つ
    # n = int(input())
    # 整数複数個
    n, x = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    M = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    mmin = min(M)

    reall = x - sum(M)

    cnt = n + reall / mmin
    for i in M:
        if reall >= i:
            cnt += 1


    print(cnt)


resolve()
Problem p03434 (python)

Fixed submission:
def resolve():
    # 整数 1 つ
    n = int(input())
    # 整数複数個
    # a, b, c = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    A = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    sumA=0
    sumB=0
    B = sorted(A, reverse=True)
    turnB = False

    for i in B:
        if turnB == False:
            sumA += i
            turnB = True
        else:
            sumB += i
            turnB = False

    print(int(sumA - sumB))


resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    # 整数 1 つ
    n = int(input())
    # 整数複数個
    # a, b, c = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    A = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    sumA=0
    sumB=0
    B = sorted(A, reverse=True)
    turnB = False

    for i in B:
        if turnB == False:
            sumA += i
            turnB = True
        else:
            sumB += i
            turnB = False

    print(int(sumA - SumB))


resolve()
Problem p03455 (python)

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

if a%2==0 or b%2==0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a, b = list(map(int, input().split()))
# 整数 N 個 (改行区切り)
#N = [int(input()) for i in range(N)]
# 整数 N 個 (スペース区切り)
#N = list(map(int, input().split()))
# 整数 (縦 H 横 W の行列)
#A = [list(map(int, input().split())) for i in range(H)]

if a % 2 == 1 and b % 2 == 1:
  print("Odd")
  else:
    print("Even")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
# 整数 N 個 (改行区切り)
#N = [int(input()) for i in range(N)]
# 整数 N 個 (スペース区切り)
#N = list(map(int, input().split()))
# 整数 (縦 H 横 W の行列)
#A = [list(map(int, input().split())) for i in range(H)]

if a % 2 == 1 and b % 2 == 1:
  print("Odd")
  else:
    print("Even")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
    # 整数 N 個 (改行区切り)
    #N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    #N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    #A = [list(map(int, input().split())) for i in range(H)]

    if a % 2 == 1 and b % 2 == 1:
        print("Odd")
    else:
        print("Even")
Problem p03469 (python)

Fixed submission:

def resolve():
    # 整数 1 つ
    n = input()
    # 整数複数個
    # a, b, c = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]
    m = n[:3] + "8" + n[4:]

    print(m)


resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    # 整数 1 つ
    n = str(input().rstrip())
    # 整数複数個
    # a, b, c = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]
    n[3] = "8"

    print(n)

resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    # 整数 1 つ
    n = str(input().rstrip())
    # 整数複数個
    # a, b, c = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]
    n[3] = "8"

    print(n, end="")


resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    # 整数 1 つ
    n = str(input().rstrip())
    # 整数複数個
    # a, b, c = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]
    n[3] = "8"

    print(n)


resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    # 整数 1 つ
    n = str(input())
    # 整数複数個
    # a, b, c = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]
    n[3] = "8"

    print(n)


resolve()
Problem p03471 (python)

Fixed submission:
def resolve():
    # 整数 1 つ
    # n = int(input())
    # 整数複数個
    n, y = map(int, input().split())
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    flag = False
    for i in range(n+1):
        for j in range(n-i+1):
            if (10000 * i) + (5000 * j) + (1000 * (n-i-j)) == y:
                print(i, j, (n-i-j))
                flag = True
                break
        if flag == True:
            break

    if flag == False:
        print("-1 -1 -1")
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    # 整数 1 つ
    # n = int(input())
    # 整数複数個
    n, y = map(int, input().split())
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    flag = False
    for i in range(n):
        for j in range(n-i):
            if (10000 * i) + (5000 * j) + (1000 * (n-i-j)) == y:
                print(i, j, (n-i-j))
                flag = True
                break
        if flag == True:
            break

    if flag == False
        print("-1 -1 -1")
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    # 整数 1 つ
    # n = int(input())
    # 整数複数個
    n, y = map(int, input().split())
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    flag = False
    for i in rage(n):
        for j in range(n - i):
            if y - (i * 10000) + (j * 5000) == 1000 * (n - i - j):
                print(i, j, (n-i-j))
                flag = True
                break
        if flag == True
            break

    if flag == False:
        print("-1 -1 -1")
resolve()