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

Fixed submission:
A_B_T = input()
A = int(A_B_T.split()[0])
B = int(A_B_T.split()[1])
T = int(A_B_T.split()[2])

print(int((T + 0.5) // A * B))

Buggy submission (verdict: Runtime Error):
import fractions
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

N = int(input())
A = (input()).split()
# N = int('2')
# A = ('1000000000 1000000000').split()
A = [int(a) for a in A]
max=0

for i in range(N):
    B = A.copy()
    del B[i]
    for j in range(N-1):
        if max < gcd(*B):
            max = gcd(*B)
            
print(max)

Buggy submission (verdict: Runtime Error):
import fraction
from functools import reduce

def gcd(*numbers):
    return reduce(fraction.gcd, numbers)

def gcd_list(numbers):
    return reduce(fraction.gcd, numbers)

N = int(input())
A = (input()).split()
# N = int('2')
# A = ('1000000000 1000000000').split()
A = [int(a) for a in A]
max=0

for i in range(N):
    B = A.copy()
    del B[i]
    for j in range(N-1):
        if max < gcd(*B):
            max = gcd(*B)
            
print(max)

Buggy submission (verdict: Runtime Error):
import fraction
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

N = int(input())
A = (input()).split()
# N = int('2')
# A = ('1000000000 1000000000').split()
A = [int(a) for a in A]
max=0

for i in range(N):
    B = A.copy()
    del B[i]
    for j in range(N-1):
        if max < gcd(*B):
            max = gcd(*B)
            
print(max)
Problem p02975 (python)

Fixed submission:

import sys
#sys.stdin=open("data.txt")
input=sys.stdin.readline
mii=lambda:map(int,input().split())

n=int(input())

a=list(mii())
a.sort()

if a[0]==a[n-1]:
    if a[0]==0:
        print("Yes")
    else:
        print("No")
elif n%3:
    print("No")
else:
    a1,a2,a3=a[0],a[n//3],a[n//3*2]
    if a1!=a[n//3-1] or a2!=a[n//3*2-1] or a3!=a[n-1]:
        print("No")
    elif a1^a2!=a3 or a1^a3!=a2 or a2^a3!=a1:
        print("No")
    else:
        print("Yes")

Buggy submission (verdict: Runtime Error):

import sys
#sys.stdin=open("data.txt")
input=sys.stdin.readline
mii=lambda:map(int,input().split())

n=int(input())

a=list(mii())
a.sort()

if a[0]==a[n-1]:
    if 0 in b:
        print("Yes")
    else:
        print("No")
elif n%3:
    print("No")
else:
    a1,a2,a3=a[0],a[n//3],a[n//3*2]
    if a1!=a[n//3-1] or a2!=a[n//3*2-1] or a3!=a[n-1]:
        print("No")
    elif a1^a2!=a3 or a1^a3!=a2 or a2^a3!=a1:
        print("No")
    else:
        print("Yes")
Problem p03320 (python)

Fixed submission:

import sys
#sys.stdin=open("data.txt")
input=sys.stdin.readline

nums=[]

num=0
pow10=1

# add a few possible answers
for i in range(16):
    t="9"*i
    if t!="": nums.append(int(t))
    for j in range(1,1000):
        t=str(j)+"9"*i
        if len(t)>15: continue
        nums.append(int(t))

def dsum(x):
    t=0
    while x:
        t+=x%10
        x//=10
    return t

# remove some bad numbers
out=[]
rat=[]
for i in sorted(set(nums)):
    j=i/dsum(i)
    while rat and rat[-1]>j:
        out.pop(-1)
        rat.pop(-1)
    out.append(i)
    rat.append(j)

#print(len(out))

#for i in range(len(out)): print(i,out[i],rat[i])

#for i in range(len(nums)):
#    print(i,dsum(nums[i]),nums[i]/dsum(nums[i]))

k=int(input())
for i in range(k):
    print(out[i])

Buggy submission (verdict: Runtime Error):

import sys
#sys.stdin=open("data.txt")
input=sys.stdin.readline

nums=[]

num=0
pow10=1
for i in range(135):
    num+=pow10
    if i%9==8: pow10*=10
    nums.append(num)

# add a few possible answers
for i in range(1,14):
    for j in range(1,10):
        t=str(j)+"8"+"9"*i
        nums.append(int(t))

# remove some bad numbers
nums.sort()
for i in range(len(nums))[::-1]:
    if i>=len(nums): continue
    ratio=nums[i]/(i+1)
    for j in range(i)[::-1]:
        ratio2=nums[j]/(j+1)
        if ratio2>ratio:
            nums.pop(j)

#print(len(nums))

k=int(input())
for i in range(k):
    print(nums[i])

Buggy submission (verdict: Runtime Error):

import sys
#sys.stdin=open("data.txt")
input=sys.stdin.readline

nums=[]

num=0
pow10=1
for i in range(1000):
    num+=pow10
    if num>10**15: break
    if i%9==8: pow10*=10
    nums.append(num)

k=int(input())
for i in range(k):
    print(nums[i])
Problem p03211 (python)

Fixed submission:
S = input()
l = len(S)
distance = 999
for i in range(l):
    num = int(S[i:i+3])
    if abs(num - 753) < distance:
        distance = abs(num - 753)
print(str(distance))

Buggy submission (verdict: Runtime Error):
S = input()
l = len(S)
distance = 999
for i in range(l)
    num = int(S[i:i+3])
    if abs(num - 753) < distance:
        distance = abs(num - 753)
print(str(distance))
Problem p03219 (python)

Fixed submission:
X, Y = [int(a) for a in input().split()]
ret = int(X + Y/2 + 0.1)
print(str(ret))

Buggy submission (verdict: Runtime Error):
X, Y = [int(a) for a in input.split()]
ret = int(X + Y/2 + 0.1)
print(str(ret))

Buggy submission (verdict: Runtime Error):
X = int(input())
Y = int(input())
ret = int(X + Y/2 + 0.1)
print(str(ret))
Problem p03238 (python)

Fixed submission:
N = input()

if N == "1":
    print("Hello World")
else:
    A = input()
    B = input()
    print(str(int(A) + int(B)))

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

if N == "1":
    print("Hello World")
else:
    print(str(int(A) + int(B)))
Problem p03347 (python)

Fixed submission:
N = int(input())
ans = -1
bef = -1
for i in range(N):
    now = int(input())
    if now - bef > 1:
        ans = -1
        break
    elif now - bef == 1:
        ans += 1
        bef = now
    else:
        ans += now
        bef = now
 
print(str(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = -1
bef = -1
for i in range(N):
    now = int(data[input()])
    if now - bef > 1:
        ans = -1
        break
    elif now - bef == 1:
        ans += 1
        bef = now
    else:
        ans += now
        bef = now

print(str(ans))
Problem p04044 (python)

Fixed submission:
from sys import stdin, stdout
from time import perf_counter

import sys
sys.setrecursionlimit(10**9)
mod = 10**9+7





n,l = map(int, input().split())
s = [input() for _ in range(n)]
s.sort()
result ="".join(s)
print(result)

Buggy submission (verdict: Runtime Error):
from sys import stdin, stdout
from time import perf_counter

import sys
sys.setrecursionlimit(10**9)
mod = 10**9+7

import sys
sys.stdout = open("e:/cp/output.txt","w")
sys.stdin = open("e:/cp/input.txt","r")



n,l = map(int, input().split())
s = [input() for _ in range(n)]
s.sort()
result = ''.join(s)
print(s)
Problem p02981 (python)

Fixed submission:
import numpy as np

N,A,B = map(int,input().split(" "))
costs = A*N , B

print(min(costs))

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

N,A,B = map(int,input().split(" "))
costs = A*N , B

print(min(costs))

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

N,A,B = map(int,input().split(" "))
costs = A*N, B

return np.min(costs)

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

N,A,B = map(int,input().split(" "))
i = np.arange(N+1)  # the number of people who use train
j = N-i  # the number pf people who use taxi
cost = A+i + B*j

return np.min(cost)
Problem p02993 (python)

Fixed submission:
ss = input()

for i in range(3):
  if ss[i] == ss[i+1]:
    print("Bad")
    break
else:
  print("Good")

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

for i in range(3):
  if ss[i] = ss[i+1]:
    print("Good")
    break
else:
  print("Bad")

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

for i in range(3):
  if ss[i] = ss[i+1]:
    print("Good")
    break
else:
  print("Bad")
Problem p02995 (python)

Fixed submission:
import fractions

def lcm(x, y):
  return (x * y) // fractions.gcd(x, y)

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

AtoB =  B - (A-1)

div_C = (B//C) - ((A-1)//C)
div_D = (B//D) - ((A-1)//D)
div_CD = (B//lcm(C,D)) - ((A-1)//lcm(C,D))

print(AtoB - div_C - div_D + div_CD)

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

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

ns = np.arange(A,B+1)

print(((ns%C!=0)*(ns%D!=0)).sum())
Problem p03071 (python)

Fixed submission:
# coding: utf-8
# Your code here!

inp = input()

input_list = inp.split()

a = int(input_list[0])
b = int(input_list[1])

count = 0

for i in range(2):
    if a < b:
        count += b
        b -= 1
    else:
        count += a
        a -= 1

print(count)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

inp: str = input()

input_list = inp.split()

a = int(input_list[0])
b = int(input_list[1])

count = 0

for i in range(2):
    if a < b:
        count += b
        b -= 1
    else:
        count += a
        a -= 1

print(count)
Problem p03069 (python)

Fixed submission:
N = int(input())
S = input()
i = 0
b = S.count('.')
w = 0
min = b
for i in range(N):
    if S[i] == '#':
        w += 1
    else:
        b -= 1
    
    T = b + w
    if T < min:
        min = T

print(min)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
cnt = 0
i = 0
while S[i] == '.':
    i += 1

j = i

for i in range(N - j):
    if S[i] == '.':
        cnt += 1
        
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
cnt = 0
if S[0] == '#' and S[1] == '.':
    S.replace(S[0], '.')
    cnt += 1

i = 1
for i in range(N - 2):
    if S[i] == '#' and S[i + 1] == '.':
        if S[i - 1] == '.':
            S.replace(S[i], '.')
        else:
            S.replace(S[i + 1], '#')        
        cnt += 1
print(cnt)
Problem p03294 (python)

Fixed submission:
line = input()
line= input()
words = line.split()
num_list = []
for word in words:
    num_list.append(int(word))
ans = 0
for num in num_list:
    ans = ans + (num-1)

print(ans)

Buggy submission (verdict: Runtime Error):
import math

line = input()
words = line.split()
num_list = []
for word in words:
    num_list.append(int(word))
ans = 0
temp = 0

for i, num in enumerate(num_list):
    if i+1 < len(num_list) -1:
        break
    temp = math.gcd(num, num_list[i + 1])


for num in num_list:
    ans += (temp-1) % num

print(ans)
Problem p02982 (python)

Fixed submission:
# import atexit
# import io
# import sys
#
# _INPUT_LINES = sys.stdin.read().splitlines()
# input = iter(_INPUT_LINES).__next__
# _OUTPUT_BUFFER = io.StringIO()
# sys.stdout = _OUTPUT_BUFFER
#
#
# @atexit.register
# def write():
#     sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())

import math
R = lambda : map(int,input().split())
import math

N, D = map(int, input().split())
Xs = [list(map(int, input().split())) for _ in range(N)]


def dist(y, z):
    return math.sqrt(sum([(y[i] - z[i]) * (y[i] - z[i]) for i in range(D)]))


count = 0
for i in range(N):
    for j in range(i + 1, N):
        d = dist(Xs[i], Xs[j])
        if int(d) == d:
            count += 1

print(count)

Buggy submission (verdict: Runtime Error):
import atexit
import io
import sys

_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER


@atexit.register
def write():
    sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())

import math
R = lambda : map(int,input().split())
n,d = R()
xs = [list(R()) for _ in range(n)]

def dist(y,z):
    return math.sqrt(sum([(y[i]-z[i])**2 for i in range(d)]))


count = 0
for i in range(n):
    for j in range(i+1,n):
        d = dist(xs[i],xs[j])
        if int(d)==d:
            count+=1
print(count)

Buggy submission (verdict: Runtime Error):
import math
R = lambda : map(int,input().split())
n,d = R()
xs = [list(R()) for _ in range(n)]

def dist(y,z):
    return math.sqrt(sum([(y[i]-z[i])**2 for i in range(d)]))


count = 0
for i in range(n):
    for j in range(i+1,n):
        d = dist(xs[i],xs[j])
        if int(d)==d:
            count+=1
print(count)
Problem p02983 (python)

Fixed submission:
import atexit
import io
import sys

_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER


@atexit.register
def write():
    sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())

import math
R = lambda : map(int,input().split())
ans = sys.maxsize
n,k = R()
for i in range(n,k):
    for j in range(i+1,k+1):
        ans = min(ans,(i*j)%2019)
        if ans==0:
            print(ans)
            exit()

print(ans)

Buggy submission (verdict: Runtime Error):
# import atexit
# import io
import sys
#
 _INPUT_LINES = sys.stdin.read().splitlines()
 input = iter(_INPUT_LINES).__next__
 _OUTPUT_BUFFER = io.StringIO()
 sys.stdout = _OUTPUT_BUFFER
#

 @atexit.register
 def write():
     sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())

import math
R = lambda : map(int,input().split())
import math
ans = sys.maxsize
n,k = R()
for i in range(n,k+1):
    for j in range(i+1,k+1):
        ans = min(ans,(i*j)%2019)
        if ans==0:
          print(ans)
          exit()

print(ans)
Problem p03244 (python)

Fixed submission:
from collections import Counter


def main():
    n = int(input())
    aa = list(map(int, input().split()))
    cs_a0 = Counter(a for i, a in enumerate(aa) if i % 2 == 0)
    cs_a1 = Counter(a for i, a in enumerate(aa) if i % 2 == 1)
    vs_a0 = sorted(((v, k) for k, v in cs_a0.items()), reverse=True)
    vs_a1 = sorted(((v, k) for k, v in cs_a1.items()), reverse=True)
    if vs_a0[0][1] != vs_a1[0][1]:
        print(n - vs_a0[0][0] - vs_a1[0][0])
    else:
        res = 1 << 30
        if len(vs_a0) == 1 and len(vs_a1) == 1:
            res = n // 2
        if len(vs_a0) > 1:
            res = min(res, n - vs_a0[1][0] - vs_a1[0][0])
        if len(vs_a1) > 1:
            res = min(res, n - vs_a0[0][0] - vs_a1[1][0])
        print(res)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
from collections import Counter


def main():
    n = int(input())
    aa = list(map(int, input().split()))
    cs_a0 = Counter(a for i, a in enumerate(aa) if i % 2 == 0)
    cs_a1 = Counter(a for i, a in enumerate(aa) if i % 2 == 1)

    vs_a0 = sorted(((v, k) for k, v in cs_a0.items()), reverse=True)
    vs_a1 = sorted(((v, k) for k, v in cs_a1.items()), reverse=True)

    if vs_a0[0][1] != vs_a1[0][1]:
        print(n - vs_a0[0][0] - vs_a1[0][0])
    else:
        res = n // 2
        if len(vs_a0) > 1:
            res = min(n - vs_a0[1][0] - vs_a1[0][0])
        if len(vs_a1) > 1:
            res = min(n - vs_a0[0][0] - vs_a1[1][0])
        print(res)


if __name__ == '__main__':
    main()
Problem p03633 (python)

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


def lcm(a, b):
    return abs(a * b) // gcd(a, b)


def main():
    n = int(input())
    ts = [int(input()) for _ in range(n)]
    res = ts[0]
    for t in ts[1:]:
        res = lcm(res, t)
    print(res)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
from math import gcd


def lcm(a, b):
    return abs(a*b) // gcd(a, b)


def main():
    n = int(input())
    ts = [int(input()) for _ in range(n)]
    res = ts[0]
    for t in ts[1:]:
        res = lcm(res, t)
    print(res)


if __name__ == '__main__':
    main()
Problem p02983 (python)

Fixed submission:
L,R = map(int,input().split())
l = L
m = (L *(L + 1)) % 2019
while l < min (R, L + 2019):
  r = l + 1
  while r <= min (R, L + 2019):
  	n = (l * r) % 2019 
  	m = min(m,n)
  	r = r + 1
  l = l + 1
print(m)

Buggy submission (verdict: Runtime Error):
def solve(left, right):
    if right - left >= 2019:
        return 0
    l_mod = left % 2019
    r_mod = right % 2019
    if r_mod < l_mod:
        return 0
    ans = 2019
    for i in range(l_mod, r_mod + 1):
        for j in range(i + 1, r_mod + 1):
            ans = min(ans, i * j % 2019)
    return ans
 L, R = map(int, input().split())
 print(solve(L, R))
Problem p03125 (python)

Fixed submission:
A, B = map(int, input().split())
print(A+B if B%A == 0 else B-A)

Buggy submission (verdict: Runtime Error):
from collections import Counter;N, M = map(int, input().split());print(len([i for i in Counter([flatten for inner in [i[1:] for i in [[int(i) for i in input().split()] for i in range(N)]] for flatten in inner]).most_common() if i[1] == N]))
Problem p02982 (python)

Fixed submission:
N,D=map(int,input().split())
P=[list(map(int,input().split())) for i in range(N)]

def distance(a,b):
    result=0
    for i in range(D):
        result+=(a[i]-b[i])**2
    result=result**0.5
    return result

ans=0
for i in range(N-1):
    for j in range(i+1,N):
        if distance(P[i],P[j]).is_integer():
            ans+=1

print(ans)

Buggy submission (verdict: Runtime Error):
N,D=map(int,input().split())
P=[list(map(int,input().split())) for i in range(D)]

def distance(a,b):
    result=0
    for i in range(D):
        result+=(a[i]-b[i])**2
    result=result**0.5
    return result

ans=0
for i in range(N-1):
    for j in range(i+1,N):
        if distance(P[i],P[j]).is_integer():
            ans+=1

print(ans)
Problem p02983 (python)

Fixed submission:
L,R=map(int,input().split())
if R-L>=2018:
    print(0)
else:
    ans=2019
    for i in range(L,R):
        for j in range(i+1,R+1):
            ans=min(ans,i*j%2019)
    print(ans)

Buggy submission (verdict: Runtime Error):
L,R=map(int,input().split())
min=0
result=[]
num_range=R-L
if L>=2019 and R>=2019:
    for i in range(num_range-1):
        for j in range(i+1,num_range):
            result.append((L+i-2019)*(L+j-2019))
    result.sort()
elif L<2019 and R<2019:
    result.append(L*R)
print(result[0])

Buggy submission (verdict: Runtime Error):
L,R=map(int,input().split())
min=0
result=[]
num_range=R-L
print(num_range)
for i in range(num_range-1):
    for j in range(i+1,num_range):
        if (L+i)>=2019 and (L+j)>=2019:
            result.append((L+i-2019)*(L+j-2019))
        else: result.append(L*R)    
result.sort()
print(result[0])
Problem p03076 (python)

Fixed submission:
myArray = list()
for n in range(5):
    myArray.append(int(input()))
Jouyo  = 9
jouyoi = 0

for i,j in enumerate(myArray):
    if 0 < j % 10 <= Jouyo:
        Jouyo = j % 10
        jouyoi = i
times = 0
for i,j in enumerate(myArray):
    if i != jouyoi:
        if j % 10 != 0:
            times += ((j // 10) + 1) * 10
        else:
            times += j
    else:
        times += j
print(times)

Buggy submission (verdict: Runtime Error):
myArray = list()
for n in range(5):
    myArray.append(int(input()))
Jouyo  = 9

for i,j in enumerate(myArray):
    if 0 < j % 10 <= Jouyo:
        Jouyo = j % 10
        jouyoi = i

times = 0
for i,j in enumerate(myArray):
    if i != jouyoi:
        if j % 10 != 0:
            times += ((j // 10) + 1) * 10
        else:
            times += j
    else:
        times += j
print(times)
Problem p03448 (python)

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

for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if 500*a + 100*b + 50*c == X:
        counti += 1

print(counti)

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

for a in range(A)+1:
  for b in range(B)+1:
    for c in range(C)+1:
      if 500*a + 100*b + 50*c == X:
        counti += 1

print(counti)
Problem p03109 (python)

Fixed submission:
#!/usr/bin/python
import datetime

def main():
    S = str(input())
    tdatetime = datetime.datetime.strptime(S, '%Y/%m/%d')

    if tdatetime.month <= 4:
        print('Heisei')
    else:
        print('TBD')

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python
import datetime

def main():
    S = str(input())
    tdatetime = datetime.datetime.strptime(S, '%Y%m%d')

    if tdatetime.month <= 4:
        print('HEISEI')
    else:
        print('TBD')

if __name__ == "__main__":
    main()
Problem p03632 (python)

Fixed submission:
# coding: utf-8

a, b, c, d = map(int, input().split())
alice_time = [x for x in range(a, b+1)]
bob_time = [x for x in range(c, d+1)]
pushed_time = set(alice_time) & set(bob_time)

if len(pushed_time) == 0:
  print(0)
else:
  print(len(pushed_time) - 1)

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

a, b, c, d = map(int, input().split())
alice_time = [x for x in range(a, b+1)]
bob_time = [x for x in range(c, d+1)]
pushed_time = set(alice_time) & set(bob_time)

if len(pushed_time) == 0:
  print(0)
else:
  print(pushed_time - 1)

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

a, b, c, d = map(int, input().split())
alice_time = [x for x in range(a, b+1)]
bob_time = [x for x in range(c, d+1)]
pushed_time = set(alice_time) & set(bob_time)

if len(pushed_time) == 0:
	print(0)
else:
	print(pushed_time - 1)

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

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

alice_time = range(a, b+1)
bob_time = range(c, d+1)
pushed_time = set(alice_time) & set(bob_time)

print(alice_time)
print(bob_time)

if not pushed_time:
  print (pushed_time[0] - pushed_time[-1])

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

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

alice_time = range(a, b+1)
bob_time = range(c, d+1)
pushed_time = set(alice_time) & set(bob_time)

print(alice_time)
print(bob_time)

if not pushed_time:
	print (pushed_time[0] - pushed_time[-1])

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

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

if c <= b:
	if c <= d:
	  print(b - c)
	 else:
	 	print(d - c)
else:
	print(0)
Problem p03633 (python)

Fixed submission:
# coding: utf-8

n = int(input()) 
t = sorted([int(input()) for i in range(n)])

def gcd(a, b):
  while b:
    a, b = b, a % b
  return a
	
def lcm(a, b):
  return a * b // gcd(a, b)
	
def nlcm(list):
  if len(list) > 2:
    lcm_num = lcm(list[0], list[1])
    for i in range(2, len(list)):
      lcm_num = lcm(lcm_num, list[i])
    
    print(lcm_num)
  elif len(list) == 2:
    print(lcm(list[0], list[1]))
  else:
  	print(list[-1])

nlcm(t)

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

n = int(input()) 
t = sorted([int(input()) for i in range(n)])

def gcd(a, b):
  while b:
    a, b = b, a % b
  return a
	
def lcm(a, b):
  return a * b // gcd(a, b)
	
def nlcm(list):
  if len(list) > 2:
  	lcm_num = lcm(list[0], list[1])
    for i in range(2, len(list)):
      lcm_num = lcm(lcm_num, list[i])
    print(lcm_num)
  elif len(list) == 2:
    print(lcm(list[0], list[1]))
  else:
  	print(list[-1])

nlcm(t)

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

n = int(input()) 
t = sorted([int(input()) for i in range(n)])

def gcd(a, b):
  while b:
    a, b = b, a % b
  return a
	
def lcm(a, b):
  return a * b // gcd(a, b)
	
def nlcm(list):
  if len(list) > 2:
  	lcm_num = lcm(list[0], list[1])
    for i in range(2, len(list)):
      lcm_num = lcm(lcm_num, list[i])
    print(lcm_num)
  elif len(list) == 2:
    print(lcm(list[0], list[1]))
  else:
  	print(len[-1])


nlcm(t)

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

n = int(input()) 
t = sorted([int(input()) for i in range(n)])

def gcd(a, b):
  while b:
    a, b = b, a % b
  return a
	
def lcm(a, b):
  return a * b // gcd(a, b)
	
def nlcm(list):
  lcm_num = lcm(list[0], list[1])
  if len(list) > 2:
    for i in range(2, len(list)):
      lcm_num = lcm(lcm_num, list[i])
  print(lcm_num)

nlcm(t)

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

n = int(input()) 
t = sorted([int(input()) for i in range(n)])

def gcd(a, b):
  while b:
    a, b = b, a % b
  return a
	
def lcm(a, b):
  return a * b // gcd(a, b)
	
def nlcm(list):
  lcm_num = lcm(list[0], list[1])
  for i in range(2,len(list)):
    lcm_num = lcm(lcm_num, list[i])
  print(lcm_num)

nlcm(t)
Problem p03086 (python)

Fixed submission:
import re
s=input()
s=s.replace("A","1").replace("C","1").replace("G","1").replace("T","1")
s=list(map(int,re.sub('[A-Z]+', ' ', s).split()))
print(0 if s==[] else len(str(max(s))))

Buggy submission (verdict: Runtime Error):
import re
s=input()
s=s.replace("A","1").replace("C","1").replace("G","1").replace("T","1")
s=list(map(int,re.sub('[A-Z]+', ' ', s).split()))
print(len(str(max(s))))