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

Fixed submission:
from sys import stdin
N = int(stdin.readline().rstrip())
A = [int(_) for _ in stdin.readline().rstrip().split()]
minus = []
for i in range(N):
  if A[i] < 0:
    minus.append(A[i])
abs_A = [abs(i) for i in A]
if len(minus) % 2 == 0:
  print(sum(abs_A))
else:
  print(sum(abs_A)-min(abs_A)*2)

Buggy submission (verdict: Runtime Error):
from sys import stdin
N = int(stdin.readline().rstrip())
A = [int(_) for _ in stdin.readline().rstrip().split()]
minus = []
for i in range(N):
  if A[i] < 0:
    minus.append(A[i])
abs_A = (abs(i) for i in A)
if len(minus) % 2 == 0:
  print(sum(abs_A))
else:
  print(sum(abs_A)-min(abs_A)*2)
Problem p03086 (python)

Fixed submission:
from sys import stdin
s = list(stdin.readline().rstrip())
counts=[]
count=0
for i in s:
    if i in ['A','G','C','T']:
        count+=1
        counts.append(count)
    else:
        count=0
        counts.append(count)
print(max(counts))

Buggy submission (verdict: Runtime Error):
from sys import stdin
s = list(stdin.readline().rstrip())
counts=[]
count=0
for i in s:
    if i in ['A','G','C','T']:
        count+=1
    else:
        counts.append(count)
        count=0
print(max(counts))
Problem p03140 (python)

Fixed submission:
from sys import stdin
N = int(stdin.readline().rstrip())
A = stdin.readline().rstrip()
B = stdin.readline().rstrip()
C = stdin.readline().rstrip()
ans = 0 
for i in range(N):
    ans += len(set([A[i], B[i], C[i]]))-1
print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
N = int(stdin.readline().rstrip())
A = stdin.readline().rstrip()
B = stdin.readline().rstrip()
C = stdin.readline().rstrip()
ans = 0 
for i in range(N):
    ans += len(set(A[i], B[i], C[i]))-1
print(ans)
Problem p03147 (python)

Fixed submission:
from math import factorial
from sys import exit, stdin
N = int(stdin.readline().rstrip())
H = [int(_) for _ in stdin.readline().rstrip().split()]
ans = 0
for i in range(1,N):
    if H[i-1] > H[i]:
        ans += H[i-1]-H[i]
ans += H[-1]
print(ans)

Buggy submission (verdict: Runtime Error):
from math import factorial
from sys import exit, stdin
N = int(stdin.readline().rstrip())
H = [int(_) for _ in stdin.readline().rstrip().split()]
ans = 0
for i in range(1,n):
    if H[i-1] > H[i]:
        ans += H[i-1]-H[i]
ans += H[-1]
print(ans)
Problem p03157 (python)

Fixed submission:
import sys
from sys import stdin
sys.setrecursionlimit(10**7)
dx = (1, 0, -1, 0)
dy = (0, 1, 0, -1)
H, W = [int(_) for _ in stdin.readline().rstrip().split()]
field = [list(stdin.readline().rstrip()) for _ in range(H)]
seen = [[False for i in range(400)] for j in range(400)]
num_b, num_w = 0, 0
ans = 0

def dfs(h, w):
    seen[h][w] = True
    if field[h][w] == '#':
        global num_b
        num_b += 1
    else:
        global num_w
        num_w += 1

    for direction in range(4):
        nh = h + dx[direction]
        nw = w + dy[direction]

        if nh < 0 or nh >= H or nw < 0 or nw >= W:
            continue
        if field[nh][nw] == field[h][w]:
            continue
        if seen[nh][nw]:
            continue

        dfs(nh, nw)

for i in range(H):
    for j in range(W):
        if field[i][j] == '.':
            continue
        if seen[i][j]:
            continue
        num_b, num_w = 0, 0
        dfs(i, j)
        ans += num_b * num_w 

print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
dx = (1, 0, -1, 0)
dy = (0, 1, 0, -1)
H, W = [int(_) for _ in stdin.readline().rstrip().split()]
field = [list(stdin.readline().rstrip()) for _ in range(H)]
seen = [[False for i in range(400)] for j in range(400)]
num_b, num_w = 0, 0
ans = 0

def dfs(h, w):
    seen[h][w] = True
    if field[h][w] == '#':
        global num_b
        num_b += 1
    else:
        global num_w
        num_w += 1

    for direction in range(4):
        nh = h + dx[direction]
        nw = w + dy[direction]

        if nh < 0 or nh >= H or nw < 0 or nw >= W:
            continue
        if field[nh][nw] == field[h][w]:
            continue
        if seen[nh][nw]:
            continue

        dfs(nh, nw)

for i in range(H):
    for j in range(W):
        if field[i][j] == '.':
            continue
        if seen[i][j]:
            continue
        num_b, num_w = 0, 0
        dfs(i, j)
        ans += num_b * num_w 

print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
dx = (1, 0, -1, 0)
dy = (0, 1, 0, -1)
H, W = [int(_) for _ in stdin.readline().rstrip().split()]
field = [list(stdin.readline().rstrip()) for _ in range(H)]
seen = [[False for i in range(400)] for j in range(400)]
num_b, num_w = 0, 0
ans = 0

def dfs(h, w):
    print('h: %d, w: %d' % (h, w))
    seen[h][w] = True
    if field[h][w] == '#':
        global num_b
        num_b += 1
    else:
        global num_w
        num_w += 1
    print('b: %d, w: %d' % (num_b, num_w))

    for direction in range(4):
        nh = h + dx[direction]
        nw = w + dy[direction]

        if nh < 0 or nh >= H or nw < 0 or nw >= W:
            continue
        if field[nh][nw] == field[h][w]:
            continue
        if seen[nh][nw]:
            continue

        dfs(nh, nw)

for i in range(H):
    for j in range(W):
        print('i: %d, j: %d' % (i, j))
        if field[i][j] == '.':
            continue
        if seen[i][j]:
            continue
        num_b, num_w = 0, 0
        dfs(i, j)
        ans += num_b * num_w 

print(ans)
Problem p03211 (python)

Fixed submission:
from sys import stdin
s=stdin.readline().rstrip()
print(min([abs(int(s[i:i+3])-753) for i,n in enumerate(s[:-2])]))

Buggy submission (verdict: Runtime Error):
from sys import stdin
s=[int(x) for x in list(stdin.readline().rstrip())]
abs_seven=[abs(7-i) for i in s]
min_num=min(abs_seven)
indices=[]
nums=[]
for i, n in enumerate(abs_seven):
    if n == min_num:
        indices.append(i)

for i in indices:
    try:
        n=s[i:i+3]
        nums.append(n[0]*100+n[1]*10+n[2])
    except:
        pass
nums=[abs(753-n) for n in nums]
print(min(nums))

Buggy submission (verdict: Runtime Error):
from sys import stdin
s=[int(x) for x in list(stdin.readline().rstrip())]
abs_seven=[abs(7-i) for i in s]
min_num=min(abs_seven)
indices=[]
nums=[]
for i, n in enumerate(abs_seven):
    if n == min_num:
        indices.append(i)

for i in indices:
    try:
        n=s[i:i+3]
        nums.append(n[0]*100+n[1]*10+n[2])
    except:
        pass
nums=[abs(753-n) for n in nums]
print(min(nums))
Problem p03284 (python)

Fixed submission:
from sys import stdin
n, k=[int(x) for x in stdin.readline().rstrip().split()]
if n%k >= 1:
  print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
from sys import stdin
n, k=[int(x) for x in stdin.readlint().rstrip().split()]
if n%k == 1:
  print(1)
else:
  print(0)
Problem p03288 (python)

Fixed submission:
from sys import stdin
n = int(stdin.readline().rstrip())
if n<1200:
  print('ABC')
elif n>=1200 and n<2800:
  print('ARC')
elif n>=2800:
  print('AGC')

Buggy submission (verdict: Runtime Error):
from sys import stdin
n = int(stdin.readline.rstrip())
if n<1200:
  print('ABC')
elif n>=1200 and n<2800:
  print('ARC')
elif n>=2800:
  print('AGC')
Problem p03352 (python)

Fixed submission:
from sys import stdin
X = int(stdin.readline().rstrip())
exps=[1]
for i in range(1,X+1):
    for j in range(2,X+1):
        if 1 <= i**j <= X:
            exps.append(i**j)
        else:
            break
print(max(exps))

Buggy submission (verdict: Runtime Error):
from sys import stdin
X = int(stdin.readline().rstrip())
exps=[]
for i in range(1,X+1):
    for j in range(2,X+1):
        if 1 <= i**j <= X:
            exps.append(i**j)
        else:
            break
print(max(exps))

Buggy submission (verdict: Runtime Error):
from sys import stdin
X = int(stdin.readline().rstrip())
exps=[]
for i in range(1,X+1):
    for j in range(2,X+1):
        if 1 <= i**j <= X:
            exps.append(i**j)
print(max(exps))

Buggy submission (verdict: Runtime Error):
from sys import stdin
X = int(stdin.readline().rstrip())
exps=[]
for i in range(1,X+1):
    for j in range(2,X+1):
        if 1 <= i**j <= X:
            exps.append(i**j)
print(max(exps))
Problem p03377 (python)

Fixed submission:
from sys import stdin
a,b,x = [int(x) for x in stdin.readline().rstrip().split()]
 
if a>x:
  print('NO')
elif a<x and (x-a)>b:
  print('NO')
else:
  print('YES')

Buggy submission (verdict: Runtime Error):
from sys import stdin
a,b,x = [int(x) for x in stdin.readline().rstrip().split()]
 
if a>x or:
  print('NO')
elif a<x and (x-a)>b:
  print('NO')
else:
  print('YES')

Buggy submission (verdict: Runtime Error):
from sys import stdin
a,b,x = [int(x) for x in stdin.readline().rstrip().split()]

if a>x or:
  print('NO')
elif a<x and x-a>b:
  print('NO')
else:
  print('YES')
Problem p03380 (python)

Fixed submission:
from sys import stdin
N = int(stdin.readline().rstrip())
A = [int(_) for _ in stdin.readline().rstrip().split()]
A.sort()
max_a = A[-1]
print(max_a, min(A, key=lambda a:abs(max_a-a*2)))

Buggy submission (verdict: Runtime Error):
from scipy.special import comb
from sys import stdin
N = int(stdin.readline().rstrip())
A = [int(_) for _ in stdin.readline().rstrip().split()]
A.sort()
max_a = A[-1]
A.pop(N-1)
ans = 0
ans_a = 0
for a in A:
    tmp = comb(max_a, a, exact=True)
    if tmp > ans:
        ans = tmp
        ans_a = a
print(max_a, ans_a)

Buggy submission (verdict: Runtime Error):
from scipy.special import comb
from sys import stdin
N = int(stdin.readline().rstrip())
A = [int(_) for _ in stdin.readline().rstrip().split()]
A.sort()
max_a = A[-1]
A.pop(N-1)
ans = 0
ans_a = 0
for a in A:
    tmp = comb(max_a, a)
    if tmp > ans:
        ans = tmp
        ans_a = a
print(max_a, ans_a)

Buggy submission (verdict: Runtime Error):
from itertools import combinations
from sys import exit, stdin
N = int(stdin.readline().rstrip())
A = [int(_) for _ in stdin.readline().rstrip().split()]
A.sort()
max_a = A[-1]
A.pop(N-1)
ans = 0
ans_a = 0
for a in A:
    tmp = len(list(combinations(range(max_a), a)))
    if tmp > ans:
        ans = tmp
        ans_a = a
print(max_a, ans_a)

Buggy submission (verdict: Runtime Error):
from itertools import combinations
from sys import exit, stdin
N = int(stdin.readline().rstrip())
A = [int(_) for _ in stdin.readline().rstrip().split()]
A.sort()
max_a = A[-1]
A.pop(N-1)
ans = 0
for a in A:
    tmp = len(list(combinations(range(max_a), a)))
    if tmp > ans:
        ans = tmp
print(ans)
Problem p03597 (python)

Fixed submission:
from sys import stdin
n = int(stdin.readline().rstrip())
a = int(stdin.readline().rstrip())
print(n*n-a)

Buggy submission (verdict: Runtime Error):
from sys import stdin
N = int(stdin.readline().rstrip())
K = int(stdin.readline().rstrip())
X = [int(_) for _ in stdin.readline().rstrip().split()]
ans = 0
for i in x:
    if i < K - i:
        ans += 2 * i
    else:
        ans += 2 * (K - i)
print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
N = int(stdin.readline().rstrip())
K = int(stdin.readline().rstrip())
X = [int(_) for _ in stdin.readline().rstrip().split()]
ans = 0
for i in x:
    if i < K - i:
        ans += 2 * i
    else:
        ans += 2 * (K - i)
print(route)
Problem p03598 (python)

Fixed submission:
from sys import stdin
N = int(stdin.readline().rstrip())
K = int(stdin.readline().rstrip())
X = [int(_) for _ in stdin.readline().rstrip().split()]
ans = 0
for i in X:
    if i < K - i:
        ans += 2 * i
    else:
        ans += 2 * (K - i)
print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
N = int(stdin.readline().rstrip())
K = int(stdin.readline().rstrip())
X = [int(_) for _ in stdin.readline().rstrip().split()]
ans = 0
for i in x:
    if i < K - i:
        ans += 2 * i
    else:
        ans += 2 * (K - i)
print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
N = int(stdin.readline().rstrip())
K = int(stdin.readline().rstrip())
X = [int(_) for _ in stdin.readline().rstrip().split()]
ans = 0
for i in x:
    if i < K - i:
        ans += 2 * i
    else:
        ans += 2 * (K - i)
print(route)
Problem p03612 (python)

Fixed submission:
from sys import exit, stdin
N = int(stdin.readline().rstrip())
A = [int(_) for _ in stdin.readline().rstrip().split()]
count, ignore = 0, 0
for i, a in enumerate(A):
    if ignore == 1:
        ignore = 0
        continue
    if a-1 == i:
        count += 1
        if i != N-1:
            if A[i+1] != i+1:
                ignore = 1
print(count)

Buggy submission (verdict: Runtime Error):
from sys import exit, stdin
N = int(stdin.readline().rstrip())
A = [int(_) for _ in stdin.readline().rstrip().split()]
count, ignore = 0, 0
for i, a in enumerate(A):
    if ignore == 1:
        ignore = 0
        continue
    if a-1 == i:
        count += 1
        if A[i+1] != i+1:
            ignore = 1
print(count)
Problem p03627 (python)

Fixed submission:
import sys
from collections import Counter
from sys import stdin
N = int(stdin.readline().rstrip())
A = Counter([int(_) for _ in stdin.readline().rstrip().split()]).most_common()
B = [t for t in A if t[1] >= 2]
B.sort(reverse=True)
if len(B) < 2:
    print(0)
    sys.exit()
if B[0][1] >= 4:
    print(B[0][0]**2)
else:
    print(B[0][0]*B[1][0])

Buggy submission (verdict: Runtime Error):
from collections import Counter
from sys import stdin
N = int(stdin.readline().rstrip())
A = Counter([int(_) for _ in stdin.readline().rstrip().split()]).most_common()
B = [t for t in A if t[1] >= 2]
B.sort(reverse=True)
print(B[0][0]*B[1][0])
Problem p03657 (python)

Fixed submission:
from sys import stdin
a, b = [int(x) for x in stdin.readline().rstrip().split()]

if a%3==0 or b%3==0 or (a+b)%3==0:
  print('Possible')
else:
  print('Impossible')

Buggy submission (verdict: Runtime Error):
from sys import stdin
a, b = [int(x) for x in stdin.readline().rstrip().split()]
if (a+b)/3:
  print('Possible')
else:
  print('Impossible')
from sys import stdin
a, b = [int(x) for x in stdin.readline().rstrip().split()]
if (a+b)%3 == 0:
  print('Possible')
else:
  print('Impossible')
Problem p03658 (python)

Fixed submission:
from sys import stdin
N, K = [int(_) for _ in stdin.readline().rstrip().split()]
L = sorted([int(_) for _ in stdin.readline().rstrip().split()], reverse=True)
print(sum(L[:K]))

Buggy submission (verdict: Runtime Error):
N, K = [int(_) for _ in stdin.readline().rstrip().split()]
L = sorted([int(_) for _ in stdin.readline().rstrip().split()], reverse=True)
print(sum(L[:k]))
Problem p03799 (python)

Fixed submission:
from sys import exit, stdin
N, M = [int(_) for _ in stdin.readline().rstrip().split()]
r = M-2*N
if r <= 0:
    print(M//2)
else:
    print(N+r//4)

Buggy submission (verdict: Runtime Error):
from sys import exit, stdin
N, M = [int(_) for _ in stdin.readline().rstrip().split()]
r = M-2*N
if r <= 0:
    print(N//2)
else:
    pritnt(N+r//4)
Problem p02713 (python)

Fixed submission:
from math import gcd

K = int(input())

res = 0
for i in range(1,K+1):
    for j in range(1,K+1):
        tmp = gcd(i,j)
        for k in range(1,K+1):
            res += gcd(tmp,k)
print(res)

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

K = int(input())

res = 0
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            tmp = [i,j,k]
            res += reduce(gcd,tmp)
print(res)
Problem p02767 (python)

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

min = 1000000
result = 0
for i in range(100):
    for j in X:
        result += (i + 1 - j) ** 2
    if min > result:
        min = result
    result = 0

print(min)

Buggy submission (verdict: Runtime Error):
min = 0
result = 100000000
for i in range(100):
    for j in X:
        result += (i + 1 - j) ** 2
    if min > result:
        min = result
    result = 0

print(min)
Problem p02791 (python)

Fixed submission:
import sys

def main():
    input = sys.stdin.readline

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

    #result = list()

    minimum = P[0]
    count = 1
    for i in range(N):
        if(minimum > P[i]):
            minimum = P[i]
            count += 1
    print(count)
#        Pj = list(P[j] for j in range(i+1))
        #print(Pj)
        #Pj = P[0:i+1]
#        min_P = min(Pj)
#        result.append(min_P)
#        print(min_P)
#        if(P[i] == min_P):
#            count += 1

    '''
    count = 0
    flag = True

    for i in range(N):
        for j in range(i):
            if(P[i] > P[j]):
                flag = False
                break
        if(flag):
            count += 1
        flag = True
    print(count)
    '''

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    input = sys.stdin.readline

    N = int(input())
    P = list(map(int,input().split()))
'''
    count = 0
    result = list()
    r_apeend = result.append

    for i in range(N):
        Pj = P[0:i+1]
        min_P = min(Pj)
        r_append(min_P)
#        print(min_P)
#        if(P[i] == min_P):
#            count += 1

    print(len(set(result)))
    '''
    count = 0
    flag = True
    
    for i in range(N):
        for j in range(i):
            if(P[i] > P[j]):
                flag = False
                break
        if(flag):
            count += 1
        flag = True
    print(count)

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

Fixed submission:
def main():
    K,X = list(map(int,input().split()))

    price = 500 * K
    if(price >= X):
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    K,X = list(map(int,input().split()))
    if(500*k > X):
        print('Yes')
    else:
        print('No')


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

Fixed submission:
d,a = {},0
for i in range(int(input())):
    k = ''.join(sorted(input()))
    d[k] = d.get(k,-1)+1
    a+= d[k]
print(a)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = list(input() for _ in range(N))

l = list(map(sorted,s))
cnt = 0
for i in range(N):
    for j in range(i+1,N:
        if(l[i] == l[j]):
            cnt += 1
print(cnt)
Problem p02952 (python)

Fixed submission:
N = int(input())

print(sum(len(str(i)) % 2 for i in range(1,N+1)))

Buggy submission (verdict: Runtime Error):
result = 0
if(0<N<=pow(10,5)):
    if len(str(N)) % 2 == 0:
        loop = ((len(str(N)) - 1) -1) //2 + 1
        for i in range(loop):
            result += 9 * pow(10,2*i)
    else:
        for i in range(len(str(N)) - 2):
            result += 9 * pow(10,i)
        result += N - pow(10,len(str(N)) - 1) + 1

print(result)

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

result = 0
if(0<N<=pow(10,5))
    if len(str(N)) % 2 == 0:
        loop = ((len(str(N)) - 1) -1) //2 + 1
        for i in range(loop):
            result += 9 * pow(10,2*i)
    else:
        for i in range(len(str(N)) - 2):
            result += 9 * pow(10,i)
        result += N - pow(10,len(str(N)) - 1) + 1

print(result)
Problem p03035 (python)

Fixed submission:
A,B = map(int,input().split())

if(A>=13):
    print(B)
elif(6<=A<=12):
    print(B//2)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
A,B = map(int,input())

if(A>=13):
    print(B)
elif(6<=A<=12):
    print(B//2)
else:
    print(0)
Problem p03061 (python)

Fixed submission:
from fractions import gcd

N = int(input())
A = list(map(int,input().split()))
'''
res = 0
for i in range(N):
    tmp = A[i+1:] + A[:i]
    ans = tmp[0]
    for i in range(1,N-1):
        ans = gcd(ans,tmp[i])
    res = max(ans,res)
print(res)
'''

L = [0] * (N+1)
R = [0] * (N+1)

for i in range(N):
    L[i+1] = gcd(L[i],A[i])
    R[N-i-1] = gcd(R[N-i],A[N-i-1])
ans = 0
for i in range(N):
    ans = max(ans,gcd(L[i],R[i+1]))

print(ans)

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

N = int(input())
A = list(map(int,input().split()))
'''
res = 0
for i in range(N):
    tmp = A[i+1:] + A[:i]
    ans = tmp[0]
    for i in range(1,N-1):
        ans = gcd(ans,tmp[i])
    res = max(ans,res)
print(res)
'''

L = [0] * N
R = [0] * N

for i in range(N):
    L[i+1] = gcd(L[i],A[i])
    R[N-i-1] = gcd(R[N-i],A[N-i-1])
ans = 0
for i in range(N):
    ans = max(ans,gcd(L[i],R[i+1]))

print(ans)
Problem p03288 (python)

Fixed submission:
R = int(input())

if R < 1200:
    print('ABC')
elif 1200 <= R < 2800:
    print('ARC')
else:
    print('AGC')

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

if R < 1200:
    print('ABC')
elif 1200 <= R < 2800
    print('ARC')
else:
    print('AGC')
Problem p03294 (python)

Fixed submission:
from fractions import gcd
from functools import reduce

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

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

res = 0
tmp = reduce(lcm,a)-1
for i in a:
    res += tmp % i
print(res)

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

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

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

res = 0
tmp = reduce(lcm,a)-1
for i in a:
    res += tmp % i
print(res)

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

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

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

res = 0
tmp = reduce(lcm,a)-1
for i in a:
    res += tmp % i
print(res)

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

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

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

res = 0
tmp = reduce(lcm,a)-1
for i in a:
    res += tmp % i
print(res)
Problem p03386 (python)

Fixed submission:
a,b,k=map(int,input().split())
if a+k-1>=b-k+1:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(a,a+k):
        print(i)
    for i in range(b-k+1,b+1):
        print(i)

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
tmp = list(range(a,b+1))
if a+k-1<b-k+1:
	ans = tmp[:k] + tmp[-k:]
else:
	ans = tmp
for i in sorted(set(ans)):
	print(i)

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
tmp = list(range(a,b+1))
ans = tmp[:k] + tmp[-k:]
for i in sorted(set(ans)):
	print(i)

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
tmp = list(range(a,b+1))
if b-a+1 > k:
	ans = tmp[:k] + tmp[-k:]
else:
	ans = tmp
for i in set(ans):
	print(i)

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
tmp = list(range(a,b+1))
if b-a+1 >= k:
	ans = tmp[:k] + tmp[-k:]
else:
	ans = tmp
for i in set(ans):
	print(i)

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
tmp = list(range(a,b+1))
ans = tmp[:k] + tmp[-k:]
for i in set(ans):
	print(i)

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

l = list(range(A,B+1))
res = set(l[:K] + l[-K:])
for i in sorted(set(res)):
    print(i)

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

l = list(range(A,B+1))
res = []
for i in range(len(l)):
    if i < K:
        res.append(l[i])
    if B-A+1-K <= i:
        res.append(l[i])

for i in set(res):
    print(i)