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

Fixed submission:
import collections
N = int(input())
A = list(map(int,input().split(" ")))
Q = int(input())
B = [list(map(int,input().split(" "))) for i in range(0,Q)]
ans = sum(A)
num = collections.Counter(A)
for i in range(0,Q):
    before, after = B[i][0], B[i][1]
    ans += num[before] * (after - before)
    num[after] += num[before]
    num[before] = 0
    print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = np.array(list(map(int,input().split(" "))))
Q = int(input())
B = [list(map(int,input().split(" "))) for i in range(0,Q)]

for i in range(0,Q):
    index = [j for j, x in enumerate(A) if x == B[i][0]]
    A[index] = B[i][1]
    print(sum(A))
#print("\n".join(list(map(str,A.tolist()))))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = np.array(list(map(int,input().split(" "))))
Q = int(input())
B = [list(map(int,input().split(" "))) for i in range(0,Q)]

for i in range(0,Q):
    index = [j for j, x in enumerate(A) if x == B[i][0]]
    A[index] = B[i][1]
    print(np.sum(A))
#print("\n".join(list(map(str,A.tolist()))))
Problem p02696 (python)

Fixed submission:
A, B, N = map(int, input().split(" "))
ans = 0
x = min(B-1,N)
floor = int(A*x/B) - A * int(x/B)
print(floor)

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

ans = 0
count = 0
num = int(N / B)
array = list(range(N, B * num - 1,-1))
# array2 = list(i for i in range(B * num, -1, -B))
# array.extend(array2)
# print(array)
for x in array:
#     print(x)
    if count > 1000000:
        break
    xb = x / B
    if xb < 1 and ans != 0:
        count += 1
#         print("continue")
        continue
    floor = int(A*xb) - A * int(xb)
    if ans < floor:
#         print(x)
#         print(x,count)
        count = 0
        ans = floor
    count += 1
print(ans)

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

ans = 0
count = 0
num = int(N / B)
array = list(range(N, B * num,-1))
array.append(i for i in range(B * num, -1, -B))
# print(array
for x in range(N,0,-1):
    if count > 1000000:
        break
    xb = x / B
    if xb < 1 and ans != 0:
        count += 1
#         print("continue")
        continue
    floor = int(A*xb) - A * int(xb)
    if ans < floor:
#         print(x)
#         print(x,count)
        count = 0
        ans = floor
    count += 1
print(ans)

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

ans = 0
count = 0
num = int(N / B)
array = list(range(N, B * num,-1))
array.append(i for i in range(B * num, -1, -B))
# print(array
for x in range(N,0,-1):
    if count > 1000000:
        break
    xb = x / B
    if xb < 1 and ans != 0:
        count += 1
#         print("continue")
        continue
    floor = int(A*xb) - A * int(xb)
    if ans < floor:
#         print(x)
#         print(x,count)
        count = 0
        ans = floor
    count += 1
print(ans)
Problem p02742 (python)

Fixed submission:
h,w = map(int , input().split(" "))

if h == 1 or w == 1:
    a = 1
elif h % 2 == 0:
    a = int(h * w / 2)
else:
    a = int(w * (h+1)/2) - int(w/2)

print(a)

Buggy submission (verdict: Runtime Error):
h,w = map(int , input().split(" "))

if h == 1 or w == 1;
    a = 1
elif h % 2 == 0:
    a = int(h * w / 2)
else:
    a = int(w * (h+1)/2) - int(w/2)

print(a)
Problem p02743 (python)

Fixed submission:
import math

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

d = c - a - b

if d > 0 and d**2 > 4*a*b:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import math

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

d = c - a - b

if d > 0 && d**2 > 4*a*b:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
if a + b + 2 * math.sqrt(a*b) < c:
    print('Yes')
else:
    print('No')
Problem p02732 (python)

Fixed submission:
from collections import Counter
import math

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

c = Counter(A)

all_ans = 0
for n in c.values():
    if n <= 1:
        continue
    all_ans += math.factorial(n)//(math.factorial(n-2)*math.factorial(2))

for n in A:
    print(all_ans - (c[n]-1))

Buggy submission (verdict: Runtime Error):
from collections import Collection
import math

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

c = Collection(A)

all_ans = 0
for n in c.values():
    if n <= 1:
        continue
    all_ans += math.factorial(n)//(math.factorial(n-2)*math.factorial(2))

for n in A:
    print(all_ans - (c[n]-1))
Problem p02947 (python)

Fixed submission:
N = int(input())

s = ["".join(sorted(input())) for i in range(N)]

count = 0
d = {}
for elm in s:
    if elm in d:
        count += d[elm]
        d[elm] += 1
    else:
        d[elm] = 1

print(count)

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

int main(void) {
    int N;
    cin >> N;
    
    vector<string> v;
    string s;
    for(int i=0; i<N; i++) {
        cin >> s;
        v.push_back(s);
    }

    for(int i=0; i<v.size(); i++) {
        sort(v[i].begin(), v[i].end());
    }

    int result = 0;
    for(int i=0; i<v.size(); i++) {
        result += count(v.begin()+i, v.end(), v[i]) - 1;
    }
    
    cout << result << endl;
    
    return 0;
}

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

int main(void) {
    int N;
    cin >> N;
    
    vector<string> v;
    string s;
    for(int i=0; i<N; i++) {
        cin >> s;
        v.push_back(s);
    }

    for(int i=0; i<v.size(); i++) {
        sort(v[i].begin(), v[i].end());
    }

    int result = 0;
    for(int i=0; i<v.size(); i++) {
        result += count(v.begin()+i, v.end(), v[i]);
    }
    
    cout << result << endl;
    
    return 0;
}
Problem p03337 (python)

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

Buggy submission (verdict: Runtime Error):
from collections import Counter
N = int(input())
S = input()

count = N
for i in range(N):
    c = 0
    for s1 in S[i:]:
        c += 0 if s1 == 'W' else 1
    for s2 in S[:i]:
        c += 0 if s2 == 'E' else 1
    count = c if c < count else count
    if count == 1:
        break

print(count)
Problem p02576 (python)

Fixed submission:
n,x,t = map(int, input().split())
q,m = divmod(n,x)
if m > 0:
    q += 1
print(q * t)

Buggy submission (verdict: Runtime Error):
h,w,m = map(int, input().split())
mp =  [[0 for i in range(h)] for j in range(w)]
for i in range(m):
  l =list(map(int, input().split()))
  mp[l[1]-1][l[0]-1] = 1
mx = 0
for y in range(w):
  for x in range(h):
    cn = 0
    #X軸について
    for xx in range(h):
      cn += mp[y][xx]
    #Y軸について
    for yy in range(w):
      if yy != y:
        cn += mp[yy][x]
    if cn > mx:
      mx = cn
print(mx)
Problem p02582 (python)

Fixed submission:
s = input()
if s == 'RRR':
    print(3)
elif s == 'RRS' or s == 'SRR':
    print(2)
elif s == 'SSS':
    print(0)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
s = input()
cnt = 0
ans = []
for i in s:
    if i == 'R':
        cnt += 1
    else:
        ans.append(cnt)
        cnt = 0
print(max(ans))
Problem p03086 (python)

Fixed submission:
s = input()
ans = 0
ACGT = {"A", "C", "G", "T"}
for i in range(len(s)):
    for j in range(i + 1, len(s) + 1):
        if set(s[i:j]) <= ACGT:
            ans = max(ans, len(s[i:j]))
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
cnt = 0
ACGT = {"A", "C", "G", "T"}
ANS = []
for i in s:
    if i in ACGT:
        cnt += 1
    elif i not in ACGT:
        ANS.append(cnt)
        cnt = 0
print(max(ANS))
Problem p03331 (python)

Fixed submission:
n = int(input())
SMs = []
for i in range(2, n // 2 + 2):
    SMs.append(sum(list(map(int, str(i)))) + sum(list(map(int, str(n-i)))))
print(min(SMs))

Buggy submission (verdict: Runtime Error):
n = int(input())
SMs = []
for i in range(2, n // 2 + 1):
    SMs.append(sum(list(map(int, str(i)))) + sum(list(map(int, str(n-i)))))
print(min(SMs))
Problem p03339 (python)

Fixed submission:
N = int(input())
S = input()
hdg = S[1:N].count('E')
hdg_chgd = hdg
hdg_chg_nrs =[]
for i in range(1,N):
    if S[i] == 'E':
        hdg_chgd -= 1
    if S[i-1] == 'W':
        hdg_chgd += 1
    hdg_chg_nrs.append(hdg_chgd)
hdg_chgd_f = min(hdg_chg_nrs)
print(min(hdg, hdg_chgd_f))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
hdg = S[1:N].count('E')
for i in range(1,N):
    if S[i] = 'E':
        hdg_chgd -= 1
    if S[i-1] = 'W':
        hdg_chgd += 1
print(min(hdg, hdg_chgd))
Problem p03455 (python)

Fixed submission:
num_list = list(map(int, input().split()))
if (num_list[0] * num_list[1]) % 2 == 1:
    print('Odd')
else:
    print('Even')

Buggy submission (verdict: Runtime Error):
N = int(input())
tm_pos = [list(map(int, input().split())) for i in range(N)]
for i in tm_pos:
    if i[0] < i[1] + i[2] or i[0] % 2 != (i[1] + i[2]) % 2:
        print('No')
        exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
plcs = [list(map(int,input().split())) for _ in range(n)]
A = [0, 0, 0]
for i in range(n):
    A = [plcs[i][j] - A[j] for j in range(3)]
    if A[0] >= A[1] + A[2] and A[0] % 2 == (abs(A[1]) + abs(A[2])) % 2:
        continue
    else:
        print('No')
        exit()
print('Yes')
Problem p03495 (python)

Fixed submission:
from collections import Counter
n, k = map(int, input().split())
A = list(map(int, input().split()))
AD = sorted(list(Counter(A).values()))
print(sum(AD[:len(AD) - k]))

Buggy submission (verdict: Runtime Error):
10 3
5 1 3 2 4 1 1 2 3 4
Problem p03737 (python)

Fixed submission:
S = list(input().split())
print(S[0][0].upper() + S[1][0].upper() + S[2][0].upper())

Buggy submission (verdict: Runtime Error):
s1, s2, s3 = input().split())
print(s1[0].upper() + s2[0].upper() + s3[0].upper())
Problem p04031 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ttl1, ttl2, ttl3 = 0, 0, 0
avarage1 = -(-sum(A) // N)
avarage2 = sum(A) // N
avarage3 = round(sum(A) / N)
for i in A:
    ttl1 += (i - avarage1) ** 2
    ttl2 += (i - avarage2) ** 2
    ttl3 += (i - avarage3) ** 2
print(min(ttl1, ttl2, ttl3))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
ttl1, ttl2, ttl3 = 0, 0, 0
avarage1 = -(-sum(A) // N)
avarage2 = sum(A) // N
for i in A:
    ttl1 += (i - avarage1) ** 2
    ttl2 += (i - avarage2) ** 2
    ttl3 += (i - avarage3) ** 2
print(min(ttl1, ttl2, ttl3))
Problem p04044 (python)

Fixed submission:
N, L = map(int, input().split())
S = list(input() for i in range(N))
str = ""
for i in range(N-1):
    for j in range(N-1):
        if S[j+1] + S[j] <= S[j] + S[j+1]:
            S[j], S[j+1] = S[j+1], S[j]
for i in S:
    str += i
print(str)

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
S = list(input() for i in range(L))
S.sort()
str = ""
for i in S:
    str += i
print(str)
Problem p03288 (python)

Fixed submission:
a=input()
if int(a)<=1199:
  print("ABC")
elif int(a)<=2799:
  print("ARC")
else:
  print("AGC")

Buggy submission (verdict: Runtime Error):
a=input()
if a<=1199:
  print("ABC")
elif a<=2799:
  print("ARC")
else:
  print("AGC")
Problem p03292 (python)

Fixed submission:
list=input().split(" ")
list_n=[int(s) for s in list]
print(int(max(list_n))-int(min(list_n)))

Buggy submission (verdict: Runtime Error):
list=input()
list_n=[int(s) for s in list]
print(int(max(list_n))-int(min(list_n)))

Buggy submission (verdict: Runtime Error):
list=input()
list_n=[int(s) for s in list]
print(max(list_n)-min(list_n))
Problem p03308 (python)

Fixed submission:
count=input()
list=input().rstrip().split(" ")
list_1=[int(s) for s in list]
list2= sorted(list_1)
sa=(int(list2[0])-int(list2[int(count)-1]))
if sa<0:
  print(-1*int(sa))
else:
  print(int(sa))

Buggy submission (verdict: Runtime Error):
count=input()
list=int(input()).rstrip().split(" ")
list_1=[int(s) for s in list]
list2= sorted(list_1)
sa=(int(list2[0])-int(list2[int(count)-1]))
if sa<0:
  print(-1*int(sa))
else:
  print(int(sa))

Buggy submission (verdict: Runtime Error):
count=input()
list=int(input()).rstrip().split(" ")
list2= sorted(list)
sa=(int(list2[0])-int(list2[int(count)-1]))
if sa<0:
  print(-1*int(sa))
else:
  print(int(sa))
Problem p03316 (python)

Fixed submission:
num=input()
num1=num
j=0
while int(num)>0:
  j+=int(num)%10
  num = int(num)/10
if int(num1)%j==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
num=input()
j=0
for i in range(1,10):
  j+=num//10^i
print(num%j==0)
Problem p02719 (python)

Fixed submission:
N, K = map(int, input().split())
a = abs(N%K)
print(min(a, abs(a-K)))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
a = abs(N%K)
print(min(a, abs(a-K))
Problem p02767 (python)

Fixed submission:
import numpy as np
ans = 0

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

P = int(round(np.average(X)))

for i in range(N):
    ans += ((X[i] - P)**2)

print(ans)

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

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

P = int(round(np.average(X)))

for i in range(N):
    ans += ((X[i] - P)**2)

print(ans)

Buggy submission (verdict: Runtime Error):
from statistics import mean
ans = 0

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

P = round(mean(X))

for i in range(N):
    ans += ((X[i] - P)**2)

print(ans)
Problem p03029 (python)

Fixed submission:
A,P = map(int,input().split())
ans = 0

A = int(A)
P = int(P)

P = (A*3) + P
ans = P // 2

print(ans)

Buggy submission (verdict: Runtime Error):
    A,P = map(int,input().split())
    ans = 0
     
    A = int(A)
    P = int(P)
     
    P = (A*3) + P
    ans = P // 2
     
    print(ans)

Buggy submission (verdict: Runtime Error):
    A,P = map(int,input().split())     
    A = int(A)
    P = int(P)
     
    P = (A*3) + P
    ans = P / 2
     
    ans = round(ans)
     
    print(ans)

Buggy submission (verdict: Runtime Error):
P = (A*3) + P
ans = P / 2

ans = round(ans)

print(ans)

Buggy submission (verdict: Runtime Error):
ans = 0


A = int(A)
P = int(P)
 
P = (A*3) + P
ans = P / 2

ans = round(ans)

print(ans)

Buggy submission (verdict: Runtime Error):
A = 0
P = 0
ans = 0

A = input("りんごの個数を入力してください。")
P = input("りんごの破片の個数を入力してください。")

A = int(A)
P = int(P)
 
P = (A*3) + P
ans = P / 2

ans = round(ans)

print(ans)
Problem p02843 (python)

Fixed submission:
X = int(input())

import numpy as np

J = np.zeros(X+1, dtype="bool")
# J[i] は、 i円の買い物ができるときにTrue, できないとFalse
J[0] = True
J[1:100] = False
J[100:106] = True
for i in range(106, X+1):
    if J[i - 100] or J[i - 101] or J[i - 102] or J[i - 103] or J[i - 104] or J[i - 105]:
        J[i] = True
    else:
        J[i] = False

if J[X] == True:
    print("1")
else:
    print("0")

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

J = np.zeros(X+1, dtype="bool")
# J[i] は、 i円の買い物ができるときにTrue, できないとFalse
J[0] = True
J[1:100] = False
J[100:106] = True
for i in range(106, X+1):
    if J[i - 100] or J[i - 101] or J[i - 102] or J[i - 103] or J[i - 104] or J[i - 105]:
        J[i] = True
    else:
        J[i] = False

if J[X] == True:
    print("Yes")
else:
    print("No")

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

J = np.zeros(X+1, dtype="bool")
# J[i] は、 i円の買い物ができるときにTrue, できないとFalse
J[0] = True
J[1:100] = True
J[100:106] = True
for i in range(106, X+1):
    if J[i - 100] or J[i - 101] or J[i - 102] or J[i - 103] or J[i - 104] or J[i - 105]:
        J[i] = True
    else:
        J[i] = False

if J[X] = True:
    print("Yes")
else:
    print("No")

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

import numpy as np


def judge(X):
	maxrange = min(int(X/100)+1, 1000000)
	for a in range(maxrange):
		for b in range(maxrange):
			for c in range(maxrange):
				S = 100 * a + 101 * b + 102 * c
				d = np.arange(0, maxrange)
				e = np.arange(0, maxrange)
				f = np.arange(0, maxrange)
				DEF = np.meshgrid(d, e, f)
				Splus = 103 * DEF[0] + 104 * DEF[1] * 105 * DEF[2]
				if np.any(Splus == X - S) == True:
					return 1
				else:
					continue
	return 0

print(judge(X))

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

import numpy as np


def judge(X):
	maxrange = max(int(X/100)+1, 1000000)
	for a in range(maxrange):
		for b in range(maxrange):
			for c in range(maxrange):
				S = 100 * a + 101 * b + 102 * c
				d = np.arange(0, maxrange)
				e = np.arange(0, maxrange)
				f = np.arange(0, maxrange)
				DEF = np.meshgrid(d, e, f)
				Splus = 103 * DEF[0] + 104 * DEF[1] * 105 * DEF[2]
				if np.any(Splus == X - S) == True:
					return 1
				else:
					continue
	return 0

print(judge(X))

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

import numpy as np


def judge(X):
	for a in range(int(X/100)+1):
		for b in range(int(X/100)+1):
			for c in range(int(X/100)+1):
				S = 100 * a + 101 * b + 102 * c
				d = np.arange(0, int(X/100)+1)
				e = np.arange(0, int(X/100)+1)
				f = np.arange(0, int(X/100)+1)
				DEF = np.meshgrid(d, e, f)
				Splus = 103 * DEF[0] + 104 * DEF[1] * 105 * DEF[2]
				if np.any(Splus == X - S) == True:
					return 1
	return 0

print(judge(X))
Problem p02743 (python)

Fixed submission:
s = input()
A = s.split(' ')
B = [int(i) for i in A]
a, b, c = B[0], B[1], B[2]

if c-a-b <= 0:
    print('No')
else:
    L = 4 * a * b
    R = (c-a-b) ** 2
    print('Yes' if (L < R) else 'No')

Buggy submission (verdict: Runtime Error):
in_num = input('')

all_num = in_num.split()
a = all_num[0]
b = all_num[1]
c = all_num[2]

if(4 * long(a) * long(b) - (long(c) - long(a) - long(b))**2 >0):
    print("Yes")
else:
    print("No")
Problem p02886 (python)

Fixed submission:
n=int(input())
d=list(map(int,input().split(" ")))
wa=[]
for i in range(0,n):
  for j in range(i+1,n):
    wa.append(d[i]*d[j])

print(sum(wa))

Buggy submission (verdict: Runtime Error):
    n=int(input())
    d=map(int,input().split(" "))
    wa=[]
    for i in range(0,n):
      for j in range(i,n):
        wa.append(d[i]*d[j])
    print(sum(wa))

Buggy submission (verdict: Runtime Error):
n=int(input())
d=map(int,input().split(" "))
wa=[]
for i in range(1,n+1):
  for j in range(i,n+1):
    wa.append(d[i]*d[j])
print(sum(wa))
Problem p03478 (python)

Fixed submission:
n,a,b=map(int,input().split(" "))
kouho=[]
for i in range(1,n+1):
  i=str(i)
  keta=list(map(int,i))
  wa=sum(keta)
  if a<=wa<=b:
    kouho.append(int(i))
print(sum(kouho))

Buggy submission (verdict: Runtime Error):
                    n,a,b=map(int,input().split(" "))
                    kouho=[]
                    for i in range(0,n+1):
                    	i=str(i)
                    	keta=list(map(int,i))
                    	wa=sum(keta)
                        if a<=wa<=b:
                          kouho.append(int(i))
                    print(sum(kouho))

Buggy submission (verdict: Runtime Error):
                n,a,b=map(int,input().split(" "))
                kouho=[]
                for i in range(0,n+1)
                	i=str(i)
                	keta=list(map(int,i))
                	wa=sum(keta)
                    if a<=wa<=b:
                      kouho.append(int(i))
                print(sum(kouho))

Buggy submission (verdict: Runtime Error):
            import math
            n,a,b=map(int,input().split(" "))
            kouho=[]
            for i in range(0,n+1)
            	i=str(i)
            	keta=list(map(int,i))
            	wa=sum(keta)
                if a<=wa<=b:
                  kouho.append(int(i))
            print(sum(kouho))

Buggy submission (verdict: Runtime Error):
        import math
        n,a,b=map(int,input().split(""))
        kouho=[]
        for i in range(0,n+1)
        	i=str(i)
        	keta=list(map(int,i))
        	wa=sum(keta)
            if a<=wa<=b:
              kouho.append(int(i))
        print(sum(kouho))

Buggy submission (verdict: Runtime Error):
    import math
    n,a,b=map(int,input().split(""))
    kouho=[]
    for i in range(0,n+1)
    	i=str(i)
    	keta=list(map(int,i))
    	wa=sum(keta)
        if a<=wa<=b:
          kouho.append(i)
    print(sum(kouho))

Buggy submission (verdict: Runtime Error):
import math
n,a,b=map(int,input().split(" "))
kouho=[]
for i in range(0,n+1)
	i=str(i)
	keta=list(map(int,i))
	wa=sum(keta)
    if a<=wa<=b:
      kouho.append(i)
print(sum(kouho))
Problem p03597 (python)

Fixed submission:
a=[]
for i in range(0,2):
  a.append(int(input()))
print(a[0]**2-a[1])

Buggy submission (verdict: Runtime Error):
a=[]
for i in range(0,2):
  	a.append(input())
print(a[0]**2-a[1])

Buggy submission (verdict: Runtime Error):
a=[]
a.append(input())
print(a[0]**2-a[1])

Buggy submission (verdict: Runtime Error):
import math

a=int(input("")).split("")
return (a[1]**2-a[0])
Problem p02646 (python)

Fixed submission:
a_now, a_speed = map(int, input().split(' '))
b_now, b_speed = map(int, input().split(' '))
t = int(input())

# print(a_now, a_speed, b_now, b_speed, t)

# speedの差分と現在の差分で割り切れればOK、割り切れなければダメ
if(a_speed < b_speed):
  caught = 'NO'
else:
  diff = abs(a_now - b_now)
  speed = a_speed - b_speed
  #print("現在の距離差は{0}. スピード差は{1}".format(diff, speed))
  if(diff == 0):
    caught = 'NO'
  elif(speed == 0):
    #print("speedが一緒なので終わらない")
    caught = 'NO'
  else:
    q = diff / speed
    #print("おいつくのは{0}秒後. 余りは{1}".format(q, mod))
    if(q <= t):
      caught = 'YES'
    else:
      caught = 'NO'

print(caught)

Buggy submission (verdict: Runtime Error):
a_now, a_speed = map(int, input().split(' '))
b_now, b_speed = map(int, input().split(' '))
t = int(input())

# print(a_now, a_speed, b_now, b_speed, t)

# speedの差分と現在の差分で割り切れればOK、割り切れなければダメ
if(a_now < b_now and a_speed <= b_speed):
  #print("aのほうが遅いので一生捕まらない")
  caught = 'NO'
elif(a_now > b_now and a_speed >= b_speed):
  #print("aのほうが先に行ってるので一生捕まらない")
  caught = 'NO'
else:
  diff = abs(a_now - b_now)
  speed = abs(a_speed - b_speed)
  #print("現在の距離差は{0}. スピード差は{1}".format(diff, speed))
  if(diff == 0):
    caught = 'NO'
  elif(speed == 0):
    #print("speedが一緒なので終わらない")
    caught = 'NO'
  else:
      q = diff / speed
      #print("おいつくのは{0}秒後. 余りは{1}".format(q, mod))
      if(q <= t)
        caught = 'YES'
      else:
        caught = 'NO'

print(caught)
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
def solve() :
    a, b = input().split()

    a = int(a)
    b = b.replace('.', '')
    b100 = int(b[0])*100 + int(b[1])*10 + int(b[2])*1

    print(a*b100//100)
    return


if __name__ == "__main__" :
    solve()

Buggy submission (verdict: Runtime Error):
def solve() :
    n = int(input()) 
    a = list(map(int, input().split()))

    total = 1

    if 0 in a :
        print(0)
        return

    for i in a :
        total *= i

        if total > 10 ** 18 :
            print(-1)
            return

    print(total)

if __name__ == "__main__" :
    solve()
Problem p02612 (python)

Fixed submission:
N = int(input())
if N % 1000 == 0:
    print(0)
else:
    print(1000 - (N % 1000))

Buggy submission (verdict: Runtime Error):
N = int(input()
if N % 1000 == 0:
    print(0)
else:
    print(1000 - (N % 1000))