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

Fixed submission:
N = int(input())
B = []
for I in range(N):
    x,y = map(int,input().split())
    B.append([x,y])
B.sort()
minmin = N
for i in range(1,N):
    for j in range(N-i):
        d = [B[j+i][0]-B[j][0],B[j+i][1]-B[j][1]]
        A = [a for a in B]
        L = 1
        st = A.pop(0)
        while len(A)>0:
            next = [st[0]+d[0],st[1]+d[1]]
            if next in A:
                st = next
                A.remove(next)
            else:
                L += 1
                st = A.pop(0)
        if L < minmin:
            minmin = L
print(minmin)

Buggy submission (verdict: Runtime Error):
N = int(input())
B = []
for I in range(N):
    x,y = map(int,input().split())
    B.append([x,y])
B.sort()
minmin = N
for i in range(1,N):
    for j in range(N-i):
        d = [B[j+i][0]-B[j][0],B[j+i][1]-B[j][1]]
        A = [a for a in B]
        L = 1
        st = A.pop(0)
        while len(A)>1:
            next = [st[0]+d[0],st[1]+d[1]]
            if next in A:
                st = next
                A.remove(next)
            else:
                L += 1
                st = A.pop(0)
        if L < minmin:
            minmin = L
print(L)
Problem p03007 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
A.sort()
K = N-1
ans = []
while(K>1):
    if A[K-1] < 0:
        break
    l = A[0] - A[K]
    ans.append(str(A[0])+" "+str(A[K]))
    A[0] = l
    K -= 1
if K == 1:
    ans.append(str(A[1])+" "+str(A[0]))
    print(A[1]-A[0])
else:
    b = A[K]
    for i in range(K-1,0,-1):
        c = A[i]
        ans.append(str(b)+" "+str(c))
        b = b-c
    ans.append(str(b)+" "+str(A[0]))
    print(b-A[0])
for p in ans:
    print(p)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
A.sort()
K = N-1
ans = []
while(K>1):
    if A[K-1] < 0:
        break
    l = A[0] - A[K]
    ans.append(str(A[0])+" "+str(A[K]))
    A[0] = l
    K -= 1
if K == 1:
    ans.apend(str(A[1])+" "+str(A[0]))
    print(A[1]-A[0])
else:
    b = A[K]
    for i in range(K-1,0,-1):
        c = A[i]
        ans.append(str(b)+" "+str(c))
        b = b-c
    ans.append(str(b)+" "+str(A[0]))
    print(b-A[0])
for p in ans:
    print(p)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
A.sort()
K = N-1
ans = []
while(K>1):
    if A[K-1] < 0:
        break
    l = A[0] - A[K]
    ans.append(str(A[0])+" "+str(A[K]))
    A[0] = l
    K -= 1
if N == 2:
    ans.apend(str(A[1])+" "+str(A[0]))
    print(A[1]-A[0])
else:
    b = A[K]
    for i in range(K-1,0,-1):
        c = A[i]
        ans.append(str(b)+" "+str(c))
        b = b-c
    ans.append(str(b)+" "+str(A[0]))
    print(b-A[0])
for p in ans:
    print(p)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
A.sort()
K = N-1
ans = []
while(K>1):
    if A[K-1] < 0:
        break
    l = A[0] - A[K]
    ans.append(str(A[0])+" "+str(A[K]))
    A[0] = l
    K -= 1
if N == 2:
    ans.apend(str(A[1])+" "+str(A[0]))
    print(A[1]-A[0])
else:
    b = A[K]
    for i in range(K-1,0,-1):
        c = A[i]
        print(b,c)
        b = b-c
    ans.append(str(b)+" "+str(A[0]))
    print(b-A[0])
for p in ans:
    print(p)
Problem p03071 (python)

Fixed submission:
A,B = map(int,input().split())
if A == B:
  print(2 * A)
elif A > B:
  print(2 * A -1)
else:
  print(2 * B -1)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
s = list(map(int,input()))
s.append(2)
start = s[0]
choku = [0]
saka = [0]
number = 1
for i in range(N):
    if s[i] == s[i+1]:
        number += 1
    else:
        if s[i] == 0:
            choku.append(number)
            number = 1
        else:
            saka.append(number)
            number = 1
choku.append(0)
saka.append(0)
while(1):
    max_align = 0
    m = len(choku)
    n = len(saka)
    if m <= K:
        print(N)
        break
    if start == 0: #最初が直立の場合
        for i in range(m-K+1):
            if max_align <= sum(choku[i:i+K]) + sum(saka[i-1:i+K]):
                max_align = sum(choku[i:i+K]) + sum(saka[i-1:i+K])
    else:
        for i in range(m-K+1):
            if max_align <= sum(choku[i:i+K]) + sum(saka[i:i+K+1]):
                max_align = sum(choku[i:i+K]) + sum(saka[i:i+K+1])
    print(max_align)
    break
Problem p02608 (python)

Fixed submission:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
import bisect


if __name__ == "__main__":
    n = int(input())
    ans = [0]*(n+1)
    for i in range(1,int(n**0.5)+1):
        for j in range(1,int(n**0.5)+1):
            for k in range(1,int(n**0.5)+1):
                if i**2 + j**2 + k**2 + i*j + j*k + i*k<=n:
                    ans[i**2 + j**2 + k**2 + i*j + j*k + i*k]+=1
    for i in range(1,n+1):
        print(ans[i])

Buggy submission (verdict: Runtime Error):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
import bisect


if __name__ == "__main__":
    n = int(input())
    ans = [0]*(n**2)
    for i in range(1,int(n**0.5)+1):
        for j in range(1,int(n**0.5)+1):
            for k in range(1,int(n**0.5)+1):
                ans[i**2 + j**2 + k**2 + i*j + j*k + i*k]+=1
    for i in range(1,n+1):
        print(ans[i])

Buggy submission (verdict: Runtime Error):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
import bisect


if __name__ == "__main__":
    n = int(input())
    ans = [0]*(n**5)
    for i in range(1,int(n**0.5)+1):
        for j in range(1,int(n**0.5)+1):
            for k in range(1,int(n**0.5)+1):
                ans[i**2 + j**2 + k**2 + i*j + j*k + i*k]+=1
    for i in range(1,n+1):
        print(ans[i])

Buggy submission (verdict: Runtime Error):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
import bisect


if __name__ == "__main__":
    n = int(input())
    ans = [0]*(n**3+3)
    for i in range(1,int(n**0.5)+1):
        for j in range(1,int(n**0.5)+1):
            for k in range(1,int(n**0.5)+1):
                ans[i**2 + j**2 + k**2 + i*j + j*k + i*k]+=1
    for i in range(1,n+1):
        print(ans[i])

Buggy submission (verdict: Runtime Error):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
import bisect


if __name__ == "__main__":
    n = int(input())
    ans = [0]*(n**3+1)
    for i in range(1,int(n**0.5)+1):
        for j in range(1,int(n**0.5)+1):
            for k in range(1,int(n**0.5)+1):
                ans[i**2 + j**2 + k**2 + i*j + j*k + i*k]+=1
    for i in range(1,n+1):
        print(ans[i])
Problem p02614 (python)

Fixed submission:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
import bisect
INF = 10**18
def judge(li_tate,li_yoko,li2):
    for i in range(len(li_tate)):
        if li_tate[i]:
            for j in range(len(li2[i])):
                li2[i][j] = "red"
    for i in range(len(li_yoko)):
        if li_yoko[i]:
            for j in range(h):
                li2[j][i] = "red"
    cnt = 0
    for i in range(len(li_tate)):
        for j in range(len(li_yoko)):
            if li2[i][j] == "#":
                cnt+=1
    return cnt


if __name__ == "__main__":
    h,w,k = map(int,input().split())
    li = []
    for i in range(h):
        s = list(input())
        li.append(s)
    
    ans = 0
    for i in range(2**h):
        li_tate = [False]*(h)
        for j in range(h):
            if (i>>j)&1:
                li_tate[h-j-1] = True
        for j in range(2**w):
            li_yoko = [False]*(w)
            for l in range(w):
                if (j>>l)&1:
                    li_yoko[w-l-1] = True
            li2 = copy.deepcopy(li)
            a = judge(li_tate,li_yoko,li2)
            if a == k:
                ans += 1
    print(ans)

Buggy submission (verdict: Runtime Error):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
import bisect
INF = 10**18
def judge(li_tate,li_yoko,li2):
    for i in range(len(li_tate)):
        if li_tate[i]:
            for j in range(len(li2[i])):
                li2[i][j] = "red"
    for i in range(len(li_yoko)):
        if li_yoko[i]:
            for j in range(w-1):
                li2[j][i] = "red"
    cnt = 0
    for i in range(h):
        for j in range(w):
            if li2[i][j] == "#":
                cnt+=1
    return cnt


if __name__ == "__main__":
    h,w,k = map(int,input().split())
    li = []
    for i in range(h):
        s = list(input())
        li.append(s)
    
    ans = 0
    for i in range(2**h):
        li_tate = [False]*(h)
        for j in range(h):
            if (i>>j)&1:
                li_tate[h-j-1] = True
        for j in range(2**w):
            li_yoko = [False]*(w)
            for l in range(w):
                if (j>>l)&1:
                    li_yoko[w-l-1] = True
            li2 = copy.deepcopy(li)
            a = judge(li_tate,li_yoko,li2)
            if a == k:
                ans += 1
    print(ans)
Problem p02642 (python)

Fixed submission:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy

if __name__ == "__main__":
    n = int(input())
    a = sorted(list(map(int,input().split())))
    M = 1000005
    dp = [0]*(M)
    for i in range(n):
        if dp[a[i]] != 0:
            dp[a[i]] = 2
            continue
        for j in range(a[i],M,a[i]):
            dp[j]+=1
    cnt = 0
    for i in range(n):
        if dp[a[i]] == 1:
            cnt+=1
    print(cnt)

Buggy submission (verdict: Runtime Error):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
M = 1000005
if __name__ == "__main__":
    n = int(input())
    a = sorted(list(map(int,input().split())))
    dp = [0]*(M)
    for i in range(n):
        if dp[a[i]] != 0:
            dp[a[i]] = 2
            continue
        for j in range(a[i],M+1,a[i]):
            dp[j]+=1
    cnt = 0
    for i in range(n):
        if dp[a[i]] == 1:
            cnt+=1
    print(cnt)
Problem p02702 (python)

Fixed submission:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
mod = 2019
if __name__ == "__main__":
    s = input()
    n = len(s)
    dp = [0]*(mod)
    dp[0] = 1
    r = 0
    t = 1
    for i in reversed(s):
        r += int(i)*t
        r%=mod
        t*=10
        t%=mod
        dp[r] +=1
    ans = 0
    for i in dp:
        ans += i*(i-1)//2
    print(ans)

Buggy submission (verdict: Runtime Error):
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math
import functools
import bisect

s = input()
li = [0]
c = 2019
for i in range(1,110):
    li.append(c*i)
li.sort()
cnt = 0
cnt = s.count("0")
for i in range(len(s)-3):
    c = ""
    for j in range(4):
        c += s[i+j]
    if int(c) in li:
        cnt+=1
    
for i in range(len(s)-4):
    c = ""
    for j in range(5):
        c += s[i+j]
    if int(c) in li:
        cnt+=1
for i in range(len(s)-5):
    c = ""
    for j in range(6):
        c += s[i+j]
    if int(c) in li:
        cnt+=1
for i in range(len(s)-6):
    c = ""
    for j in range(7):
        c += s[i+j]
    if int(c) in li:
        cnt+=1
for i in range(len(s)-7):
    c = ""
    for j in range(8):
        c += s[i+j]
    if int(c) in li:
        cnt+=1

print(cnt)
Problem p02765 (python)

Fixed submission:
n,r = map(int,input().split())
if n>=10:
    print(r)
else:
    print(r+100*(10-n))

Buggy submission (verdict: Runtime Error):
n,r = map(int,input().split())
if n>=10:
    print(r)
else:
    print(100*(10-k))
Problem p02767 (python)

Fixed submission:
n = int(input())
x = sorted(list(map(int,input().split())))
li = []
cost = 0
for i in range(x[0],x[-1]+1,1):
    cost = 0
    for b in x:
        cost += (b-i)**2
    li.append(cost)
print(min(li))

Buggy submission (verdict: Runtime Error):
n = int(input())
x = sorted(list(map(int,input().split())))
li = []
cost = 0
for i in range(x[0],x[-1],1):
    cost = 0
    for b in x:
        cost += (b-i)**2
    li.append(cost)
print(min(li))
Problem p02802 (python)

Fixed submission:
n,m = map(int,input().split())
cnt = 0
pena = 0
problem = [0]*n
ac = 0
penalty = 0
for i in range(m):
    p,s = input().split()
    if problem[int(p)-1] == -1:
        continue
    if s == "WA":
        problem[int(p)-1]+=1
    else:
        ac += 1
        penalty += problem[int(p)-1]
        problem[int(p)-1] = -1
print(ac,penalty)

Buggy submission (verdict: Runtime Error):
import sys
n,m = map(int,input().split())
li=[]
cnt_ac = 0
cnt_pn = 0
for i in range(m):
    p,s = input().split()
    li.append([int(p),s])
if m==0:
    print(cnt_pn,cnt_ac)
    sys.exit()
else:
    f = li[0][0]
    g = li[-1][0]+1
    j = 0
    while f != g:
        if li[j][1] != "AC":
            cnt_ac+=1
        else:
            f+=1
            cnt_pn+=1
        j+=1
    print(cnt_pn,cnt_ac)
Problem p02843 (python)

Fixed submission:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
import decimal



if __name__ == "__main__":
    x = int(input())
    dp = [0]*101010
    dp[0] = 1
    for i in range(100,101010):
        for j in range(100,106):
            if dp[i-j]:
                dp[i] = 1
    print(dp[x])

Buggy submission (verdict: Runtime Error):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
import decimal

def dfs(val,i,x):
    if val == x:
        return True
    if val > x or i > len(cost):
        return
    if dfs(val+cost[i],i+1,x):
        return True
    if dfs(val,i+1,x):
        return True
    return False

if __name__ == "__main__":
    x = int(input())
    cost = [100,101,102,103,104,105]
    a = dfs(0,0,x)
    if a == False:
        print(0)
    else:
        print(1)
Problem p02900 (python)

Fixed submission:
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)

def fact(n):
    b = 2
    li = []
    li.insert(0,1)
    while b*b<=n:
        while n%b == 0:
            n = n//b
            li.append(b)
        b+=1
    if n>1:
        li.append(n)

    return li
a,b = map(int,input().split())
c = gcd(a,b)
ans = set(fact(c))
print(len(ans))

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
c_li = []
array = []
for i in range(1,max(a,b)):
    if a%i==0 and b%i == 0:
        c_li.append(i)
for i in range(2, max(c_li)):
    sosu = True
    for n in range(2, i):
        if i % n == 0:
            sosu = False
            break
            # 割り切れる場合（素数ではない場合）
            # 一回でも何かの数値で割り切れたら素数ではない
    if sosu:
        array.append(i)
array.insert(0,1)
s_array = set(array)
s_cli = set(c_li)
s_intersection = s_array & s_cli
print(len(s_intersection))
Problem p02923 (python)

Fixed submission:
n = int(input())
li = list(map(int,input().split()))
cnt = 0
ans = 0
for i in range(n-1):
    if li[i]>=li[i+1]:
        cnt+=1
    else:
        if cnt>ans:
            ans = cnt
        cnt = 0
if cnt>ans:
    ans = cnt
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
li = list(map(int,input().split()))
cnt = 0
i = -1
count = [0]
while True:
    if li[i] <= li[i-1]:
        cnt += 1
    else:
        count.append(cnt)
        cnt = 0
    i = i - 1
    if i == -n:
        count.append(cnt)
        break

print(max(count))

Buggy submission (verdict: Runtime Error):
n = int(input())
li = list(map(int,input().split()))
cnt = 0
i = -1
count = []
while True:
    if li[i] <= li[i-1]:
        cnt += 1
    else:
        count.append(cnt)
        cnt = 0
    i = i - 1
    if i == -n:
        count.append(cnt)
        break

print(max(count))

Buggy submission (verdict: Runtime Error):
n = int(input())
li = list(map(int,input().split()))
cnt = 0
i = -1
count = []
while True:

    if i == -n:
        break
    if li[i] <= li[i-1]:
        cnt+=1
    else:
        count.append(cnt)
        cnt = 0
    i = i - 1
    if max(count)>= n//2:
        break
print(max(count))

Buggy submission (verdict: Runtime Error):
n = int(input())
li = list(map(int,input().split()))
cnt = 0
i = -1
count = []
while True:
    if i == -n:
        break
    if li[i] <= li[i-1]:
        i = i-1
        cnt+=1
    else:
        count.append(cnt)
        cnt = 0
        i = i -1
print(max(count))
Problem p03000 (python)

Fixed submission:
N,X = map(int, input().split())
L = list(map(int,input().split()))
d = 0
cnt = 1
for i in range(N):
    d = d + L[i]
    if d>X:
        break
    else:
        cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
N,X = map(int, input().split())
L = list(map(int,input().split()))
d = 0
cnt = 1
for i in range(N+1):
    d = d + L[i]
    if d>X:
        break
    else:
        cnt+=1
print(cnt)
Problem p03086 (python)

Fixed submission:
s = input()
len_li = [0]
cnt = 0
for i in range(len(s)):
    if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T":
        cnt+=1
    else:
        len_li.append(cnt)
        cnt = 0 
len_li.append(cnt)
print(max(len_li))

Buggy submission (verdict: Runtime Error):
s = input()
len_li = []
cnt = 0
for i in range(len(s)):
    if s[i] == 'A' or s[i] == "C" or s[i] == "G" or s[i] == "T":
        cnt+=1
    else:
        len_li.append(cnt)
        cnt = 0 
print(max(len_li))
Problem p03087 (python)

Fixed submission:
n,q = map(int,input().split())
s = input()
li = [0]*n
for i in range(n-1):
    if s[i] == "A" and s[i+1] == "C":
        li[i+1] = li[i] + 1
    else:
        li[i+1] = li[i]
for i in range(q):
    l,r = map(int,input().split())
    print(li[r-1]-li[l-1])

Buggy submission (verdict: Runtime Error):
import numpy as np
n,q = map(int,input().split())
s = input()
check = np.zeros(n)
for i in range(n):
    if s[i] == "A" and s[i+1] == "C":
        check[i] = 1
for i in range(q):
    l,r = map(int,input().split())
    cnt = 0
    for j in range(l-1,r-1):
        if check[j] == 1:
            cnt += 1
    print(cnt)
Problem p03262 (python)

Fixed submission:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
import bisect

def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)

if __name__ == "__main__":
    n,x = map(int,input().split())
    X = list(map(int,input().split()))
    X.sort()
    a = bisect.bisect_left(X,x)
    X.insert(a,x)
    ans = []
    for i in range(1,len(X)):
        diff = X[i] - X[i-1]
        ans.append(diff)
    d = ans[0]
    for i in range(1,len(ans)):
        d = gcd(d,ans[i])
    print(d)

Buggy submission (verdict: Runtime Error):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
import bisect

if __name__ == "__main__":
    n,x = map(int,input().split())
    X = list(map(int,input().split()))
    X.sort()
    a = bisect.bisect_left(X,x)
    X.insert(a,x)
    ans = []
    for i in range(1,len(X)):
        diff = X[i] - X[i-1]
        ans.append(diff)
    d = ans[0]
    for i in range(1,len(ans)):
        d = math.gcd(d,ans[i])
    print(d)
Problem p03324 (python)

Fixed submission:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections

d,n = map(int,input().split())
if n != 100:
    print(n*100**d)
else:
    print(101*100**d)

Buggy submission (verdict: Runtime Error):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections

d,n = map(int,input().split())
a = 100**d
c = [1]
for i in range(n):
    if i%100 == 0:
        continue
    c.append(a*i)
print(c[n])

Buggy submission (verdict: Runtime Error):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections

d,n = map(int,input().split())
a = 100**d
c = []
for i in range(n+1):
    if i%100 == 0:
        continue
    c.append(a*i)
print(c[n-1])
Problem p03386 (python)

Fixed submission:
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math

a,b,k = map(int,input().split())
ans = []
if b-a<=k:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(a,a+k):
        ans.append(i)
    for i in range(b-k+1,b+1):
        ans.append(i)
    ans = set(ans)
    ans = list(ans)
    ans.sort()
    for i in range(len(ans)):
        print(ans[i])

Buggy submission (verdict: Runtime Error):
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math

a,b,k = map(int,input().split())
ans = []
if b-a + 1<=k:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(k):
        ans.append(a+i)
    for i in range(b-k+1,b+1):
        ans.append(i)
    ans = set(ans)
    ans = list(ans)
    ans.sort()
    print(ans)

Buggy submission (verdict: Runtime Error):
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math

a,b,k = map(int,input().split())
num = [i for i in range(a,b+1)]
ans = []
if len(num)<=k:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(k):
        ans.append(num[i])
    for i in range(k):
        ans.append(num[len(num)-i-1])
    ans = set(ans)
    ans = list(ans)
    ans.sort()
    for i in range(len(ans)):
        print(ans[i])
Problem p03387 (python)

Fixed submission:
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math

a,b,c = map(int,input().split())
li = [a,b,c]
li.sort()
cnt = 0
while li[2] != li[1]:
    li[0] += 1
    li[1] += 1
    cnt+=1
cnt += (li[1]-li[0])//2
if (li[1]-li[0])%2 != 0:
    cnt += 2
print(cnt)

Buggy submission (verdict: Runtime Error):
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math

a,b,c = map(int,input().split())
li = [a,b,c]
li.sort()
cnt = 0
while a[2] != a[1]:
    a[0] += 1
    a[1] += 1
    cnt+=1
cnt += (a[1]-a[0])//2
if (a[1]-a[2])%2 != 0:
    cnt += 2
print(cnt)
Problem p03423 (python)

Fixed submission:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop

import collections

N = int(input())
print(N//3)

Buggy submission (verdict: Runtime Error):
n = int(input())
cnt = 0
while n >= 3:
　　　　n -=3
      cnt+=1
print()