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

Fixed submission:
N = int(input())
v = list(map(int,input().split()))
v.sort()
for i in range(N-1):
	v[i+1] = (v[i] + v[i+1])/2
print(v[N-1])

Buggy submission (verdict: Runtime Error):
N = int(input())
v = list(map(int,input().split()))
v.sort()
for i in range(N-1):
	v[i+1] = (v[i] + v[i+1])/2
print(v[N])
Problem p02659 (python)

Fixed submission:
from math import floor as f
a,b=input().split()
b=int(str(b).replace(".",""))
print(int(a)*b//100)

Buggy submission (verdict: Runtime Error):
import math as m
a,b=map(float,input().split())
print(m.floor((a*(b*m))//m))
Problem p02835 (python)

Fixed submission:
print("bust" if sum(map(int, input().strip().split())) >= 22 else "win")

Buggy submission (verdict: Runtime Error):
print("bust" if sum(map(int, input().strip().split()) >= 22 else "win")
Problem p03774 (python)

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

S, C = [], []
for _ in range(N):
    a, b = map(int, input().split())
    S.append((a, b))

for _ in range(M):
    c, d = map(int, input().split())
    C.append((c, d))

for a, b in S:
    ans = None
    min_dist = 1 << 32
    for i, (c, d) in enumerate(C):
        dist = abs(c - a) + abs(d - b)
        if dist < min_dist:
            min_dist = dist
            ans = i
    print(ans + 1)

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

S, C = [], []
for _ in range(N):
    a, b = map(int, input().split())
    S.append((a, b))

for _ in range(M):
    c, d = map(int, input().split())
    C.append((c, d))

for a, b in S:
    ans = None
    min_dist = int(2e8)
    for i, (c, d) in enumerate(C):
        dist = abs(c - a) + abs(d - b)
        if dist < min_dist:
            min_dist = dist
            ans = i
    print(ans + 1)
Problem p03011 (python)

Fixed submission:
p, q, r = map(int, input().split())
sorted_list = sorted([p, q, r])
ans = sorted_list[0] + sorted_list[1]
print(ans)

Buggy submission (verdict: Runtime Error):
p, q, r = map(int, input().split())
sorted_list = sorted(list[p, q, r])
ans = sorted_list[0] + sorted_list[1]
print(ans)
Problem p02726 (python)

Fixed submission:
n, x, y = list(map(int, input().split()))
x -= 1
y -= 1

cnt = [0] * n

dist = []
for i in range(n):
    dist.append([-1] * n)
for i in range(n):
    dist[i][x] = abs(i-x)
    dist[i][y] = abs(i-y)
    dist[x][i] = abs(i-x)
    dist[y][i] = abs(i-y)

for i in range(n):
    for j in range(n):
        if i >= j:
            continue
        dis = min(j - i, dist[j][y] + 1 + dist[i][x], dist[j][x] + 1 + dist[i][y])
        cnt[dis] += 1
for i in range(1, n):
    print(cnt[i])

Buggy submission (verdict: Runtime Error):
n, x, y = list(map(int, input().split()))
x -= 1
y -= 1

dist = []
for i in range(n):
    dist.append([110110] * n)

def dfs(now, s):
    if now != 0:
        if dist[s][now] + 1 < dist[s][now-1]:
            dist[s][now-1] = dist[s][now] + 1
            dfs(now-1, s)
    if now != n-1:
        if dist[s][now] + 1 < dist[s][now+1]:
            dist[s][now+1] = dist[s][now] + 1
            dfs(now+1, s)
    if now == x:
        if dist[s][now] + 1 < dist[s][y]:
            dist[s][y] = dist[s][now] + 1
            dfs(y, s)
    if now == y:
        if dist[s][now] + 1 < dist[s][x]:
            dist[s][x] = dist[s][now] + 1
            dfs(x, s)

cnt = [0] * n

for i in range(n):
    dist[i][i] = 0
    dfs(i, i)

for i in range(n):
    for j in range(n):
        cnt[dist[i][j]] += 1
        
for i in range(1, n):
    print(cnt[i] // 2)
Problem p03075 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

x = min(a, b, c, d, e)
y = max(a, b, c, d, e)
if (y - x) <= k:
    print('Yay!')
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
c = input()
d = input()
e = input()
k = input()

x = min(a, b, c, d, e)
y = max(a, b, c, d, e)
if (y - x) <= k:
  print('Yay!')
else:
  print(':(')
Problem p02847 (python)

Fixed submission:
import math

a = input()

b = {
	"SUN":7,
	"MON":6,
	"TUE":5,
	"WED":4,
	"THU":3,
	"FRI":2,
	"SAT":1,
}

print(b[a])

Buggy submission (verdict: Runtime Error):
import math

[a,b,x] = [int(a) for a in input().split()]

start = 0
end = int(1e9)

cost = 0
while start <= end:
	n = int(start+(end-start)/2)
	cost = a * n + b * len(str(n))
	# if cost == x:
	# 	break
	if cost < x:
		start = n+1;
	else:
		end = n-1;

print(max(0, start-1))
Problem p03242 (python)

Fixed submission:
n = input()

def change(d):
  if d == '1':
    return '9'
  elif d == '9':
    return '1'
  else:
    return d

print(''.join([change(d) for d in n]))

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

def change(d):
  if d == '1':
    return '9'
  elif d == '9':
   	return '1'
  else
  	return d

print(''.join([change(d) for d in n]))
Problem p02695 (python)

Fixed submission:
import sys

read = sys.stdin.read
readline = sys.stdin.readline

N, M, Q, *abcd = map(int, read().split())
cand = [[0, 1]]

for _ in range(N - 1):
    new_cand = []
    for j in cand:
        for k in range(j[-1], M + 1):
            new_cand.append(j[:] + [k])
    cand = new_cand[:]

answer = 0
abcd = tuple(zip(*[iter(abcd)] * 4))
for seq in cand:
    t = 0
    for a, b, c, d in abcd:
        if seq[b] - seq[a] == c:
            t += d
    answer = max(answer, t)

print(answer)

Buggy submission (verdict: Runtime Error):
import sys

read = sys.stdin.read
readline = sys.stdin.readline

N, M, Q, *abcd = map(int, read().split())
cand = [[0, 1]]

for _ in range(M):
    new_cand = []
    for j in cand:
        for k in range(j[-1], M + 1):
            new_cand.append(j[:] + [k])
    cand = new_cand[:]

answer = 0
abcd = tuple(zip(*[iter(abcd)] * 4))
for seq in cand:
    t = 0
    for a, b, c, d in abcd:
        if seq[b] - seq[a] == c:
            t += d

    answer = max(answer, t)

print(answer)
Problem p02773 (python)

Fixed submission:
import sys
from collections import Counter

read = sys.stdin.read

N, *S = map(str, read().split())
s = Counter(S).most_common()
n = s[0][1]
answer = [i for i, j in s if j == n]
answer.sort()
print('\n'.join(answer))

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

read = sys.stdin.read

N, *S = map(str, read().split())
s = Counter(S)
n = max(s.values())
answer = [i for i, j in s if j == n]
answer.sort()
print('\n'.join(answer))
Problem p02834 (python)

Fixed submission:
import sys

read = sys.stdin.read
N, u, v, *AB = map(int, read().split())

graph = [[] for _ in range(N + 1)]
for a, b in zip(*[iter(AB)] * 2):
    graph[a].append(b)
    graph[b].append(a)


def dfs(v):
    dist = [-1] * (N + 1)
    stack = [v]
    dist[v] = 0
    while stack:
        v = stack.pop()
        dw = dist[v] + 1
        for w in graph[v]:
            if dist[w] >= 0:
                continue
            dist[w] = dw
            stack.append(w)
    return dist


DU, DV = dfs(u), dfs(v)

answer = 0
for u, v in zip(DU[1:], DV[1:]):
    if u < v:
        tmp = v - 1
        if answer < tmp:
            answer = tmp

print(answer)

Buggy submission (verdict: Runtime Error):
import sys
import numpy as np
from scipy.sparse.csgraph import shortest_path, dijkstra
from scipy.sparse import coo_matrix


def get_path(start, goal, pred):
    return get_path_row(start, goal, pred[start])


def get_path_row(start, goal, pred_row):
    path = []
    i = goal
    while i != start and pred_row[i] > 0:
        path.append(i)
        i = pred_row[i]
    if i < 0:
        return []
    path.append(i)
    return path[::-1]


read = sys.stdin.read
N, u, v, *AB = map(int, read().split())

a = AB[::2]
b = AB[1::2]
d = [1] * (N - 1)

graph = coo_matrix((d, (a, b)), shape=(N + 1, N + 1))
l, p = shortest_path(graph, directed=False, indices=u, return_predecessors=True)
dist = int(l[v]) // 2
s = get_path_row(u, v, p)[dist]
tour = shortest_path(graph, directed=False, indices=s)

print(int(max(i for i in tour if i != np.inf)) + dist - 1)
Problem p03137 (python)

Fixed submission:
N, M = map(int, input().split())
X = sorted(list(map(int, input().split())))
d = [0] * (M - 1)
ans = 0

if N >= M:
    print(ans)
else:
    for i in range(M - 1):
        d[i] = abs(X[i + 1] - X[i])
    d.sort(reverse=True)
    b = d[:N - 1]
    for i in range(M - 1):
        if d[i] in b:
            b.remove(d[i])
        else:
            ans += d[i]
    print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
X = sorted(list(map(int, input().split())))
d = [0] * (M - 1)

if N >= M:
    print(ans)
else:
    for i in range(M - 1):
        d[i] = abs(X[i + 1] - X[i])
    d.sort(reverse=True)
    print(sum(d[N - 1:]))
Problem p03634 (python)

Fixed submission:
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 6)


def main():
    N = int(readline())
    edge = [[] for _ in range(N + 1)]

    for _ in range(N - 1):
        a, b, c = map(int, readline().split())
        edge[a].append((b, c))
        edge[b].append((a, c))

    Q, K = map(int, readline().split())

    distance = [None] * (N + 1)


    def measure_distance(v, d):
        distance[v] = d
        for vv, dd in edge[v]:
            if distance[vv] is not None:
                continue
            measure_distance(vv, d + dd)


    measure_distance(K, 0)

    xy = map(int, read().split())
    for x, y in zip(xy, xy):
        print(distance[x] + distance[y])


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
from scipy.sparse.csgraph import dijkstra, csgraph_from_dense, shortest_path
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

N = int(readline())
INF = float('inf')
graph = [[INF] * (N + 1) for _ in range(N + 1)]
for i in range(N + 1):
    graph[i][i] = 0

for _ in range(N - 1):
    a, b, c = map(int, readline().split())
    graph[a][b] = c
    graph[b][a] = c

Q, K = map(int, readline().split())
graph = csgraph_from_dense(graph, null_value=INF)
distance = shortest_path(graph, indices=K)

xy = map(int, read().split())
for x, y in zip(xy, xy):
    print(int(distance[x] + distance[y]))
Problem p03785 (python)

Fixed submission:
N, C, K = map(int, input().split(" "))
T = sorted([int(input()) for _ in range(N)])

bus = 0
i = 0
while i < N:
    bus += 1
    start = i
    while i < N and T[i] - T[start] <= K and i - start < C:
        i += 1
print(bus)

Buggy submission (verdict: Runtime Error):
N, C, K = map(int, input().split(" "))
T = sorted([int(input()) for _ in range(N)])

bus = 1
key = T[0]
pas = 0
for i in range(N):
    if T[i] - key > K:
        bus += 1
        key = T[i]
        pas = 0
    else:
        pas += 1
        if pas == C:
            bus += 1
            key = T[i+1]
            pas = 0
print(bus)
Problem p02990 (python)

Fixed submission:
n,k=map(int,input().split())
from operator import mul
from functools import reduce
mod=10**9+7

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

for i in range(1,k+1):
  if n-k+1<i:
    print(0)
  else:
    print(cmb(n-k+1,i)*cmb(k-1,i-1)%mod)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
from operator import mul
from functools import reduce
mod=10**9+7

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

for i in range(1,k+1):
  print(cmb(n-k+1,i)*cmb(k-1,i-1)%mod)
Problem p03011 (python)

Fixed submission:
p,q,r=map(int,input().split())
print(p+q+r-max([p,q,r]))

Buggy submission (verdict: Runtime Error):
p,q,r=map(int,input().split())
print(p+q+r-max[p,q,r])
Problem p03075 (python)

Fixed submission:
li=[int(input()) for i in range(5)]
k=int(input())
if li[1]-li[0]>k or li[2]-li[1]>k or li[3]-li[2]>k or li[4]-li[3]>k or li[4]-li[0]>k:
  print(":(")
else:
  print("Yay!")

Buggy submission (verdict: Runtime Error):
li=list(map(int,input().split("\n")))
k=li[5]
if li[1]-li[0]>5 or li[2]-li[1]>5 or li[3]-li[2]>5 or li[4]-li[3]>5:
  print(":(")
else:
  print("Yay!")
Problem p02679 (python)

Fixed submission:
def Int():
    return int(input())
def Ints():
    return map(int,input().split())
def IntList():
    return list(Ints())
def IntMat(N):
    return [IntList() for i in range(N)]

import sys
sys.setrecursionlimit(4100000)
input = sys.stdin.readline

N = Int()
mod = 1000000007
ans = 1
import math

from collections import defaultdict
XX = defaultdict(list)
YY = defaultdict(list)

zeros = 0

for i in range(N):
    A,B = Ints()
    if A!=0 and B!=0:
        GCD = math.gcd(A,B)
        A //=GCD
        B //=GCD
        if A<0 and B<0:
            A *= -1
            B *= -1
        elif A>0 and B<0:
            A *= -1
            B *= -1
        XX[(A,B)].append(i)
        
        B *= -1
        if A<0 and B<0:
            A *= -1
            B *= -1
        elif A<0 and B>0:
            A *= -1
            B *= -1
        YY[(B,A)].append(i)
        
    elif A==0 and B!=0:
        XX[(0,1)].append(i)
        YY[(1,0)].append(i)
    elif A!=0 and B==0:
        XX[(1,0)].append(i)
        YY[(0,1)].append(i)
    else:
        zeros += 1


D = {}

for key in XX:
    if not key in D:
        l = len(XX[key])
        m = len(YY[key])
        ans *= (pow(2,l,mod)+pow(2,m,mod)-1)
        ans %= mod
        D[key] = 1
        
        a,b = key
        if a==0 and b==1:
            D[(1,0)] = 1
        elif a==1 and b==0:
            D[(0,1)] = 1
        else:
            b *= -1
            if a < 0:
                b*=-1
                a*=-1
            D[(b,a)] = 1
    
ans -= 1
ans += zeros
ans %= mod
print(ans)

Buggy submission (verdict: Runtime Error):
def Int():
    return int(input())
def Ints():
    return map(int,input().split())
def IntList():
    return list(Ints())
def IntMat(N):
    return [IntList() for i in range(N)]

import sys
sys.setrecursionlimit(4100000)
input = sys.stdin.readline

N = Int()
AB = []
mod = 1000000007
ans = 1
C = 0

from collections import defaultdict
XX = defaultdict(list)
YY = defaultdict(list)

for i in range(N):
    A,B = Ints()
    if A!=0 or B!=0:
        AB.append([A,B])
        C += 1
        XX[A/B].append(i)
        YY[-B/A].append(i)

D = {}

for key in XX:
    if not key in D:
        l = len(XX[key])
        m = len(YY[key])
        ans *= (pow(2,l,mod)+pow(2,m,mod)-1)
        ans %= mod
        D[key] = 1
        D[-1/key] = 1
    
ans -= 1
ans %= mod
print(ans)
Problem p02863 (python)

Fixed submission:
N,T = map(int,input().split())
AB = [list(map(int,input().split())) for i in range(N)]
AB.sort(key=lambda x: x[0])
#print(AB)

W = T + 1
def dp(AB,W):
    N = len(AB)
    DP = [[0]*W for i in range(N+1)]
    for i in range(N):
        for w in range(W):
            if w != W-1:
                if AB[i][0] <= w:
                    DP[i+1][w] = max(DP[i][w-AB[i][0]]+AB[i][1],DP[i][w])
                else:
                    DP[i+1][w] = DP[i][w]
            else:
                DP[i+1][w] = max(DP[i][w-1]+AB[i][1],DP[i][w])
    return DP

DP1 = dp(AB,W)

ans = DP1[N][T]
print(ans)

Buggy submission (verdict: Runtime Error):
N,T = map(int,input().split())
AB = [list(map(int,input().split())) for i in range(N)]
AB.sort(key=lambda x: x[1])
#print(AB)

W = T + 1
def dp(AB,W):
    N = len(AB)
    DP = [[0]*W for i in range(N+1)]
    for i in range(N):
        for w in range(W):
            if w != W:
                if AB[i][0] <= w:
                    DP[i+1][w] = max(DP[i][w-AB[i][0]]+AB[i][1],DP[i][w])
                else
                    DP[i+1][W] = DP[i][w]
            else:
                DP[i+1][w] = max(DP[i][w-1]+AB[i][1],DP[i][w])
    return DP

DP1 = dp(AB,W)

ans = DP1[N][W]
print(ans)
Problem p02990 (python)

Fixed submission:
N, K = map(int, input().split())
answer = [0] * K
mod = 10**9+7
C_2000 = [0]*2001
C_2000[0] = 1
for i in range(1,2001):
    C_2000[i] = (C_2000[i-1] * i)%mod
def pow_r(x, n):
    """
    O(log n)
    """
    if n == 0:  # exit case
        return 1
    if n % 2 == 0:  # standard case ① n is even
        return (pow_r((x ** 2)%mod, n // 2))%mod
    else:  # standard case ② n is odd
        return (x * pow_r((x ** 2)%mod, (n - 1) // 2))%mod

for i in range(1,K+1):
    M = N-K
    if M - (i-1) < 0:
        answer[i-1] = 0
    else:
        tmp = (C_2000[K-1] * pow_r(C_2000[i-1],mod-2)*pow_r(C_2000[K-i],mod-2))%mod
        tmp = (tmp*C_2000[M+1] * pow_r(C_2000[i],mod-2) * pow_r(C_2000[M+1-i],mod-2))%mod
        answer[i-1] = int(tmp)
print(*answer, sep="\n")

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
answer = [0] * K
mod = 10**9+7
for i in range(1,K+1):
    M = N-K
    if M - (i-1) < 0:
        answer[i-1] = 0
    else:
        tmp = 1
        for j in range(i-1):
            tmp *= K-1-j
        for j in range(i-1):
            tmp /= j+1
        tmp %= mod
        for j in range(i):
            tmp *= M+1-j
        for j in range(i):
            tmp /= j+1
        tmp %= mod
        answer[i-1] = int(tmp)
print(*answer, sep="\n")
Problem p03072 (python)

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
answer = 0
tmpH = 0
for i in range(N):
    if tmpH <= H[i]:
        answer += 1
        tmpH = H[i]
print(answer)

Buggy submission (verdict: Runtime Error):
N = map(int, input().split())
H = list(map(int, input().split()))
answer = 0
tmpH = 0
for i in range(N):
    if tmpH <= H[i]:
        answer += 1
        tmpH = H[i]
print(answer)
Problem p03291 (python)

Fixed submission:
def main():
    S = input()
    
    mod = 10**9 + 7
    Ans = [[0,0,0,0,0]]
    import copy
    q = 1
    
    S = S[::-1]
    for i in range(len(S)):
        tmp = copy.deepcopy(Ans[i])
        if S[i] == "C":
            tmp[2] += q
            Ans.append(tmp)
        elif S[i] == "B":
            tmp[1] += q
            tmp[3] += tmp[2]
            tmp[3] %= mod
            Ans.append(tmp)
        elif S[i] == "A":
            tmp[0] += q
            tmp[4] += tmp[3]
            tmp[4] %= mod
            Ans.append(tmp)
        elif S[i] == "?":
            a,b,c,bc,abc = tmp
            Ans.append([(3*a+q)%mod, (3*b+q)%mod, (3*c+q)%mod, (3*bc+c)%mod, (3*abc+bc)%mod])
            q *= 3
            q %= mod
            
    print(Ans[-1][-1])
    
    
main()

Buggy submission (verdict: Runtime Error):
def main():
    S = input()
    
    mod = 10**9 + 7
    Ans = [[0,0,0,0,0]]
    import copy
    
    S = S[::-1]

    for i in S:
        tmp = copy.deepcopy(Ans[-1])
        if i == "C":
            tmp[2] += 1
            Ans.append(tmp)
        elif i == "B":
            tmp[1] += 1
            tmp[3] += tmp[2]
            tmp[3] %= mod
            Ans.append(tmp)
        elif i == "A":
            tmp[0] += 1
            tmp[4] += tmp[3]
            tmp[4] %= mod
            Ans.append(tmp)
        elif i == "?":
            print(S[mod])
            a,b,c,bc,abc = copy.deepcopy(tmp)
            Ans.append([(3*a+1)%mod, (3*b+1)%mod, (3*c+1)%mod, (3*bc+c)%mod, (3*abc+bc)%mod]) 
    print(Ans[-1][-1])
    
    
main()
Problem p02682 (python)

Fixed submission:
a,b,c,k = map(int,input().split())
if k <= a:
  print(k)
else:
  if k>a and k <= a+b:
    print(a)
  else:
    print(a-(k-a-b))

Buggy submission (verdict: Runtime Error):
a,b,c,k = map(int,input().split())
if k <= a:
  print(k)
  else:
    if k>a and k <= a+b:
      print(a)
      else:
        print(k-a)
Problem p02777 (python)

Fixed submission:
a,b=input().split()
n,m=map(int,input().split())
c=input()
if a==c:
    print(n-1,m)
else:
    print(n,m-1)

Buggy submission (verdict: Runtime Error):
a,b=input().split()
n,m=map(int,input().split())
c=input()
if a==c:
    print(a-1,b)
else:
    print(a,b-1)
Problem p02759 (python)

Fixed submission:
N = int(input())

def main():
    if N%2 == 0:
        print(int(N/2))
    
    else:
        print(int(N/2)+1)

                
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
does not name a type
Problem p02777 (python)

Fixed submission:
S,T = list(map(str,input().split()))
A,B = list(map(int,input().split()))
U = str(input())

if S == U:
    A -=1
elif T == U:
    B -=1
else:
    pass

print(A,B)

Buggy submission (verdict: Runtime Error):
S, T = list(map(str,input().split()))
A, B = list(map(int,input().split()))
U = str(input())

def main():
    if S is U:
        A -= 1
    elif T is U:
        B -= 1
    else:
        pass

    print(A,B)
    
if __name__ == "__main__":
    main()
Problem p02779 (python)

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

def main():
    flag = 0
    new_A = sorted(A)

    for i in range(S-1):
        if new_A[i] == new_A[i+1]:
            flag = 1
            break
        else:
            continue

    if flag == 0:
        print('YES')
    else:
        print('NO')


if __name__ == "__main__":
    main()

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

def main():
    new_A = sorted(A)

    for i in range(S-1):
        if new_A[i] == new_A[i+1]:
            flag = 1
            break
        else:
            continue
        
    if flag == 0:
        print('YES')
    else:
        print('NO')


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

Fixed submission:
X = int(input())

number = X
flag = 0

if number == 2:
  	print(number)
elif number%2 == 0:
    number += 1
else:
    pass
  
if number != 2:
    while(True):
        for i in range(2, number):
            if number%i == 0:
                number += 2
                break

            elif i == (number-1):
                flag = 1
                print(number)
                break

            else:
                pass

        if flag == 1:
            break

else:
  pass

Buggy submission (verdict: Runtime Error):
X = map(int, input().split())

number = X
flag = 0

if(number%2 == 0):
    number += 1
else:
    pass

while(True):
    for i in range(2, number):
        if number%i == 0:
            number += 2
            break

        elif i == (number-1):
            flag = 1
            print(number)
            break

        else:
            pass

    if flag == 1:
        break

Buggy submission (verdict: Runtime Error):
import argparse
import itertools

def make_parser():
    parser = argparse.ArgumentParser()

    parser.add_argument('X', type=int)
    args = parser.parse_args()

    return args

def main():
    args = make_parser()
    number = args.X
    flag = 0

    if(number%2 == 0):
        number += 1
    else:
        pass

    while(True):
        for i in range(2, number):
            if number%i == 0:
                number += 2
                break

            elif i == (number-1):
                flag = 1
                print(number)
                break

            else:
                pass

        if flag == 1:
            break


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

Fixed submission:
N, K = input().split(" ")

okasi_nasi = set()
for i in range(int(K)*2):
    buf = input()
    if i % 2 == 1:
        if buf[0] != "":
            okasi_nasi = okasi_nasi | set(buf.split(" "))

print(int(N) - len(okasi_nasi))

Buggy submission (verdict: Runtime Error):
N, K = input().split(" ")

d_num = int(input())

okasi_nasi = set()
for i in range(d_num):
    okasi_nasi = okasi_nasi | set(input().split(" "))

print(int(N) - len(okasi_nasi))

Buggy submission (verdict: Runtime Error):
N, K = input().split(" ")

d_num = int(input())

okasi_nasi = set()
for i in range(d_num):
    okasi_nasi = okasi_nasi | input().split(" ")

print(len(okasi_nasi))
Problem p02676 (python)

Fixed submission:
k = int(input())
s = list(input())
if k >= len(s):
  print(''.join(s))
else:
  l = []
  for i in range(k):
    l.append(s[i])
  l.append('...')
  m = ''.join(l)
  print(m)

Buggy submission (verdict: Runtime Error):
k = int(input())
s = list(input())
if k == len(s):
  print(''.join(s))
else:
  l = []
  for i in range(k):
    l.append(s[i])
  l.append('...')
  m = ''.join(l)
  print(m)