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

Fixed submission:
N=int(input())
H=list(map(int,input().split()))
a=[0]*N
max_i=0
for i in range(1,N):
	if(H[i-1]>=H[i]):
		a[i]=a[i-1]+1
		if(max_i<a[i]):max_i=a[i]
print(max_i)

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

import numpy as np
print(np.max(a))
Problem p02922 (python)

Fixed submission:
A, B = map(int, input().split())
empty = 1
socket = 0
while empty < B:
    empty += A - 1
    socket += 1
print(socket)

Buggy submission (verdict: Runtime Error):
import math
A, B = map(int, input().split())
print(math.ceil((B-1)/(A-1))
Problem p02923 (python)

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

if N == 1:
    print(0)
    quit()
start = N - 1
moves = []
for i in range(N-1, 0, -1):
    if H[i] <= H[i-1]:
        continue
    moves.append(start - i)
    start = i - 1
if H[1] <= H[0]:
    moves.append(start - i + 1)
print(max(moves))

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
start = N - 1
moves = []
for i in range(N-1, 0, -1):
    if H[i] <= H[i-1]:
        continue
    moves.append(start - i)
    start = i - 1
if H[1] <= H[1]:
    moves.append(start - i + 1)
print(max(moves))
Problem p02988 (python)

Fixed submission:
n = int(input())
p_list = list(map(int, input().split()))
count = 0
for i in range(len(p_list)-2):
  if (p_list[i]<p_list[i+1] and p_list[i+1]<p_list[i+2]) or (p_list[i]>p_list[i+1] and p_list[i+1]>p_list[i+2]):
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
    n = int(input())
    p_list = list(map(int, input().split()))
    count = 0
    for i in range(len(p_list)-2):
    	if (p_list[i]<p_list[i+1] and p_list[i+1]<p_list[i+2]) or (p_list[i]>p_list[i+1] and p_list[i+1]>p_list[i+2]):
    		count += 1
    print(count)
Problem p02995 (python)

Fixed submission:
from fractions import gcd
A, B, C, D = map(int, input().split())
if(A % C == 0):
    c_div = (B // C) - (A // C) + 1
else:
    c_div = (B // C) - (A // C + 1) + 1
if(A % D == 0):
    d_div = (B // D) - (A // D) + 1
else:
    d_div = (B // D) - (A // D + 1) + 1
cd_lcm = (C * D) // gcd(C, D)
if(A % cd_lcm == 0):
    cd_div = (B // cd_lcm) - (A // cd_lcm) + 1
else:
    cd_div = (B // cd_lcm) - (A // cd_lcm + 1) + 1
print((B - A) - (c_div + d_div - cd_div) + 1)

Buggy submission (verdict: Runtime Error):
from math import gcd
A, B, C, D = map(int, input().split())
if(A % C == 0):
    c_div = (B // C) - (A // C) + 1
else:
    c_div = (B // C) - (A // C + 1) + 1
if(A % D == 0):
    d_div = (B // D) - (A // D) + 1
else:
    d_div = (B // D) - (A // D + 1) + 1
cd_lcm = (C * D) // gcd(C, D)
cd_div = (B // cd_lcm) - (A // cd_lcm + 1) + 1
print((B - A) - (c_div + d_div - cd_div) + 1)
Problem p03324 (python)

Fixed submission:
D, N = map(int, input().split())
if N == 100:
	print(100**D*(N+1))
else:	
	print(100**D*N)

Buggy submission (verdict: Runtime Error):
D, N = map(int, input().split())
if N == 100:
	print(100**D*(N+1)
else:	
	print(100**D*N)
Problem p02923 (python)

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

cnt = 0
ret = 0
for i in range(N-1):
  if H[i] >= H[i+1]:
    cnt += 1
  else:
    ret = max(cnt,ret)
    cnt = 0
  if i == N-2:
    ret = max(cnt,ret)
print(ret)

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


getter = 0
def solver(now,count,to):
  global getter
  if now+1 < len(H) and H[now] >= H[now+1] and to != 2:
    solver(now+1,count+1,1)
  getter = max(getter,count)

for i in range(N):
  solver(i,0,0)

print(getter)
Problem p02924 (python)

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

Buggy submission (verdict: Runtime Error):
import itertools

N = int(input())

NUMBERS = list(itertools.permutations(range(N)))
ret = 0
for numbers in NUMBERS:
  sum = 0
  for num,i in zip(numbers,range(N)):
    sum += (num+1)%(i+1)
  ret = max(ret,sum)

print(ret)
Problem p02936 (python)

Fixed submission:
import collections

n,q=map(int,input().split())
cnt=[0]*(n+1)
g=[[] for _ in range(n+1)]
for _ in range(n-1):
  a,b=map(int,input().split())
  g[a].append(b)
  g[b].append(a)
for _ in range(q):
  v,val=map(int,input().split())
  cnt[v]+=val
q=collections.deque()
q.append(1)
checked=[0]*(n+1)
while q:
  v=q.pop()
  checked[v]=1
  for u in g[v]:
    if checked[u]==1:
      continue
    cnt[u]+=cnt[v]
    q.append(u)
print(*cnt[1:])

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

to = [[] for _ in range(N)]

counter = [0]*N

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

def dfs(p,x):
  counter[p] += x
  if flag[p]: return
  flag[p] = True
  for cmd in to[p]:
    if p < cmd: dfs(cmd,x)

for i in range(Q):
  flag = [False]*N
  p,x = map(int,input().split())
  dfs(p-1,x)

#print(to)

print(*counter)

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

to = [[] for _ in range(N)]

counter = [0]*N

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

def dfs(p,x):
  counter[p] += x
  if flag[p]: return
  flag[p] = True
  for cmd in to[p]:
    if p < cmd: dfs(cmd,x)

for i in range(Q):
  flag = [False]*N
  p,x = map(int,input().split())
  dfs(p-1,x)

#print(to)

print(counter)
Problem p03844 (python)

Fixed submission:
def iroha():
    a, op, b = map(str, input().split())
    a = int(a)
    b = int(b)

    if op == "+":
        result = a + b
    else:
        result = a - b

    print(result)




if __name__ == "__main__":
    iroha()

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

    if op == "+":
        result = a + b
    else:
        result = a - b

    print(result)

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

    if op == "+":
        result = a + b
    else:
        result = a - b

    print(result)

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

    if op == "+":
        result = a + b
    else:
        result = a - b

    print(result
Problem p03860 (python)

Fixed submission:
def iroha():
    head, string, heel = map(str, input().split())
    headC = head[0]
    Capital = string[0]
    heelC = heel[0]
    print(headC + Capital + heelC)

if __name__ == "__main__":
    iroha()

Buggy submission (verdict: Runtime Error):
string = input()
    Capital = string[0]
    print("A" + Capital + "C")
Problem p03962 (python)

Fixed submission:
def iroha():
    a, b, c = map(int, input().split())
    if a == b and b == c and a == c:
        print(1)
    elif a != b and b != c and a != c:
        print(3)
    else:
        print(2)

if __name__ == "__main__":
    iroha()

Buggy submission (verdict: Runtime Error):
def iroha():
    a, b, c = map(int, input().split())
    if a == b and b == c and a == c:
        print(1)
    elif a != b and b != c and a != c:
        print(3)
    elif else:
        print(2)

if __name__ == "__main__":
    iroha()

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
    if a == b == c:
        print(1)
    elif a != b != c:
        print(3)
    else:
        print(2)
Problem p04011 (python)

Fixed submission:
def iroha():
    n, k, price, special = [int(input()) for i in range(4)]
    result = 0
    for i in range(n):
        if i < k:
            result += price
        else:
            result += special
    print(result)

if __name__ == "__main__":
    iroha()

Buggy submission (verdict: Runtime Error):
    n, k, price, special = map(int, input().split())
    result = 0
    for i in range(n):
        if i < k:
            result += price
        else:
            result += special

Buggy submission (verdict: Runtime Error):
    n, k, price, special = map(int, input().split())
    result = 0
    for i in range(n):
        if i < k:
            result += price
        else:
            result += special
    
    print(result)

Buggy submission (verdict: Runtime Error):
def iroha():
    n, k, price, special = map(int, input().split())
    result = 0
    for i in range(n):
        if i < k:
            result += price
        else:
            result += special
    
    print(result)
            

if __name__ == "__main__":
    iroha()

Buggy submission (verdict: Runtime Error):
def iroha():
    n, k, price, special = map(int, input().split())
    result = 0
    for i in range(n):
        if i < k:
            result += price
        else:
            result += special
    
    print(result)
            

if __name__ == "__main__":
    iroha()

Buggy submission (verdict: Runtime Error):
n, k, price, special = map(int, input().split())
    result = 0
    for i in range(n):
        if i < k:
            result += price
        else:
            result += special
    
    print(result)
Problem p04029 (python)

Fixed submission:
def iroha():
    count = int(input())
    result = 0
    for i in range(count+1):
        result += i

    print(result)


if __name__ == "__main__":
    iroha()

Buggy submission (verdict: Runtime Error):
def iroha():
    count = int(input())
    result = 0
    for i in range(count+1):
        result += i

    print(result)


if __name__ == "__main__":
    iroha(

Buggy submission (verdict: Runtime Error):
  count = int(input())
    result = 0
    for i in range(count+1):
        print(i)
        result += i

    print(result
Problem p02921 (python)

Fixed submission:
S = input()
T = input()
 
q = 0
for n in range(3):
  if S[n] ==T[n]:
    q +=1
print(q)

Buggy submission (verdict: Runtime Error):
list(S)
list(T)

a=0

if S[0] = T[0]:
  a = a + 1

if S[1] = T[1]:
  a = a + 1

if S[2] = T[2]:
  a = a +1
Problem p02922 (python)

Fixed submission:
A, B = map(int, input().split())
for x in range(20):
  s = (A-1)*(x-1) + A
  if B<=s:
    print(x)
    exit()

Buggy submission (verdict: Runtime Error):
A,B = map(int, input().split())
for x in range(20):
  s = (A-1)*(x-1)+A
  if B <= s:
    print(x)
	break
Problem p02923 (python)

Fixed submission:
N = int(input())
H = list(map(int,input().split()))
s = 0
l =[0]
for n in range(N-1):
  if H[n]>=H[n+1]:
    s += 1
    l.append(s)
  else:
    l.append(s)
    s = 0
print(max(l))

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int,input().split()))
s = 0
l =[]
for n in range(N-1):
  if H[n]>=H[n+1]:
    s += 1
    l.append(s)
  else:
    l.append(s)
    s = 0
print(max(l))

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int,input().split()))
l =[]
for n in range(N-1):
  s = 0
  for j in range(n+1,N):
    if H[n] >= H[j]:
      s += 1
    else:
      l.append(s)
      break
print(max(l))

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int,input().split()))
l =[]
for n in range(N):
  s = 0
  for j in range(N-1):
    if H[n] >= H[j+1]:
      s += 1
    else:
      l.append(s)
print(max(l))
Problem p02936 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**7)
input=sys.stdin.readline

n, q = map(int, input().split())
t = [[] for i in range(n)]# 空の2次元配列を作る
for i in range(n-1):
    a, b = map(int, input().split())
    t[a - 1].append(b -1)
    t[b - 1].append(a -1)
# 配列は０から始まるから１、２、３、４の木を０、１、２、３として扱ってる
# 配列の０番目（つまり頂点０）が持つ値がその頂点が持つリンクとなる

v = [0] * (n) #空の配列を作る
for j in  range(q):# 0からqまで
    a, b = map(int, input().split())
    v[a-1] += b


def csum(now, bef):  # 累積和
    for nxt in t[now]:
        if nxt != bef:
            v[nxt] += v[now]
            csum(nxt, now)

csum(0, -1)
print(*v)

Buggy submission (verdict: Runtime Error):
n, q = map(int, input().split())
t = [[] for i in range(n)]# 空の2次元配列を作る
for i in range(n-1):
    a, b = map(int, input().split())
    t[a - 1].append(b -1)
    t[b - 1].append(a -1)
# 配列は０から始まるから１、２、３、４の木を０、１、２、３として扱ってる
# 配列の０番目（つまり頂点０）が持つ値がその頂点が持つリンクとなる

v = [0] * (n) #空の配列を作る
for j in  range(q):# 0からqまで
    a, b = map(int, input().split())
    v[a-1] += b


def csum(now, bef):  # 累積和
    for nxt in t[now]:
        if nxt != bef:
            v[nxt] += v[now]
            csum(nxt, now)

csum(0, -1)
print(*v)

Buggy submission (verdict: Runtime Error):
n, q = map(int, input().split())
t = [[] for i in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    t[a - 1].append(b -1)
    t[b - 1].append(a -1)

v = [0] * (n)
for j in  range(q):
    a, b = map(int, input().split())
    v[a-1] += b


def csum(now, bef):
    for nxt in t[now]:
        if nxt != bef:
            v[nxt] += v[now]
            dfs(nxt, now)

csum(0, -1)
print(*v)
Problem p03105 (python)

Fixed submission:
A, B, C = map(int, input().split())#入力された値を空白で区切ってその値をint型に変換して代入している
print(min(int(B / A), C))#intで囲うことで少数を切り捨てている

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
a_set = {1}
b_set = {1}
for i in range(1,a):
    if a % i == 0:
        a_set.add(i)

for i in range(1,b):
    if b % i == 0:
        b_set.add(i)

c_list = list(a_set & b_set)
c_list.sort()
print(c_list[c - 1])

Buggy submission (verdict: Runtime Error):
a = int(input())#一回にかかる料金
b = int(input())#所持している金額
c = int(input())#満足する回数
if b//a > c:
    print(c)
else:
    print(b//c)
Problem p02934 (python)

Fixed submission:

N = int(input())
An = [int(x) for x in input().split()]

num = 0
for i in An:
	num += 1/i

print(1/num)

Buggy submission (verdict: Runtime Error):
N = int(input)
An = [int(x) for x in input().split()]

num = 0.
for i in An:
  num += 1/i

print(1/num)
Problem p02921 (python)

Fixed submission:
s = input(); a = input(); c = 0
for i in range(3):
  if s[i] == a[i]: c += 1
print(c)

Buggy submission (verdict: Runtime Error):
s = input(); a = input(); c = 0
for i in range(4):
  if s[i] == a[i]: c += 1
print(c)
Problem p02922 (python)

Fixed submission:
a, b = [int(i) for i in input().split()]
print(min([num for num in range(0, 20) if (a - 1) * (num - 1) + a >= b]))

Buggy submission (verdict: Runtime Error):
a, b = [int(i) for i in input().split()]
print(min([num for num in range(1, 20) if (a - 1) * (num - 1) + a > b]))
Problem p03605 (python)

Fixed submission:
print('Yes' if '9' in input() else 'No')

Buggy submission (verdict: Runtime Error):
x, t = map(int, input().split())
print(x - t if x -t > 0 else 0)
Problem p03944 (python)

Fixed submission:
w, h, n = map(int, input().split())
l = [list(map(int, input().split())) for i in range(n)]
x = [x_i for x_i in range(w + 1)]
y = [y_i for y_i in range(h + 1)]
for l_e in l:
    if l_e[2] == 1:
        x = [i for i in x if i > l_e[0] - 1]
    elif l_e[2] == 2:
        x = [i for i in x if i < l_e[0] + 1]
    elif l_e[2] == 3:
        y = [i for i in y if i > l_e[1] - 1]
    else:
        y = [i for i in y if i < l_e[1] + 1]
print(0 if len(x) == 0 or len(y) == 0 else (x[-1] - x[0]) * (y[-1] - y[0]))

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

CoordinateList = []
for i in range(N):
    x,y,a = map(int, input().split())
    CoordinateList.append([x,y,a])

# raw White & Black
AllArea = []
for numline in range(H):
    rawWhite = []
    rawBlack = []
    for numraw in range(W):
        rawWhite.append("W")
        rawBlack.append("B")
    AllArea.append(rawWhite)

# coloring from white to Black
for n in range(N):
    if CoordinateList[n][2] == 1:
        if CoordinateList[n][0] == 0:
            pass
        else:
            for i in range(H):
                del AllArea[i][:(CoordinateList[n][0])]
                for numX in range(CoordinateList[n][0]):
                    AllArea[i].insert(0,"B")

    elif CoordinateList[n][2] == 2:
        if CoordinateList[n][0] == 0:
            print(0)
            exit()
        else:
            for i in range(H):
                del AllArea[i][(CoordinateList[n][0]):]
                for numX in range(CoordinateList[n][0]):
                    AllArea[i].append("B")

    elif CoordinateList[n][2] == 3:
        changeY = H - int(CoordinateList[n][1])
        if changeY == 0:
            print(0)
            exit()
        else:
            del AllArea[changeY:]
            for changeRaw in range(changeY):
                AllArea.append(rawBlack)

    elif CoordinateList[n][2] == 4:
        changeY = H - int(CoordinateList[n][1]) 
        if changeY == 0:
            pass
        else:
            del AllArea[:changeY]
            for changeRaw in range(changeY):
                AllArea.insert(0,rawBlack)
            
            
# counting 
AreaWhite = 0
for i in range(H):
    AreaWhite += AllArea[i].count("W")

print(AreaWhite)

Buggy submission (verdict: Runtime Error):
w, h, n = map(int, input().split())
l = [list(map(int, input().split())) for i in range(n)]
x = [x_i for x_i in range(w + 1)]
y = [y_i for y_i in range(h + 1)]
for l_e in l:
    if l_e[2] == 1:
        x = x[l_e[0]:]
    elif l_e[2] == 2:
        x = x[:l_e[0]]
    elif l_e[2] == 3:
        y = y[l_e[1]:]
    else:
        y = y[:l_e[1]]
print((x[-1] - x[0]) * (x[-1] - x[0]))
Problem p03030 (python)

Fixed submission:
n = int(input())
SP = []
for i in range(n):
    s, p = input().split()
    SP.append([s, int(p), i+1])
SP.sort(key=lambda x: (x[0], -x[1]))
for _, _, i in SP:
    print(i)

Buggy submission (verdict: Runtime Error):
print(*sorted(range(1,int(input())+1),key=lambda _:[(s,-int(p))for s,p in input().split()]))
Problem p03304 (python)

Fixed submission:
# -*- coding: utf-8 -*-

n, m, d = map(int, input().split())
if d == 0:
    print(((n-d)/(n**2))*(m-1))
else:
    print((2*(n-d)/(n**2))*(m-1))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

from random import choices

n, m, d = map(int, input().split())
if n > 10**3*5 or m > 10**3*5:
    _max = max(n, m)
    n = max(1, int(n // (_max/10**3*5)))
    m = max(2, int(m // (_max/10**3*5)))
    d = int(d // (_max/10**3*5))

_sum = 0
for i in range(10**3*5):
    A = choices(list(range(1, n+1)), k=m)
    # print(A)
    for j in range(m-1):
        if abs(A[j] - A[j+1]) == d:
            _sum += 1

print(_sum/(10**3*5))
Problem p03309 (python)

Fixed submission:
# -*- coding: utf-8 -*-

n = int(input())
A = list(map(int, input().split()))
A = [A[i]-(i+1) for i in range(n)]
A.sort()

if n == 1:
    print(0)
    exit()

ans = 10**100
for i in [n//2-1, n//2]:
    ans = min(ans, sum([abs(A[j]-A[i]) for j in range(n)]))

print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

n = int(input())
A = list(map(int, input().split()))
A = [A[i]-(i+1) for i in range(n)]
A.sort()

ans = 10**100
for i in [n//2-1, n//2, n//2+1]:
    ans = min(ans, sum([abs(A[j]-A[i]) for j in range(n)]))

print(ans)
Problem p03323 (python)

Fixed submission:
# -*- coding: utf-8 -*-

a, b = map(int, input().split())
if a <= 8 and b <= 8:
    print('Yay!')
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

a = int(input())
b = int(input())
if a <= 8 and b <= 8:
    print('Yay!')
else:
    print(':(')
Problem p03415 (python)

Fixed submission:
c = [input() for i in range(3)]
print(c[0][0] + c[1][1] + c[2][2])

Buggy submission (verdict: Runtime Error):
c = [list(map(str, input().split())) for i in range(3)]
print(c[0][0] + c[1][1] + c[2][2])
Problem p03495 (python)

Fixed submission:
# -*- coding: utf-8 -*-

n, k = map(int, input().split())
A = list(map(int, input().split()))

dict_A = {}
for a in A:
    if a not in dict_A:
        dict_A[a] = 1
    else:
        dict_A[a] += 1

if len(dict_A.keys()) <= k:
    print(0)
    exit()

sorted_A = sorted(dict_A.items(), key=lambda x: x[1])

ans = 0
for i in range(len(dict_A.keys())-k):
    ans += sorted_A[i][1]

print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

n, k = map(int, input().split())
A = list(map(int, input().split()))

dict_A = {i: 0 for i in range(1, n+1)}
for a in A:
    dict_A[a] += 1

num_list = [[] for _ in range(n)]
for key in dict_A.keys():
    num_list[dict_A[key]].append(key)

ans = 0
count = len(dict_A.keys())
pointer = 1
while count > k:
    if len(num_list[pointer]) == 0:
        pointer += 1
        continue
    ans += pointer
    count -= 1
    del num_list[pointer][0]
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

n, k = map(int, input().split())
A = list(map(int, input().split()))

dict_A = {}
for a in A:
    if a not in dict_A:
        dict_A[a] = 1
    else:
        dict_A[a] += 1

num_list = [[] for _ in range(n)]
for key in dict_A.keys():
    num_list[dict_A[key]].append(key)

ans = 0
count = len(dict_A.keys())
pointer = 1
while count > k:
    if len(num_list[pointer]) == 0:
        pointer += 1
        continue
    ans += pointer
    count -= 1
    del num_list[pointer][0]
print(ans)
Problem p03543 (python)

Fixed submission:
# -*- coding: utf-8 -*-

n = input()
if n[0] == n[1] and n[1] == n[2]:
    print('Yes')
elif n[1] == n[2] and n[2] == n[3]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

n = input()
if n[0] == n[1] and n[1] == n[2]:
    print('Yes')
elif n[1] == n[2] and n[3] == n[4]:
    print('Yes')
else:
    print('No')
Problem p03720 (python)

Fixed submission:
# -*- coding: utf-8 -*-

n, m = map(int, input().split())

A = {}
for i in range(1, n+1):
    A[i] = 0
for i in range(m):
    data = list(map(int, input().split()))
    A[data[0]] += 1
    A[data[1]] += 1

for i in range(1, n+1):
    print(A[i])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

n, m = map(int, input().split())
A = {}
for i in range(m):
    data = list(map(int, input().split()))
    if data[0] not in A:
        A[data[0]] = 1
    else:
        A[data[0]] += 1
    if data[1] not in A:
        A[data[1]] = 1
    else:
        A[data[1]] += 1

for i in range(1, n+1):
    print(A[i])
Problem p02973 (python)

Fixed submission:
import bisect
n = input()
aa = []
xx = [-input()]
for _ in xrange(n - 1):
    aa.append(-input())
for a in aa:
    if a >= xx[-1]:
        xx.append(a)
    else:
        i = bisect.bisect_right(xx, a)
        if i == len(xx):
          i -= 1
        xx[i] = a
print len(xx)

Buggy submission (verdict: Runtime Error):
n = input()
aa = []
xx = [-input()]
for _ in xrange(n - 1):
    aa.append(-input())
for a in aa:
    if a >= xx[-1]:
        xx.append(a)
    else:
        i = bisect.bisect_right(xx, a)
        if i == len(xx):
          i -= 1
        xx[i] = a
print len(xx)

Buggy submission (verdict: Runtime Error):
n = input()
aa = []
xx = [-input()]
for _ in xrange(n - 1):
    aa.append(-input())
for a in aa:
    if a >= xx[-1]:
        xx.append(a)
    else:
        i = bisect.bisect_right(xx, a)
        if i == len(xx):
          i -= 1
          xx[i] = a
print len(xx)
Problem p02923 (python)

Fixed submission:
N = int(input())
line1 = list(map(int, input().split()))
a,max = 0,0
for i in range(len(line1) - 1):
    if line1[i] >= line1[i+1]:
        a += 1
        if max < a:
            max = a
            
    else:
        a = 0
        
print(max)

Buggy submission (verdict: Runtime Error):
N = int(input())
line1 = list(map(int, input().split()))
line2 =[]

for i in range(len(line1) - 1):
    #print(str(i)+ "番目")
    a = 0
    for j in range(len(line1) - i - 1):
        #print(str(j)+"ばんめ")
        #print(line1[i+j],line1[i+j+1])
        if line1[i+j] >= line1[i+j+1]:
            a += 1
        else:
          #  print( "a=" + str(a))
         #   print()
            line2.append(a)
            break
        #print( "a=" + str(a))
       # print()
        line2.append(a)

print(max(line2))
Problem p03963 (python)

Fixed submission:
N,K = map(int, input().split())
print(K * (K-1)**(N-1))

Buggy submission (verdict: Runtime Error):
N,K = map(int, input().split())
print(K * (k-1)**(N-1))