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

Fixed submission:
a= set(map(int, input().split()))
print(len(a))

Buggy submission (verdict: Runtime Error):
a= set(map(int, input().split()))
print(len(set(X)))
Problem p03998 (python)

Fixed submission:
A = list(input())
B = list(input())
C = list(input())
s = A.pop(0)
while True:
    if A == [] and s == 'a':
        print('A')
        exit()
    elif B == [] and s == 'b':
        print('B')
        exit()
    elif C == [] and s == 'c':
        print('C')
        exit()
    if s == 'a':
        s = A.pop(0)
    elif s == 'b':
        s = B.pop(0)
    elif s == 'c':
        s = C.pop(0)

Buggy submission (verdict: Runtime Error):
A = list(input())
B = list(input())
C = list(input())
s = A.pop(0)
while True:
    if A == [] and s == 'a':
        print('A')
        exit()
    if B == [] and s == 'b':
        print('B')
        exit()
    if C == [] and s == 'c':
        print('C')
        exit()
    
    if s == 'a':
        s = A.pop(0)
    if s == 'b':
        s = B.pop(0)
    if s == 'c':
        s = C.pop(0)
Problem p02574 (python)

Fixed submission:
mod = 10**9 + 7
def gcd(a, b):
    return a if b == 0 else gcd(b, a % b)
def solve():
    n = int(input())
    a = list(map(int, input().split()))
    primes = []
    isprime = [True for i in range(1001)]
    for i in range(2, 1001):
        if isprime[i]:
            primes.append(i)
            for j in range(i * i, 1001, i):
                isprime[j] = False
    x = a[0]
    f = True

    cnt = [0 for i in range(1000001)]
    for val in a:
        x = gcd(x, val)
        i = 0
        while i < len(primes) and primes[i] ** 2 <= val:
            if val % primes[i] == 0:
                cnt[primes[i]] += 1
                while val % primes[i] == 0:
                    val //= primes[i]
            i += 1
        if val > 1:
            cnt[val] += 1
    for i in range(2, 1000001):
        if cnt[i] > 1:
            f = False
            break
    if f:
        print('pairwise coprime')
    elif x == 1:
        print('setwise coprime')
    else:
        print('not coprime')



t = 1
while t > 0:
    solve()
    t -= 1

Buggy submission (verdict: Runtime Error):
mod = 10**9 + 7
def gcd(a, b):
    return a if b == 0 else gcd(b, a % b)
def solve():
    n = int(input())
    a = list(map(int, input().split()))
    primes = []
    isprime = [True for i in range(1001)]
    for i in range(2, 1001):
        if isprime[i]:
            primes.append(i)
            for j in range(i * i, 1001, i):
                isprime[j] = False
    x = a[0]
    f = True

    cnt = [0 for i in range(1000001)]
    for val in a:
        x = gcd(x, val)
        i = 0
        while primes[i] ** 2 <= val:
            if val % primes[i] == 0:
                cnt[primes[i]] += 1
                while val % primes[i] == 0:
                    val //= primes[i]
            i += 1
        if val > 1:
            cnt[val] += 1
    for i in range(2, n + 1):
        if cnt[i] > 1:
            f = False
            break
    if f:
        print('pairwise coprime')
    elif x == 1:
        print('setwise coprime')
    else:
        print('not coprime')



t = 1
while t > 0:
    solve()
    t -= 1
Problem p02630 (python)

Fixed submission:
from collections import Counter
import sys

input = sys.stdin.readline


def main():
    N = int(input())
    A = list(map(int, input().split()))
    Q = int(input())

    d = Counter(A)
    # print(d)
    ans = sum(A)

    for i in range(Q):
        b, c = map(int, input().split())
        if d[b] != 0:
            ans -= d[b] * b
            ans -= d[c] * c
            d[c] += d[b]
            d[b] = 0
            ans += d[c] * c

        print(ans)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
from collections import Counter
input = sys.stdin.readline

def main():
    N = int(input())
    A = list(map(int, input().split()))
    Q = int(input())

    d = Counter(A)
    # print(d)

    for i in range(Q):
        ans = 0
        b, c = map(int, input().split())
        if b in d.keys():
            d[c] += d[b]
            d[b] = 0
        for k, v in d.items():
            ans += k * v
        # print(d)
        print(ans)


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

Fixed submission:
def main():
    A = input()[::-1]
    A = "0" + A
    # lis_num = [int(s) for s in A]

    # print(lis_num)

    # S = [0] * len(lis_num)
    S = [0] * len(A)
    cnt = [0] * 2019
    cnt[0] = 1

    for i in range(len(A) - 1):
        S[i + 1] = (S[i] + int(A[i + 1]) * pow(10, i, 2019)) % 2019
        cnt[S[i + 1] % 2019] += 1

    # print(S)

    # for i in S:
    #     cnt[i % 2019] += 1

    ans = 0

    for i in cnt:
        ans += i * (i - 1) // 2

    print(ans)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
def main():
    A = input()[::-1]
    A = "0" + A
    # lis_num = [int(s) for s in A]

    # print(lis_num)

    # S = [0] * len(lis_num)
    S = [0] * len(A)
    cnt = [0] * 2019
    cnt[0] = 1

    for i in range(len(A) - 1):
        S[i + 1] = S[i] + int(A[i + 1]) * pow(10, i)
        cnt[S[i + 1] % 2019] += 1

    # print(S)


    # for i in S:
    #     cnt[i % 2019] += 1

    ans = 0

    for i in range(2019):
        ans += cnt[i] * (cnt[i] - 1) // 2

    print(ans)
    
if __name__ == '__main__':
    main()
Problem p02720 (python)

Fixed submission:
K = int(input())

lunlun = [i for i in range(1, 10)]

p = 0


def genelate_lunlun(p):
    last = p % 10
    if last > 0:
        yield p * 10 + last - 1
    yield p * 10 + last
    if last + 1 < 10:
        yield p * 10 + last + 1


while len(lunlun) <= K:
    for new in genelate_lunlun(lunlun[p]):
        lunlun.append(new)
    p += 1

# print(lunlun)
print(lunlun[K - 1])

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

dp = [-1] * (10 ** 5 + 10)
dp[1] = 1
runrun = []
for i in range(1, len(dp) - 1):
    if len(str(i)) == 1:
        dp[i + 1] = i
        runrun += [i]
        continue
    s = str(i)
    last = int(s[-1])
    upper = s[:-1]
    upper = int(upper)
    if dp[upper + 1] != -1 and (
        dp[upper + 1] == last - 1 or dp[upper + 1] == last or dp[upper + 1] == last + 1
    ):
        dp[i + 1] = last
        runrun += [i]

# print(runrun[:30])
print(runrun[K - 1])
Problem p02761 (python)

Fixed submission:
import sys

N, M = map(int, input().split())

d = {}

for i in range(M):
    s, c = map(int, input().split())
    if s not in d:
        d[s] = c
    elif d[s] != c:
        print(-1)
        sys.exit()

# print(d)
# if d[1] == 0:
#     print(-1)
#     sys.exit()
ans = [0 for _ in range(N)]

for i in range(N):
    if i + 1 in d:
        ans[i] = d[i + 1]
if 1 not in d and N != 1:
    ans[0] = 1
if ans[0] == 0 and len(ans) != 1:
    print(-1)
else:
    print(*ans, sep="")

Buggy submission (verdict: Runtime Error):
import sys

N, M = map(int, input().split())

d = {}

for i in range(M):
    s, c = map(int, input().split())
    if s not in d:
        d[s] = c
    elif d[s] != c:
        print(-1)
        sys.exit()

# print(d)
if d[1] == 0:
    print(-1)
    sys.exit()
ans = ""
for i in range(1, N + 1):
    if i in d:
        ans += str(d[i])
    else:
        ans += "0"
print(ans)
Problem p02812 (python)

Fixed submission:
n = int(input())
s = input()

i = 0
ans = 0

while i < len(s) - 2:
    if s[i] == "A" and s[i + 1] == "B" and s[i + 2] == "C":
        ans += 1
        i += 3
    else:
        i += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()

i = 0
ans = 0

while i < len(s):
    if s[i] == "A" and s[i + 1] == "B" and s[i + 2] == "C":
        ans += 1
        i += 3
    else:
        i += 1
print(ans)
Problem p02844 (python)

Fixed submission:
N = int(input())
S = input()

ans = 0
for i in range(1000):
    t = "{:0=3}".format(i)
    p = 0
    for j in range(N):
        if S[j] == t[p]:
            p += 1
        if p == 3:
            break
    if p == 3:
        ans += 1

print(ans)

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

n = int(input())
s = input()

dp = np.zeros((30009, 4, 1009), dtype=np.bool)

dp[0][0][0] = True

for i in range(n):  # i: どの桁にいるか
    for j in range(4):  # j: 何文字残すか
        for k in range(1000):  # k: 残すと決まった数字
            if dp[i][j][k] == False:
                continue
            dp[i + 1][j][k] = True
            if j <= 2:
                dp[i + 1][j + 1][k * 10 + int(s[i])] = True
cnt = 0
for i in range(1000):
    if dp[n][3][i]:
        cnt += 1
print(cnt)
Problem p02886 (python)

Fixed submission:
from itertools import combinations

n = int(input())
d = list(map(int, input().split()))

comb = list(combinations(d, 2))

ans = 0

for i in range(len(comb)):
    ans += comb[i][0] * comb[i][1]
    # print(ans, comb[i])

print(ans)

Buggy submission (verdict: Runtime Error):
from itertools import combinations
import sys
sys.setrecursionlimit(10**6)

n = int(input())
d = list(map(int, input().split()))

comb = list(combinations(d, 2))
ans = 0

for i in range(len(d)):
    ans += comb[i][0] * comb[i][1]

print(ans)

Buggy submission (verdict: Runtime Error):
from itertools import combinations

n = int(input())
d = list(map(int, input().split()))

comb = list(combinations(d, 2))
ans = 0

for i in range(len(d)):
    ans += comb[i][0] * comb[i][1]

print(ans)
Problem p02888 (python)

Fixed submission:
from bisect import bisect_left

n = int(input())
l = list(map(int, input().split()))

ans = 0
l.sort()

for i in range(n):
    for j in range(i + 1, n):
        a = l[i]
        b = l[j]
        idx = bisect_left(l, a + b)
        # print(a, b, idx)

        ans += idx - (j + 1)


print(ans)

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

for i in range(n):
    for j in range(i, n - i):
        a = l[i]
        b = l[j]
        for k in range(j, n - i - j):
            c = l[k]
            if (a < b + c) and (b < c + a) and (c < a + b):
                ans += 1

print(ans)

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

for i in range(n):
    for j in range(i, n - i):
        a = l[i]
        b = l[j]
        for k in range(j, n - i - j):
            c = l[k]
            if (a < b + c) and (b < c + a) and (c < a + b):
                ans += 1

print(ans)
Problem p02900 (python)

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

    def gcd(x, y):
        while y != 0:
            x, y = y, x % y
        return x

    def prime_factorize(n):
        arr = []
        temp = n
        for i in range(2, int(-(-(n ** 0.5) // 1)) + 1):
            if temp % i == 0:
                cnt = 0
                while temp % i == 0:
                    cnt += 1
                    temp //= i
                arr.append([i, cnt])

        if temp != 1:
            arr.append([temp, 1])


        return arr

    cd = gcd(A, B)
    ans = len(prime_factorize(cd)) + 1
    print(ans)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
from functools import reduce
from fractions import gcd
import numpy as np

# List=[15,25,30]
# print(reduce(gcd,List))
a, b = map(int, input().split())


def make_divisors(n):
    divisors = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)

    # divisors.sort()
    return divisors


list_a = make_divisors(a)
list_b = make_divisors(b)

# print(list_a, list_b)
cd = set(list_a) & set(list_b)
# print(cd)

# c = 0
# for i in range(len(cd) - 1):
#     if gcd(cd[i], cd[i + 1]) == 1:
#         c += 1

# print(c + 1)


def seachPrimeNum(N):
    max = int(np.sqrt(N))
    seachList = [i for i in range(2, N + 1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum


# print(seachPrimeNum(100))
pnl = set(seachPrimeNum(max(cd)))
print(len(cd & pnl) + 1)
Problem p02910 (python)

Fixed submission:
s = input()
flag = True
count = 1
for i in s:
    if (count % 2 == 1) and ( i == 'L'):
        flag = False
        count += 1
    elif (count % 2 == 0) and (i == 'R'):
        flag = False
        count += 1
    else:
        count += 1
if flag:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
s = input()
count = 1
for i in s:
    if (count % 2 == 1) and ( i == 'L'):
        flag = False
        count += 1
    elif (count % 2 == 0) and (i == 'R'):
        flag = False
        count += 1
    else:
        count += 1
if flag:
    print('Yes')
else:
    print('No')
Problem p02911 (python)

Fixed submission:
n, k, q = map(int, input().split())
a = [ int(input()) for i in range(q) ]
score = [k-q]*n
for i in a:
    score[i-1] += 1
for i in score:
    print('Yes' if i > 0 else 'No')

Buggy submission (verdict: Runtime Error):
def main():
  
  n, k, q = map(int, input().split())
  a = [ int(input()) for i in range(q) ]
  a_count = a.count

  for i in range(1,n+1):
    x = a_count(i)
    if k-q+x > 0:
      print('Yes')
      else:
        print('No')


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
  n, k, q = map(int, input().split())
  a = [ int(input()) for i in range(q) ]

  for i in range(1,n+1):
    x = a.count(i)
    if k-q+x > 0:
      print('Yes')
      else:
        print('No')

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

Fixed submission:
n = int(input())
print(n*(n-1)//2)

Buggy submission (verdict: Runtime Error):
n = int(input())
if n == 1:
  print(0)
else:
  print(n(n-1)//2)

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
#l = [ i+1 for i in range(n) ]
p = [i+1 for i in range(n)]
p.append(1)
p.pop(0)
p_array = np.array(p)
#print(sum(l % p_array))
print(sum(p_array - 1))
Problem p02947 (python)

Fixed submission:
n = int(input())
s=[]
for i in range(n):
    s.append(input())

list_s = []
for j in range(n):
    #list_s.append(sorted(list(s[j])))
    list_s.append(''.join(sorted(s[j])))

m = {}
for i in range(n):
    if list_s[i] not in m:
        m[list_s[i]] = 1
    else:
        m[list_s[i]] += 1

def cmb(num):
    if num == 1:
        return 0
    elif num == 2:
        return 1
    else:
        return (num * (num-1) // 2)
  
count = 0
for k in m.keys():
        count += cmb( m[k] )


print(count)

Buggy submission (verdict: Runtime Error):
nn = int(input())
s=[]
for i in range(nn):
    s.append(input())

list_s = []
for j in range(nn):
    #list_s.append(sorted(list(s[j])))
    list_s.append(''.join(sorted(s[j])))

m = {}
for i in range(nn):
    if list_s[i] not in m:
        m[list_s[i]] = 1
    else:
        m[list_s[i]] += 1

nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]
  
count = 0
for k in range(len(m)):
        count += cmb( m[list_s[k]], 2 )


print(count)

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

list_s = []
for j in range(n):
    #list_s.append(sorted(list(s[j])))
    list_s.append(''.join(sorted(s[j])))

m = {}
for i in range(n):
    if list_s[i] not in m:
        m[list_s[i]] = 1
    else:
        m[list_s[i]] += 1

nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]
  
count = 0
for k in range(len(m)):
        count += cmb( m[list_s[k]], 2 )


print(count)
Problem p03076 (python)

Fixed submission:
n = [int(input()) for _ in range(5)]
first_digit = []
for num in n:
    z = int(str(num)[-1])
    if z > 0:
        first_digit.append(z)


# print(first_digit)
t = 0
for i in range(len(n)):
    t += -(-n[i] // 10) * 10
if len(first_digit) == 0:
    print(t)
else:
    print(t - (10 - min(first_digit)))

Buggy submission (verdict: Runtime Error):
n = [int(input()) for _ in range(5)]
first_digit = []
for num in n:
    z = int(str(num)[-1])
    if z > 0:
        first_digit.append(z)

# print(first_digit)
t = 0
for i in range(len(n)):
    t += -(-n[i] // 10) * 10
print(t - (10 - min(first_digit)))

Buggy submission (verdict: Runtime Error):
n = [int(input()) for _ in range(5)]
first_digit = []
for num in n:
    z = int(str(num)[-1])
    if z > 0:
        first_digit.append(z)

# print(first_digit)
t = 0
for i in range(len(n)):
    t += -(-n[i] // 10) * 10
print(t - (10 - min(first_digit)))
Problem p03164 (python)

Fixed submission:
import sys

# import numpy as np

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

INF = 10 ** 18


def main():
    N, W = map(int, input().split())
    w = []
    v = []
    for i in range(N):
        weight, value = map(int, input().split())
        w.append(weight)
        v.append(value)

    """    
    dp[ i ] : 価値 i における重さの最小値
    　
    品物一つ w,v を見ていくたびに、
    dp[ i ] = (その品物を使うパターン) or (その品物を使わないパターン)
    = min( dp[i -v] + w , dp[ i ] ) 
    を更新していけばよい。
    """

    dp = [0] + [INF] * 10 ** 5

    for i in range(N):
        for j in range(10 ** 5, v[i] - 1, -1):
            dp[j] = min(dp[j - v[i]] + w[i], dp[j])

    # print(dp[:30])

    ans = 0

    for i, j in enumerate(dp):
        if j <= W:
            ans = i
    print(ans)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def main():
    N, W = map(int, input().split())
    w = [0]
    v = [0]
    for i in range(N):
        weight, value = map(int, input().split())
        w.append(weight)
        v.append(value)

    dp = [[0] * (W + 1) for _ in range(N + 1)]



    for i in range(1, N + 1):
        for j in range(1, W + 1):
            if j - w[i] < 0:
                dp[i][j] = dp[i - 1][j]
            else:
                dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - w[i]] + v[i])
    # print(w, v, dp)
    print(dp[N][W])


if __name__ == "__main__":
    main()

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

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def main():
    N, W = map(int, input().split())
    w = [0]
    v = [0]
    for i in range(N):
        weight, value = map(int, input().split())
        w.append(weight)
        v.append(value)

    # dp = [[0] * (W + 1) for _ in range(N + 1)]
    dp = np.zeros(W + 1, dtype=np.int64)

    for i in range(1, N + 1):
        dp[w[i] :] = np.maximum(dp[w[i] :], dp[: -w[i]] + v[i])

    # print(w, v, dp)
    print(dp.max())


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

Fixed submission:
import sys
from collections import defaultdict, deque

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def main():
    V, E = map(int, input().split())
    is_visited = [False] * V
    indeg = [0] * V  # 流入量
    # 隣接リスト
    G = defaultdict(lambda: [])

    for i in range(E):
        s, t = map(int, input().split())
        s -= 1
        t -= 1
        G[s].append(t)
        indeg[t] += 1

    # print(G, indeg, is_visited)
    out = []
    dp = [0] * V

    def bfs(s):
        q = deque()
        q.append(s)
        is_visited[s] = True
        while q:
            u = q.popleft()
            out.append(u)
            # print(u, out)
            for v in G[u]:
                indeg[v] -= 1
                # dp[v] = max(dp[v], dp[u] + 1)
                if indeg[v] == 0 and (not is_visited[v]):
                    q.append(v)
                    is_visited[v] = True

    def topological():
        for u in range(V):
            if indeg[u] == 0 and (not is_visited[u]):
                bfs(u)

        # print(max(dp))

    topological()

    for i in out:
        for dest in G[i]:
            dp[dest] = max(dp[dest], dp[i] + 1)

    print(max(dp))


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
from scipy.sparse.csgraph import csgraph_from_dense, bellman_ford
import numpy as np

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def main():
    N, M = map(int, input().split())
    G = [[0 for i in range(N)] for j in range(N)]

    for i in range(M):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        G[a][b] = -1

    G = csgraph_from_dense(G, null_value=0)
    d = bellman_ford(G)

    print(int(-min(d.flatten())))


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

Fixed submission:
x, y = map(int, input().split())
print(x + y//2 )

Buggy submission (verdict: Runtime Error):
x, y = int(input())
print(x + y//2 )
Problem p03377 (python)

Fixed submission:
a, b, x = map(int, input().split())
print("YES" if 0 <= x - a < b else "NO")

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

Fixed submission:
a,b,k=map(int,input().split())
r=range(a,b+1)
for i in sorted(set(r[:k])|set(r[-k:])):
  print(i)

Buggy submission (verdict: Runtime Error):
import copy

a, b, k = map(int, input().split())

num = copy.deepcopy(list(range(a, b + 1)))

a_k = num[:k]
k_e = num[-k:]

# print(a_k, k_e)
ans_set = set(a_k + k_e)
ans_list = copy.deepcopy(list(ans_set))
ans_list.sort()
for i in ans_list:
    print(i)

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())

num = list(range(a, b + 1))

a_k = num[:k]
k_e = num[-k:]

# print(a_k, k_e)
ans_set = set(a_k + k_e)
ans_list = list(ans_set)
ans_list.sort()
for i in ans_list:
    print(i)

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())

num = list(range(a, b + 1))

a_k = num[:k]
k_e = num[-k:]

# print(a_k, k_e)
ans_set = set(a_k + k_e)
ans_list = list(ans_set)
ans_list.sort()
for i in ans_list:
    print(i)

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())

num = list(range(a, b + 1))

a_k = num[:k]
k_e = num[-k:]

# print(a_k, k_e)
ans_set = set(a_k) | set(k_e)
for i in sorted(ans_set):
    print(i)

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())

num = list(range(a, b + 1))

a_k = num[:k]
k_e = num[-k:]

# print(a_k, k_e)
ans_set = set(a_k) | set(k_e)
for i in sorted(list(ans_set)):
    print(i)

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())

num = list(range(a, b + 1))

a_k = num[:k]
k_e = num[-k:]

# print(a_k, k_e)
ans_set = set(a_k + k_e)
for i in sorted(list(ans_set)):
    print(i)
Problem p03544 (python)

Fixed submission:
n = int(input())
a = 2
b = 1
if n == 0:
    print(2)
elif n == 1:
    print(1)
else:
    for i in range(n - 1):
        c = a + b
        a = b
        b = c
    print(c)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = 2
b = 1
if n < 2:
    print(n)
else:
    for i in range(n - 1):
        c = a + b
        a = b
        b = c
print(c)
Problem p03611 (python)

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

imos = [0] * (10 ** 5 + 10)

for i in range(N):
    l, r, s = a[i] - 1, a[i] + 1, 1
    l += 1
    r += 1
    # print(l, r)
    imos[l] += s
    imos[r + 1] -= s

for i in range(N + 1):
    imos[i + 1] = imos[i] + imos[i + 1]

# print(imos[: max(a) + 3])

print(max(imos[: max(a) + 3]))

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

# いもす法 imos法

imos = [0] * (10 ** 5 + 1)

for i in range(N):
    l, r, s = a[i] - 1, a[i] + 1, 1
    l += 1
    r += 1
    # print(l, r)
    imos[l] += s
    imos[r + 1] -= s

for i in range(N + 1):
    imos[i + 1] = imos[i] + imos[i + 1]

# print(imos[: max(a) + 3])

print(max(imos[: max(a) + 3]))