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

Fixed submission:
import heapq

x, y, z, k = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

a = sorted(a, key=lambda x: x * -1)
b = sorted(b, key=lambda x: x * -1)
c = sorted(c, key=lambda x: x * -1)

counter = 0
a_idx = 0
b_idx = 0
c_idx = 0
pque = []
heapq.heappush(pque, (-1 * (a[a_idx] + b[b_idx] + c[c_idx]), (a_idx, b_idx, c_idx)))

while counter < k:
    counter += 1
    output = heapq.heappop(pque)
    print(output[0] * -1)
    a_idx, b_idx, c_idx = output[1]
    if a_idx < len(a) - 1:
        current = a[a_idx + 1] + b[b_idx] + c[c_idx]
        cand = (a_idx + 1, b_idx, c_idx)
        if (-1 * current, cand) not in pque:
            heapq.heappush(pque, (-1 * current, cand))
    if b_idx < len(b) - 1:
        current = a[a_idx] + b[b_idx + 1] + c[c_idx]
        cand = (a_idx, b_idx + 1, c_idx)
        if (-1 * current, cand) not in pque:
            heapq.heappush(pque, (-1 * current, cand))
    if c_idx < len(c) - 1:
        current = a[a_idx] + b[b_idx] + c[c_idx + 1]
        cand = (a_idx, b_idx, c_idx + 1)
        if (-1 * current, cand) not in pque:
            heapq.heappush(pque, (-1 * current, cand))

Buggy submission (verdict: Runtime Error):
x, y, z, k = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

a.reverse()
b.reverse()
c.reverse()

counter = 0
a_idx = 0
b_idx = 0
c_idx = 0
while counter < k:
    print(a[a_idx] + b[b_idx] + b[b_idx])
    counter += 1

    a_diff = -1
    b_diff = -1
    c_diff = -1
    diff = []
    if a_idx < len(a) - 1:
        a_diff = a[a_idx] - a[a_idx + 1]
        diff.append(a_diff)
    if b_idx < len(b) - 1:
        b_diff = b[b_idx] - b[b_idx + 1]
        diff.append(b_diff)
    if c_idx < len(c) - 1:
        c_diff = c[c_idx] - c[c_idx + 1]
        diff.append(c_diff)
    min_diff = min(diff)

    for i, d in enumerate([a_diff, b_diff, c_diff]):
        if d == min_diff:
            if i == 0:
                a_idx += 1
            elif i == 1:
                b_idx += 1
            else:
                c_idx += 1
Problem p03059 (python)

Fixed submission:
import sys 
A, B, T = list(map(int, sys.stdin.readline().strip().split()))
print(T // A * B)

Buggy submission (verdict: Runtime Error):
A, B, T = int(sys.stdin.readline().strip())
return T // A * B
Problem p03059 (python)

Fixed submission:
a, b, t = [int(x) for x in input().split(" ")]

print(b * int(t / a))

Buggy submission (verdict: Runtime Error):
import numpy as np

def gcd_(a, b):
    a_ = max(a, b)
    b_ = min(a, b)

    while True:
        if a_ % b_ == 0:
            return b_
        a_, b_ = b_, a_ % b_

_ = input()
a = np.array([int(x) for x in input().split(" ")])

if len(a) == 2:
    print(gcd_(*a))
    exit()

list = [gcd_(a[2], a[1]), gcd_(a[0], a[2]), gcd_(a[0], a[1])]
gcd = np.max(list)
bad_num = a[np.argmax(list)]

for i in range(3, len(a)):
    if a[i] % gcd == 0:
        continue
    else:
        newgcd = gcd_(a[i], gcd)
        oldgcd = gcd_(bad_num, gcd)

        if newgcd > oldgcd:
            gcd = newgcd
        else:
            gcd = oldgcd
            bad_num = a[i]


print(int(gcd))
Problem p03074 (python)

Fixed submission:
import numpy as np

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

zero_list = np.array([len(x) for x in s.split("1") if len(x) > 0])
one_list = np.array([len(x) for x in s.split("0") if len(x) > 0])

if k >= len(zero_list):
    print(len(s))
else:
    max_num = 0

    if len(zero_list) < len(one_list):
        for i in range(len(zero_list) - k + 1):
            tmp = zero_list[i:i+k].sum() + one_list[i:i+k+1].sum()
            if tmp > max_num:
                max_num = tmp
    else:
        if len(zero_list) == len(one_list) and int(s[0]) == 1:
            zero_list = np.insert(zero_list, 0, 0)
        max_num = zero_list[:k].sum() + one_list[:k].sum()
        for i in range(len(one_list) - k):
            tmp = zero_list[i+1:i+k+1].sum() + one_list[i:i+k+1].sum()
            if tmp > max_num:
                max_num = tmp
        tmp = zero_list[-k:].sum() + one_list[-k:].sum()
        if tmp > max_num:
            max_num = tmp

    print(max_num)

Buggy submission (verdict: Runtime Error):
import numpy as np

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

zero_list = np.array([len(x) for x in s.split("1") if len(x) > 0])
one_list = np.array([len(x) for x in s.split("0") if len(x) > 0])

if k >= len(zero_list):
    print(len(s))
else:
    max_num = 0

    if len(zero_list) < len(one_list):
        for i in range(len(zero_list) - k + 1):
            tmp = zero_list[i:i+k].sum() + one_list[i:i+k+1].sum()
            if tmp > max_num:
                max_num = tmp
    else:
        if len(zero_list) == len(one_list) and int(s[0]) == 1:
            zero_list = np.array([0, *zero_list])
        max_num = zero_list[:k].sum() + one_list[:k].sum()
        for i in range(len(one_list) - k):
            tmp = zero_list[i+1:i+k+1].sum() + one_list[i:i+k+1].sum()
            if tmp > max_num:
                max_num = tmp
        tmp = zero_list[-k:].sum() + one_list[-k:].sum()
        if tmp > max_num:
            max_num = tmp

    print(max_num)
Problem p03160 (python)

Fixed submission:
N = int(raw_input())
nums = list(map(int,raw_input().split()))
dp = [10000000000 for x in range(N)]
dp[0] = 0
for i in range(N):
    if i<N-1:
        dp[i+1] = min(dp[i+1],dp[i]+abs(nums[i+1]-nums[i]))
    if i<N-2:
        dp[i+2] = min(dp[i+2],dp[i]+abs(nums[i+2]-nums[i]))
print dp[N-1]

Buggy submission (verdict: Runtime Error):
import sys
raw_input = sys.stdin.readline
N,K = map(int,raw_input().split())
nums = list(map(int,raw_input().split()))
dp = [10000000000 for x in range(N)]
dp[0] = 0
for i in range(N):
    for j in range(K):
        if i+j+1 < N:
            dp[i+j+1] = min(dp[i]+abs(nums[i]-nums[i+j+1]),dp[i+j+1])
print dp[N-1]
Problem p03059 (python)

Fixed submission:
n = input().split()
ans = int( (int(n[2]) + 0.5) / int(n[0])) * int(n[1])
print(ans)

Buggy submission (verdict: Runtime Error):
n = input().split()
ans = int( int(n[2]+0.5) / n[1]   ) * n[1]
print(ans)

Buggy submission (verdict: Runtime Error):
n = input().split()
print(int((n[2] + 0.5 ) / n[0]) * n[1])
Problem p03059 (python)

Fixed submission:
a,b,t=map(int,input().split())
ans=t//a*b
print(ans)

Buggy submission (verdict: Runtime Error):
#include <iostream>
using namespace std;

int main()
{
    int a,b,t;

    cin >> a >> b >> t;

    cout << t/a*b;

    return 0;
}
Problem p03071 (python)

Fixed submission:
ipt=input()
lst=ipt.split()
A=int(lst[0])
B=int(lst[1])
if A>=B and A-1>=B:
    print(A+A-1)
elif A>=B and A-1<B:
    print(A+B)
elif A<B and A<B-1:
    print(B+B-1)
else:
    print(A+B)

Buggy submission (verdict: Runtime Error):
ipt=input()
lst=ipt.split()
A=lst[0]
B=lst[1]
if A>=B and A-1>=B:
    print(A+A-1)
elif A>=B and A-1<B:
    print(A+B)
elif A<B and A<B-1:
    print(B+B-1)
else:
    print(A+B)

Buggy submission (verdict: Runtime Error):
a=A
b=B
if a>=b and a-1>=b:
	print(a+a-1)
elif a>=b and a-1<b:
	print(a+b)
elif a<b and a<b-1:
	print(b+b-1)
else:
	print(a+b)

Buggy submission (verdict: Runtime Error):
if A>=B and A-1>=B:
	print(A+A-1)
elif A>=B and A-1<B:
	print(A+B)
elif A<B and A<B-1:
	print(B+B-1)
else:
	print(A+B)

Buggy submission (verdict: Runtime Error):
if A>=B and A-1>=B:
  print(A+A-1)
 	elif A>=B and A-1<B:
      print(A+B)
  	elif A<B and A<B-1:
      print(B+B-1)
    else:
      print(A+B)
Problem p03076 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if a%10==0:
    a_q=a
else:
    a_q=(a//10+1)*10
if b%10==0:
    b_q=b
else:
    b_q=(b//10+1)*10
if c%10==0:
    c_q=c
else:
    c_q=(c//10+1)*10
if d%10==0:
    d_q=d
else:
    d_q=(d//10+1)*10
if e%10==0:
    e_q=e
else:
    e_q=(e//10+1)*10

r=[i for i in [a%10,b%10,c%10,d%10,e%10]  if i%10!=0]
if r==[]:
    r_min=10
else:
    r_min=min(r)

ans=a_q+b_q+c_q+d_q+e_q-10+r_min
print(ans)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if a%10==0:
    a_q=a
else:
    a_q=(a//10+1)*10
if b%10==0:
    b_q=b
else:
    b_q=(b//10+1)*10
if c%10==0:
    c_q=c
else:
    c_q=(c//10+1)*10
if d%10==0:
    d_q=d
else:
    d_q=(d//10+1)*10
if e%10==0:
    e_q=e
else:
    e_q=(e//10+1)*10

r=[i for i in [a%10,b%10,c%10,d%10,e%10]  if i%10!=0]
r_min=min(r)

ans=a_q+b_q+c_q+d_q+e_q-10+r_min
print(ans)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if a%10==0:
    a_q=a
else:
    a_q=(a//10+1)*10
if b%10==0:
    b_q=b
else:
    b_q=(b//10+1)*10
if c%10==0:
    c_q=c
else:
    c_q=(c//10+1)*10
if d%10==0:
    d_q=d
else:
    d_q=(d//10+1)*10
if e%10==0:
    e_q=e
else:
    e_q=(e//10+1)*10

r=[i for i in [a%10,b%10,c%10,d%10,e%10]  if i%10!=0]
r_min=min(r)

ans=a_q+b_q+c_q+d_q+e_q-10+r_min
print(ans)
Problem p03085 (python)

Fixed submission:
b=input()
if b=="A":
  print("T")
elif b=="T":
  print("A")
elif b=="C":
  print("G")
else:
  print("C")

Buggy submission (verdict: Runtime Error):
b=input()
if b="A":
  print("T")
elif b="T":
  print("A")
elif b="C":
  print("G")
else:
  print("C")
Problem p03145 (python)

Fixed submission:
ABClist=input().split()
AB=int(ABClist[0])
BC=int(ABClist[1])
ans=int(AB*BC/2)
print(ans)

Buggy submission (verdict: Runtime Error):
s=int(input())
a=[s]
for i in range(500):
    if a[i]%2==0:
        a.append(a[i]//2)
    else:
        a.append(a[i]*3+1)
ans=a.index(4)+4
if s==1 or s==2:
    print(4)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
s=int(input())
a=[s]
for i in range(500):
    if a[i]%2==0:
        a.append(a[i]//2)
    else:
        a.append(a[i]*3+1)
ans=a.index(4)+4
if s==1 or s==2:
    print(4)
else:
    print(ans)
Problem p03146 (python)

Fixed submission:
s=int(input())
a=[s]
for i in range(500):
    if a[i]%2==0:
        a.append(a[i]//2)
    else:
        a.append(a[i]*3+1)
if s==1 or s==2:
    print(4)
else:
    print(a.index(4)+4)

Buggy submission (verdict: Runtime Error):
s=int(input())
a=[s]
for i in range(500):
    if a[i]%2==0:
        a.append(a[i]//2)
    else:
        a.append(a[i]*3+1)
        ans=a.index(4)+4
if s==1 or s==2:
    print(4)
else:
    print(ans)
Problem p03477 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
if a+b>c+d:
    print("Left")
elif a+b==c+d:
    print("Balanced")
else:
    print("Right")

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if a+b>c+d:
    print("Left")
elif a+b=c+d:
    print("Balanced")
else:
    print("Right")
Problem p03485 (python)

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

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

Fixed submission:
abc=input()
a=int(abc[0])
b=int(abc[1])
c=int(abc[2])
ans=0
if a==1:
    ans+=1
if b==1:
    ans+=1
if c==1:
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
ans=0
if a==1:
    ans+=1
if b==1:
    ans+=1
if c==1:
    ans+=1
print(ans)
Problem p03494 (python)

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

ans=0
for i in range(30):
    a=[a[j]/2 for j in range(n) if a[j]%2==0]
    ans+=1
    if len(a)!=n:
        break

print(ans-1)

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

ans_list=[]
for j in range(n):
    m=0
    while a[j]%2==0:
        m+=1
        a[j]=a[j]//2
    ans_list.append(m)
ans_list.sort()
print(ans_list[0])
Problem p03605 (python)

Fixed submission:
n=int(input())
if n>=90 or n==9 or n==19 or n==29 or n==39 or n==49 or n==59 or n==69 or n==79 or n==89:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
if n>=90 or n=9 or n=19 or n=29 or n=39 or n=49 or n=59 or n=69 or n=79 or n=89:
    print("Yes")
else:
    print("No")
Problem p03671 (python)

Fixed submission:
a,b,c=map(int,input().split())
maxim=max(a,b,c)
ans=a+b+c-maxim
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a<=b and b<=c:
    ans=a+b
elif a<=b and c<=b:
    ans=a+c
elif b<=a and c<=b:
    ans=b+c
print(ans)
Problem p03760 (python)

Fixed submission:
o=input()
e=input()
ans=""
if len(o)==len(e):
    for i in range(len(e)):
        ans+=o[i]+e[i]
else:
    for j in range(len(e)):
        ans+=o[j]+e[j]
    ans+=o[-1]
print(ans)

Buggy submission (verdict: Runtime Error):
o=input()
e=input()
ans=""
if len(o)==len(e):
    for i in range(len(e)):
        ans+=o[i]+e[i]
else:
    for j in range(len(e)):
        ans+=o[i]+e[i]
    ans+=o[-1]
print(ans)
Problem p03059 (python)

Fixed submission:
A,B,T=map(int,input().split(" "))
ans=T//A*B
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
V=[int(i) for i in input().split()]
C=[int(i) for i in input().split()]
n=0
for j in range(N):
   k=V[j]-C[j]
   if k>0:
      n+=k
print(n)

Buggy submission (verdict: Runtime Error):
N=int(input())
V=[int(i) for i in input().split()]
C=[int(i) for i in input().split()]
n=0
for j in range(N):
 k=V[j]-C[j]
 if k>0:
   n+=k
print(n)
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):
A, B = map(int, input().split())
if b%a == 0:
    print(A+B)
else:
    print(B-A)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if b%a == 0:
    print(A+B)
else:
    print(B-A)
Problem p03293 (python)

Fixed submission:
s, t = input(), input()
for i in range(len(s)):
    if t == s[len(s)-i:]+s[:len(s)-i]:
        print('Yes')
        break
else:
    print('No')

Buggy submission (verdict: Runtime Error):
s, t = input(), input()
for i in range(len(s)):
    if t = s[len(t)-i:]+s[i:len(t)-i]:
        print('Yes')
        break
else:
    print('No')
Problem p03316 (python)

Fixed submission:
Nstr = input()
SN = 0
for i in Nstr:
    SN += int(i)
if int(Nstr) % SN == 0:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
Nstr = input()
SN = 0
for i in N:
    SN += int(i)
if int(N) % SN == 0:
    print('Yes')
else:
    print('No')
Problem p03328 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
print(sum(range(b-a)-a))

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
print(sum(range(b-a)-a)
Problem p03456 (python)

Fixed submission:
abstr = input().split()
ab = abstr[0]+abstr[1]

for i in range(400):
    if i**2==int(ab):
        print('Yes')
        break

else:
    print('No')

Buggy submission (verdict: Runtime Error):
abstr = input().split()
ab = int(abstr[0]+abstr[1])

for i in range(400):
    if i**==ab:
        print('Yes')

else:
    print('No')
Problem p03548 (python)

Fixed submission:
X, Y, Z = map(int, input().split())
ans = 1
length = Y+2*Z
while True:
    if length+Y+Z > X:
        print(ans)
        break
    ans += 1
    length += Y+Z

Buggy submission (verdict: Runtime Error):
X, Y, Z = map(int, input().split())
ans = 1
length = Y+2Z
while True:
    if length > X:
        print(ans)
        break
    ans += 1
    length += Y+Z

Buggy submission (verdict: Runtime Error):
X, Y, Z = map(int, input().split())
ans = 1
length = Y+2Z
while True:
    if length > X:
        print(ans)
        break
    count += 1
    length += Y+Z
Problem p03624 (python)

Fixed submission:
S = input()
abc = [chr(i) for i in range(97,97+26)]
for i in S:
    if i in abc:
        abc.remove(i)
if abc == []:
    print('None')
else:
    print(abc[0])

Buggy submission (verdict: Runtime Error):
S = input()
abc = [chr(i) for i in range(97,97+26)]
for i in S:
    if i in abc:
        abc.remove(i)
if S == []:
    print('None')
else:
    print(abc[0])
Problem p03636 (python)

Fixed submission:
s = input()
print(s[0]+str(len(s)-2)+s[-1])

Buggy submission (verdict: Runtime Error):
s = input()
print(a[0]+str(len(s)-2)+a[-1])
Problem p03673 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
f, r = [], []
for i in range(n):
    if i%2==0:
        f.append(a[i])
    else:
        r.append(a[i])
ans = r[::-1] + f      
if n%2==0:
    print(*ans)
else:
    print(*ans[::-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
f, r = [], []
for i in range(n):
    if i%2==0:
        f.append(a[i])
    else:
        r.append(a[i])
        
if n%2==0:
    print(*r[::-1], *f)
else:
    print(*f[::-1], *r)
Problem p03680 (python)

Fixed submission:
N = int(input())
a = [int(input()) for i in range(N)]
ans = 0
turn = 1
while True:
    if a[turn-1] == 2:
        ans += 1
        break
    if a[turn-1] == 0:
        ans = -1
        break
    next_turn = a[turn-1]
    a[turn-1] = 0
    ans += 1
    turn = next_turn

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
hist = []
for i in range(N):
    a.append(int(input()))
pos = 1
count = 0
while True:
    if pos == 2:
        print(count)
        break
    if pos in hist:
        print(-1)
        break
    hist.append(pos)
    pos = a[pos-1]
    count += 1

Buggy submission (verdict: Runtime Error):
N = int(input())
a = []
hist = []
for i in range(N):
    a.appnd(int(input()))
pos = 0
count = 0
while True:
    if pos+1 in hist:
        print(-1)
        break
    hist.append(a[pos])
    pos = a[pos]-1
    count += 1
    if pos == 1:
        print(count)
        break

Buggy submission (verdict: Runtime Error):
N = int(input())
a = []
hist = []
for i in range(N):
    a.appnd(int(input()))
pos = 0
count = 0
while True:
    if pos+1 in hist:
        print(-1)
        break
    hist.append(a[pos])
    pos = a[pos]-1
    count += 1
    if pos = 1:
        print(count)
        break
Problem p03702 (python)

Fixed submission:
N, A, B = map(int, input().split())
src = [int(input()) for i in range(N)]

def enough(n):
    bomb = 0
    for h in src:
        if h <= B*n: continue
        h -= B*n
        bomb += (h-1)//(A-B) + 1
        if bomb > n: return False
    return True

#ok/ng: 中点が十分に大きいかどうか
ng = 0
ok = 10**9
while ok - ng > 1:
    m = (ok+ng) // 2
    if enough(m):
        ok = m
    else:
        ng = m
print(ok)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
src = [int(input()) for i in range(N)]

def enough(n):
    bomb = 0
    for h in src:
        if h <= B*n: continue
            h -= B*n
            bomb -= (h+1)//(A-B) + 1
            if bomb > n: return False
        return True

#ok/ng: 中点が十分かどうか
ng = 0
ok = 10**9
while ok - ng > 1:
    m = (ok+ng) // 2
    if enough(m):
        ok = m
    else:
        ng = m
print(ok)
Problem p03711 (python)

Fixed submission:
a = [0,2,0,1,0,1,0,0,1,0,1,0]
x, y = map(int, input().split())

if a[x-1]==a[y-1]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a = set([1, 3, 5, 7, 8, 10, 12])
b = set([4, 6, 9, 11])
c = set([2])
xy = list(map(int, input().split()))
if xy in a or xy in b or xy in c:
    print('Yes')
else:
    print('No')
Problem p03729 (python)

Fixed submission:
A, B, C = map(str, input().split())
if A[-1]==B[0] and B[-1]==C[0]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
if A[-1]==B[0] and B[-1]==C[0]:
    print("YES")
else:
    print("NO")
Problem p03759 (python)

Fixed submission:
a, b, c = map(int, input().split())
if a-b == b-c:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
a, b c = map(int, input().split())
if a-b == b-c:
    print('YES')
else:
    print('NO')
Problem p03844 (python)

Fixed submission:
a = input().split()
if a[1] == '+':
    print(int(a[0])+int(a[2]))
else:
    print(int(a[0])-int(a[2]))

Buggy submission (verdict: Runtime Error):
a = input().split()
if s[1] == '+':
    print(int(a[0])+int(a[2]))
else:
    print(int(a[0])-int(a[2]))

Buggy submission (verdict: Runtime Error):
a = input().split()
if s[1] = '+':
    print(int(a[0])+int(a[2]))
else:
    print(int(a[0])-int(a[2]))
Problem p03861 (python)

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

Buggy submission (verdict: Runtime Error):
a, b, x = map(init, input().split())
print(b//x-(a-1)//x)
Problem p03919 (python)

Fixed submission:
import string
H, W = map(int, input().split())
a = []
for i in range(H):
    a.append(input().split())

for i in range(H):
    for j in range(W):
        if a[i][j] == 'snuke':
            print(string.ascii_uppercase[j]+str(i+1))
            break

Buggy submission (verdict: Runtime Error):
import string
def inpl(): return list(map(int, input().split()))
H, W = inpl()
a = []
for i in range(H):
    a.append(inpl())

for i in range(H):
    for j in range(W):
        if a[i][j] == 'snuke':
            print(string.ascii_lowercase[j]+str(i+1))
            break
Problem p03958 (python)

Fixed submission:
def inpl(): return list(map(int, input().split()))
K, T = inpl()
a = inpl()
print(max(max(a)*2-K-1, 0))

Buggy submission (verdict: Runtime Error):
def inpl(): return list(map(int, input().split()))
K, T = inpl()
a = inpl()
print(max(max(a)*2-n-1, 0))
Problem p03966 (python)

Fixed submission:
n = int(input())
t = []
a = []
for i in range(n):
    c = list(map(int,input().split()))
    t.append(c[0])
    a.append(c[1])
for i in range(n-1):
    d = max(1,-(-t[i]//t[i+1]),-(-a[i]//a[i+1]))
    t[i+1] =t[i+1]*d
    a[i+1] =a[i+1]*d
print(t[-1]+a[-1])

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
ans = 2
tp, ap = 0, 0
for i in range(N):#ans以上での比からの最小値でans更新,
    #A+Tのn倍、ただしn>=ans/(t+a)
    t, a = map(int, input().split())
    k = max(math.ceil(tp/t), math.ceil(ap/a))
    t, a = t*k, a*k
    c = math.ceil(ans/(t+a))
    while True:#ansが前回のans以上になるようにする
        if (t+a)*c >= ans:
            ans = (t+a)*c
            break
        c += 1
    tp, ap = t*c, a*c
print(ans)
Problem p03998 (python)

Fixed submission:
card = ["a","b","c"]
S = dict()
for i in card:
    S[i] = input()

turn = "a"
while True:
    if len(S[turn])==0:
        print(turn.upper())
        break
    else:
        next_turn = S[turn][0]
        S[turn] = S[turn][1:]
        turn = next_turn

Buggy submission (verdict: Runtime Error):
d = {a:input(), b:input(), c:input()}
temp = 'a'
while True:
    if d[temp] == '':
        break
    d[temp] = d[temp][1:]
    temp = d[temp][0]
print(temp)
Problem p04001 (python)

Fixed submission:
def plus_or_through(s):
    if len(s) <= 1:
        return eval(s[0])
    return plus_or_through([s[0]+s[1]]+s[2:]) + plus_or_through([s[0]+'+'+s[1]]+s[2:])
print(plus_or_through(list(input())))

Buggy submission (verdict: Runtime Error):
def pt(s: list):
    if len(s) = 1:
        return eval(s[0])
    return pt([s[0]+s[1]]+s[2:]) + pt([s[0]+'+'+s[1]]+s[2:])
print(pt(list((input()))))

Buggy submission (verdict: Runtime Error):
def search(s):
    if len(s) <= 1:
        return eval(s[0])
    return search([s[0]+s[1]]+s[2:]) + search([s[0]+'+'+s[1]]+s[2:])
print(search(input()))
Problem p04025 (python)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
cost = 100000000
for i in range(-100, 101):
    temp = 0
    for a_i in a:
        temp += (a_i-i)**2
    cost = min(cost, temp)
print(cost)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
a = list(map(int, input().split()))
cost = math.inf
for i in range(-100, 101):
    temp = 0
    for a_i in a:
        temp += (a_i-i)**2
    cost = min(cost, temp)
print(cost)
Problem p03059 (python)

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

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

s = O
for i in range(N) :
    if V[i] > C[i]:
        s +=V[i] - C[i]
    
print(s)