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

Fixed submission:
N,M = map(int,input().split())
AB = [[] for _ in range(N)]
ans = [0]*N
for _ in range(M):
  a,b = map(int,input().split())
  AB[a-1].append(b-1)
  AB[b-1].append(a-1)

from collections import deque

node = 0
q = deque([0])

check = [0]*N
check[0] = 1
while len(q) > 0:
  node = q.popleft()
  for i in AB[node]:
    if check[i] == 0:
      q.append(i)
      check[i] = 1
      ans[i] = node
print("Yes")
for i in range(1,N):
  print(ans[i]+1)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
AB = [[] for _ in range(M)]
ans = [0]*N
for _ in range(M):
  a,b = map(int,input().split())
  AB[a-1].append(b-1)
  AB[b-1].append(a-1)

from collections import deque

node = 0
q = deque([0])

check = [0]*N
check[0] = 1
while len(q) > 0:
  node = q.popleft()
  for i in AB[node]:
    if check[i] == 0:
      q.append(i)
      check[i] = 1
      ans[i] = node
print("Yes")
for i in range(1,N):
  print(ans[i]+1)
Problem p02696 (python)

Fixed submission:
from math import floor
A,B,N = map(int,input().split())
ans = 0
if B <=  N:
  ans = floor(A*(B-1)/B) - A*floor((B-1)/B)
else:
  ans = floor((A*N)/B) - A*floor(N/B)
print(ans)

Buggy submission (verdict: Runtime Error):
A,B,N = map(int,input().split())
ans = 0
if B <=  N:
  for x in range(B-1,N+1,B):
    ans = max(ans, (A*x)//B - A*(x//B))
else:
  ans = floor((A*N)/B) - A*floor(N/B)
print(ans)
Problem p02714 (python)

Fixed submission:
N = int(input())
S = str(input())
count = S.count('R')*S.count('G')*S.count('B')
for i in range(N):
  for l in range(N):
    j = i + l
    k = j + l
    if k >= N:
      break
    if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
      count -= 1

print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())
count = S.count('R')*S.count('G')*S.count('B')
for i in range(1,N+1):
  for j in range(i+1,N-1):
    k = 2*j-1
    if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
      count -= 1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())
count = S.count('R')*S.count('G')*S.count('B')
for i in range(1,N+1):
  for j in range(i+1,N-1):
    k = 2*j-1
    if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
      count -= 1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())
count = 0
for i in range(N):
  for i in range(i,N):
    for i in range(j,N):
      if S[i] != S[j] and S[i] != S[k] and S[j] != S[k] and j-i != k-j:
        count += 1
Problem p02727 (python)

Fixed submission:
from heapq import heappush, heappop, heapify
X,Y,A,B,C = map(int, input().split())
p = sorted(list(map(int, input().split())), reverse=True)
q = sorted(list(map(int, input().split())), reverse=True)
r = sorted(list(map(int, input().split())), reverse=True)
P,Q = p[:X],q[:Y]

heapify(P)
heapify(Q)

for i in range(C):
  if min(P[0],Q[0]) > r[i]:
    break
  if P[0] < Q[0]:
    heappop(P)
    heappush(P,r[i])

  else:
    heappop(Q)
    heappush(Q,r[i])
print(sum(P)+sum(Q))

Buggy submission (verdict: Runtime Error):
X,Y,A,B,C = map(int, input().split())
p = sorted(list(map(int, input().split())), reverse=True)
q = sorted(list(map(int, input().split())), reverse=True)
r = sorted(list(map(int, input().split())), reverse=True)
P,Q = p[:X],q[:Y]

for i in range(C):
  if min(P[-i-1],Q[-i-1]) > r[i]:
    break
  elif min(P[-i-1],Q[-i-1]) <= r[i]:
    if P[-i-1] < Q[-i-1]:
      P[-i-1] = r[i]
    else:
      Q[-i-1] = r[i]
print(sum(P)+sum(Q))
Problem p02742 (python)

Fixed submission:
H,W = map(int,input().split())
ans = 0
if H%2 == 0 and W%2 == 0:
  ans = (W//2)*H
elif H == 1 or W == 1:
  print(1)
  exit()
elif H%2 != 0 and W%2 != 0:
  ans = (W//2)*(H//2) + (H-(H//2))*(W-(W//2))
elif H%2 == 0 and W%2 != 0:
  ans = (W//2)*(H//2) + (H//2)*(W-(W//2))
elif H%2 != 0 and W%2 == 0:
  ans = (W//2)*(H//2) + (H-(H//2))*(W//2)
print(ans)

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())
l = [[0]*H]*W
ans = 0
if H%2 == 0 and W%2 == 0:
  ans = (W//2)*H
else:
  ans = (W//2)*(H//2) +(H-(H//2))*(W-(W//2))
print(ans)
Problem p02743 (python)

Fixed submission:
import decimal
a,b,c = map(decimal.Decimal,input().split())
roota = decimal.Decimal.sqrt(a)
rootb = decimal.Decimal.sqrt(b)
rootc = decimal.Decimal.sqrt(c)
if roota + rootb < rootc:
  print("Yes")
else:
  print("No")

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

roota = decimal.Decimal.sqrt(a)
rootb = decimal.Decimal.sqrt(b)
rootc = decimal.Decimal.sqrt(c)
if roota + rootb < rootc:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b,c = map(float,input().split())
import decimal

roota = decimal.Decimal.sqrt(a)
rootb = decimal.Decimal.sqrt(b)
rootc = decimal.Decimal.sqrt(c)
if roota + rootb < rootc:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b,c = map(float,input().split())
from decimal import *

roota = Decimal.sqrt(a)
rootb = Decimal.sqrt(b)
rootc = Decimal.sqrt(c)
if roota + rootb < rootc:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
from decimal import *

roota = Decimal(a) ** Decimal(0.5)
rootb = Decimal(b) ** Decimal(0.5)
rootc = Decimal(c) ** Decimal(0.5)
n = 24
root_a = Decimal(str(roota)).quantize(Decimal(str(10**(n*-1))), rounding=ROUND_DOWN)
root_b = Decimal(str(rootb)).quantize(Decimal(str(10**(n*-1))), rounding=ROUND_DOWN)
root_c = Decimal(str(rootc)).quantize(Decimal(str(10**(n*-1))), rounding=ROUND_DOWN)

if root_a + root_b < root_c:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
import sympy
if sympy.sqrt(a)+sympy.sqrt(b) <sympy.sqrt(c):
  print("Yes")
else:
  print("No")
Problem p02756 (python)

Fixed submission:
from collections import deque
S = str(input())
Q = int(input())
d = deque()
reverse = 1
for i in S:
    d.append(i)
for j in range(Q):
  Query = input().split()
  if len(Query) == 1:
    reverse *= -1
  else:
    F = int(Query[1])
    C = str(Query[2])
    if reverse == 1:
      if F == 1:
        d.appendleft(C)
      elif F == 2:
        d.append(C)
    elif reverse == -1:
      if F == 1:
        d.append(C)
      elif F == 2:
        d.appendleft(C)
if reverse == -1:
    d.reverse()
ans = ''.join(d)
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import deque
S = list(map(str,input().split()))
Q = int(input())
Query = [list(map(str,input().split())) for _ in range(Q)]
d = deque(S)
for i in range(Q):
  if Query[i][0] == "1":
    d = d.rotate()
  elif Query[i][0] == "2":
    if Query[i][1] == "1":
      d.append(Query[i][2])
    elif Query[i][1] == "2":
      d.appendleft(Query[i][2])
ans = ''.join(d)
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import deque
S = list(map(str,input().split()))
Q = int(input())
Query = [list(map(str,input().split())) for _ in range(Q)]
d = deque(S)
for i in range(Q):
  if Query[i][0] == "1":
    d = ''.join(list(reversed(d)))
  elif Query[i][0] == "2":
    if Query[i][1] == "1":
      d.append(Query[i][2])
    elif Query[i][1] == "2":
      d.appendleft(Query[i][2])
ans = ''.join(d)
print(ans)
Problem p02767 (python)

Fixed submission:
N = int(input())
X = list(map(int,input().split()))
P = sum(X)/len(X)
P = round(P)
count = 0
for i in range(N):
  count += (X[i] - P)**2
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
X = list(map(int,input()))
import math
P = sum(X)/len(X)
count = 0
for i in range(N):
  count += (X[i] - P)**2
print(math.ceil(count))
Problem p02768 (python)

Fixed submission:
mod = 10**9 + 7
def cmb(n,r,mod):
	a=1
	b=1
	r = min(r,n-r)
	for i in range(r):
		a = a*(n-i)%mod
		b = b*(i+1)%mod
	return a*pow(b,mod-2,mod)%mod

n,a,b = map(int,input().split())
count = 0
all = pow(2,n,mod) - 1
nCa = cmb(n,a,mod)
nCb = cmb(n,b,mod)
ans = all - (nCa + nCb)
while (ans < 0):
  ans += mod
print(ans)

Buggy submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
count = 0
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル
    

for i in range(2, n + 1):
  g1.append( ( g1[-1] * i ) % mod )
  inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
  g2.append( (g2[-1] * inverse[-1]) % mod )
for j in range(2,n + 1):
  if j == a or i == b:
    pass
  else:
    count += cmb(n, j, p)
print(count)
Problem p02778 (python)

Fixed submission:
S = str(input())
S = "x"*len(S)
print(S)

Buggy submission (verdict: Runtime Error):
S = str(input())
for i in range(S):
  S = "x"*len(S)
print(S)

Buggy submission (verdict: Runtime Error):
S = input()
for i in range(S):
  S[i] = "x"
print(S)
Problem p02783 (python)

Fixed submission:
import math
 
H,A = list(map(int, input().split()))
 
print(math.ceil(H/A))

Buggy submission (verdict: Runtime Error):
import math
 
H,A = list(map(int, input().split()))
 
print(math.ceil(H/A)

Buggy submission (verdict: Runtime Error):
A,H= map(int, input().split())
count = 0
while H <= 0:
  H -= A
  count+=1
 print(count)
Problem p02784 (python)

Fixed submission:
H,N = map(int, input().split())
A = list(map(int, input().split()))
damage = sum(A)
if damage >= H:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
H,N,A = list(map(int, input().split()))
for i in A[N]:
  if H <= 0:
    break
  else:
    H -= A[i]
if set(A):
  print("Yes")
else:
  print("No")
Problem p02786 (python)

Fixed submission:
H = int(input())
enemy = 1
count = 0
while H >= 1:
  count += enemy
  enemy *= 2
  H //= 2
print(count)

Buggy submission (verdict: Runtime Error):
from math import ceil
H = int(input())
print(2**(ceil(H/2)+1)-1)

Buggy submission (verdict: Runtime Error):
H = map(int, input().split())
enemy = 1
count = 0
while H >= 1:
  count += enemy
  enemy *= 2
  H //= 2
print(count)
Problem p02787 (python)

Fixed submission:
H,N = map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(N)]
maxA = max(a for a,b in AB)
dp = [0]*(H+maxA)
for i in range(1,H + maxA):
  dp[i] = min(dp[i-a]+b for a,b in AB)
print(dp[H])

Buggy submission (verdict: Runtime Error):
H,N = map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(N)]
dp = [0]*(H+1)
for i in range(1,H + 1):
  dp[i] = min(dp[i-a]+b for a,b in AB)
print(dp[H])
Problem p02789 (python)

Fixed submission:
N,M = map(int,input().split())
if M >= N:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
if M >= N:
  print("Yes")
else
  print("No")
Problem p02791 (python)

Fixed submission:
N = int(input())
P = list(map(int,input().split()))
ans = 1
Pj = P[0]
for i in range(1,N):
  Pj = min(Pj,P[i])
  if P[i] <= Pj:
    ans += 1
  else:
    pass
print(ans)

Buggy submission (verdict: Runtime Error):
N,j = map(int,input().split())
P = list(map(int,input().split()))
count = 0
i = 0
while i < N:
  if P[i] <= P[j]:
    count += 1
print(count)
Problem p02801 (python)

Fixed submission:
x=input()
print(chr(ord(x)+1))

Buggy submission (verdict: Runtime Error):
C = [chr(i) for i in range(ord('a'), ord('z'))]
print(C.sort(C))
Problem p02802 (python)

Fixed submission:
N,M = map(int,input().split())
AC = 0
penalty = 0
AC_list = [0]*N
WA_list = [0]*N

for i in range(M):
  p,s = map(str,input().split())
  p = int(p)-1
  if s == "AC" and AC_list[p] == 0:
    AC += 1
    AC_list[p] = 1
    penalty += WA_list[p]
  elif s == "WA":
    WA_list[p] += 1
  if AC == N:
    break
print(AC,penalty)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
AC = 0
penalty = 0
AC_list = [0]*N
WA_list = [0]*N

for i in range(M):
  p,s = map(str,input().split())
  p = int(p-1)
  if s == "AC" and AC_list[p] == 0:
    AC += 1
    AC_list[p] = 1
    penalty += WA_list[p]
  elif s == "WA":
    WA_list[p] += 1
  if AC == N:
    break
print(AC,penalty)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
S = list(map(str,input().split()))
ac = 0
wa = 0
i = 0
j = 0
while j < n:
  while i < m:
    if S[i] == "AC":
      ac += 1
      i += 1
      j += 1
    else:
      wa += 1
      i += 1
print(ac)
print(wa)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
S = list(map(str,input().split()))
ac = 0
wa = 0
i = 0
j = 0
for j in range(n):
  for i in range(m):
    if S[i] == "AC":
      ac += 1
      i += 1
      j += 1
    else:
      wa += 1
      i += 1
print(ac)
print(wa)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
S = list(map(int,input().split()))
ac = 0
wa = 0
i = 0
j = 0
for j in range(n):
  for i in range(m):
    if S[i] == "AC":
      ac += 1
      i += 1
      j += 1
    else:
      wa += 1
      i += 1
print(ac)
print(wa)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
S = list(map(int,input().split()))
ac = 0
wa = 0
for j in range(n):
  for i in range(m):
    if S[i] == "AC":
      ac += 1
      i += 1
      j += 1
    else:
      wa += 1
      i += 1
print(ac)
print(wa)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
p,S = list(map(int,input().split()))
ac = 0
wa = 0
for j in range(n):
  for i in range(m):
    if S[i] == "AC":
      ac += 1
      i += 1
      j += 1
    else:
      wa = 0
      i += 1
Problem p02812 (python)

Fixed submission:
N = int(input())
S = str(input())
i = 0
count = 0
for i in range(N-2):
  if S[i] == "A" and S[i+1] == "B" and S[i+2] == "C":
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input().split())
S = str(input().split())
i = 0
count = 0
for i in range(N-2):
  if S[i] == "A" and S[i+1] == "B" and S[i+2] == "C":
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N = map(int,input().split())
S = str(input().split())
i = 0
count = 0
for i in range(N-1):
  if S[i] == "A" and S[i+1] == "B" and S[i+2] == "C":
    count += 1
print(count)
Problem p02813 (python)

Fixed submission:
N = int(input())
P = list(map(int,input().split()))
Q = list(map(int,input().split()))
import itertools
L = [list(i) for i in itertools.permutations(range(1, N+1), r=N)]
print(abs(L.index(P) - L.index(Q)))

Buggy submission (verdict: Runtime Error):
N = int(input())
P,Q = list(map(int,input().split()))
import itertools
L = [list(i) for i in itertools.permutations(range(1, N+1), r=N)]
print(abs(L.index(P) - L.index(Q)))

Buggy submission (verdict: Runtime Error):
import itertools
P,Q = list(map(int,input().split()))
N = int(input())
L = [list(i) for i in itertools.permutations(range(1, N+1), r=N)]
print(abs(L.index(P) - L.index(Q)))
Problem p02817 (python)

Fixed submission:
S,T = map(str,input().split())
print(T + S)

Buggy submission (verdict: Runtime Error):
S = str,input().split()
T = str,input().split()

print(T + S)
Problem p02818 (python)

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

Buggy submission (verdict: Runtime Error):
A,B,K = map(int,input().split())
if K <= A:
  print(A-K,B)
elif K > A:
  print(0,A+B-K) 
elif K == A+B
  print(0,0)
Problem p02830 (python)

Fixed submission:
N = int(input())
S,T = list(map(str,input().split()))
list_ans = []
for i in range(N):
  list_ans.extend(S[i] + T[i])
  i += 1
ans = ''.join(list_ans)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S,T = list(map(str,input().split()))
ans = []*N 
for i in range(N):
  ans[i] = S[i] + T[i]
  i += 1
print(sum(ans))
Problem p02837 (python)

Fixed submission:
N = int(input())
A = [[] for _ in range(N)]
for i in range(N):
  m = int(input())
  for _ in range(m):
    x,y = map(int,input().split())
    x -= 1
    A[i].append((x,y))
ans = 0

for i in range(1<<N):
  d = [0]*N
  for j in range(N):
    if (i>>j&1):
      d[j] = 1
  flag = True
  for j in range(N):
    if d[j]:
      for k,l in A[j]:
        if d[k] == l:
          continue
        if d[k] != l:
          flag = False
      if not flag:
        break
  if flag:
    ans = max(ans,sum(d))
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
g = [[-1]*15]*15
for i in range(N):
    a = int(input())
    for _ in range(a):
        x,y = map(int,input().split())
        g[i][x] = y
ans = 0

for i in range(1<<N):
  d = [0]*N
  for j in range(N):
    if (i>>j&1):
      d[j] = 1
  flag = True
  for j in range(N):
    if d[j] == 1:
      for k in range(N):
        if g[j][k] == -1:
          continue
        if g[j][k] != d[k]:
          flag = False
  if flag:
    ans = max(ans,sum(d))
print(ans)
Problem p02855 (python)

Fixed submission:
import numpy as np
H,W,K = map(int,input().split())
S = [list(str(input())) for _ in range(H)]

l = np.array([['0' for _ in range(W)]]*H)
l = l.tolist()
k= 1
for i in range(H):
  for j in range(W):
    if S[i][j] == '#':
      l[i][j] = str(k)
      k += 1
for i in range(H):
  for j in range(W):
    if l[i][j] == '0':
      if i > 0:
        l[i][j] = l[i-1][j]
      else:
        for m in range(1,H-i):
          if l[i+m][j] != '0':
            l[i][j] = l[i+m][j]
            break
for i in range(H):
  for j in range(W):
    if l[i][j] == '0':
      if j > 0:
        l[i][j] = l[i][j-1]
      else:
        for m in range(1,W-j):
          if l[i][j+m] != '0':
            l[i][j] = l[i][j+m]
            break
  print(' '.join(l[i]))

Buggy submission (verdict: Runtime Error):
import numpy as np
H,W,K = map(int,input().split())
S = [list(str(input())) for _ in range(W)]

l = np.array([[0 for _ in range(W)]]*H)
l = l.tolist()
k= 1
for i in range(H):
  for j in range(W):
    if S[i][j] == '#':
      l[i][j] = str(k)
      k += 1
for i in range(H):
  for j in range(W):
    if l[i][j] == 0:
      if j > 0:
        l[i][j] = l[i][j-1]
      else:
        for m in range(1,W-j):
          if l[i][j+m] != 0:
            l[i][j] = l[i][j+m]
            break
  print(' '.join(l[i]))

Buggy submission (verdict: Runtime Error):
import numpy as np
H,W,K = map(int,input().split())
S = [list(str(input())) for _ in range(W)]

l = np.array([[0 for _ in range(W)]]*H)
l = l.tolist()
k= 1
for i in range(H):
  for j in range(W):
    if S[i][j] == '#':
      l[i][j] = str(k)
      k += 1
for i in range(H):
  for j in range(W):
    if l[i][j] == 0:
      if j > 0:
        l[i][j] = l[i][j-1]
      else:
        for m in range(1,W-j):
          if l[i][j+m] != 0:
            l[i][j] = l[i][j+m]
            break
  print(' '.join(l[i]))
Problem p02861 (python)

Fixed submission:
N = int(input())
XY = [[0]*2]*N
dis = 0
for i in range(N):
  XY[i] = [int(_) for _ in input().split()]
for i in range(N):
  Xi = XY[i][0]
  Yi = XY[i][1]
  for j in range(N):
    Xj = XY[j][0]
    Yj = XY[j][1]
    dis += ((Xi-Xj)**2 + (Yi-Yj)**2)**0.5

print(dis/N)

Buggy submission (verdict: Runtime Error):
N = int(input())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
dis = 0
for i in range(N-1):
  dis = ((x[0])**2+(y[0])**2)**0.5
  dis += ((x[i]-x[i+1])**2+(y[i]-y[i+1])**2)**0.5
print(dis/N)

Buggy submission (verdict: Runtime Error):
N = int(input())
x,y = list(map(int,input().split()))
dis = 0
for i in range(N-1):
  dis = ((x[0])**2+(y[0])**2)**0.5
  dis += ((x[i]-x[i+1])**2+(y[i]-y[i+1])**2)**0.5
print(dis/N)
Problem p02923 (python)

Fixed submission:
N = int(input())
H = list(map(int,input().split()))
ans = []
count = 0
if len(H) == 1:
  print(0)
  exit()
for i in range(1,N):
  if H[i-1] < H[i]:
    ans.append(count)
    count = 0
  elif H[i-1] >= H[i]:
    count += 1
  if i == N-1:
    ans.append(count)

print(max(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int,input().split()))
ans = []
count = 0
for i in range(1,N):
  if H[i-1] < H[i]:
    ans.append(count)
    count = 0
  elif H[i-1] >= H[i]:
    count += 1
  if i == N-1:
    ans.append(count)

print(max(ans))
Problem p02946 (python)

Fixed submission:
K,X = map(int, input().split())
for i in range(X-K+1,X+K):
  if i <= X+K-1:
    print(i, end=" ")
  else:
    print(i)

Buggy submission (verdict: Runtime Error):
K,X = map(int, input().split())
for i in range(X-K+1,X+K):
  if i <= X+K-1:
    print(i, end="")
  else
    print(i)

Buggy submission (verdict: Runtime Error):
X = map(int, input().split())
for K in range(1,100):
  print(X - K)
for K in range(1,100):
  print(X + K)
Problem p02947 (python)

Fixed submission:
from collections import Counter
N = int(input())
S = [str(sorted(input())) for _ in range(N)]
count = 0
for i in Counter(S).values():
  count += i*(i-1)//2
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [input() for _ in range(N)]
check_box = []
ans = 0
for s in S:
  s = sorted(s)
  s = ''.join(s)
  print(s)
  print(check_box)
  if s in check_box:
    ans += 1
  else:
    check_box.append(s)
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter
N = int(input())
S = []
count = 0
for i in range(N):
  for j in range(i+1, N):
    if Counter(S[i]) == Counter(S[j]):
      count += 1
print(count)

Buggy submission (verdict: Runtime Error):
from collections import Counter
N = int(input())
S = list(map(str,input().split()))
count = 0
for i in range(N):
  for j in range(i+1, N):
    if Counter(S[i]) == Counter(S[j]):
      count += 1
    else:
      break
print(count)
Problem p02958 (python)

Fixed submission:
N = int(input())
p = list(map(int,input().split()))
p_sort = sorted(p)
count = 0
for i,j in zip(p,p_sort):
  if i != j:
    count += 1
if count == 0 or count == 2:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
N = int(input())
p = list(map(int,input().split()))
p_sort = sorted(p)
count = 0
for i,j in zip(p,p_sort):
  if p[i] != p[j]:
    count += 1
if count == 0 or count == 2:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
N = int(input())
p = list(map(str,input().split()))
p_sort = sorted(p)
count = 0
for i,j in zip(p,p_sort):
  if p[i] != p[j]:
    count += 1
if count == 0 or count == 2:
  print("YES")
else:
  print("NO")
Problem p02995 (python)

Fixed submission:
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)

A,B,C,D = map(int,input().split())
all_count = B-A+1
c_count = B//C - (A-1)//C
d_count = B//D - (A-1)//D
cd_count = B//lcm(C,D) - (A-1)//lcm(C,D)
ans = all_count - c_count - d_count + cd_count
print(ans)

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
C,D = map(int,input().split())
count = 0
for i in range(A,B+1):
  if i%C != 0 and i%D != 0:
    count += 1
    i += 1
  else:
    i += 1
    break
print(count)
Problem p02999 (python)

Fixed submission:
i = list(map(int, input().split()))
if i[0] < i[1]:
  print("0")
else:
  print("10")

Buggy submission (verdict: Runtime Error):
x = int(input())
a = int(input())
if x < a:
  print("0")
else:
  print("10")

Buggy submission (verdict: Runtime Error):
x = input()
a = input()
y = int(x)
b = int(a)
 
 
 
 
if y < b:
  print(0)
else:
  print(10)

Buggy submission (verdict: Runtime Error):
x = input()
a = intput()
 
 
 
 
if x < a:
  print("0")
else:
  print("10")

Buggy submission (verdict: Runtime Error):
x = int
a = int



 
if x < a:
  print(0)
else:
  print(10)

Buggy submission (verdict: Runtime Error):
x = int
a = int


 
if x < a:
  print(0)
else:
  print(10)

Buggy submission (verdict: Runtime Error):
x >= 0
x <= 9
a >= 0
a <= 9

if x < a 
  print(0)
else
  print(10)
Problem p03001 (python)

Fixed submission:
W,H,x,y = map(int, input().split())
answer = W*H/2
print(answer)
if W/2 == x and H/2 == y:
  print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
W,H,x,y = map(int, input().split())
answer = W*H/2
print(answer)
if W/2 == x && H/2 == y:
  print(1)
else:
  print(0)