본문 바로가기

Programming [Python]/백준 알고리즘 솔루션

#229 백준 파이썬 [10810] 공 넣기

https://www.acmicpc.net/problem/10810

 

Python Code

N, M = map(int, input().split())
basket = [0] * (N+1)

for _ in range(M):
    i, j, k = map(int, input().split())
    for n in range(i, j+1):
        basket[n] = k 

for i in range(1, N+1):
    print(basket[i], end = ' ')