import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int n = Integer.parseInt(st.nextToken());
int m = Integer.parseInt(st.nextToken());
int[] balls = new int[n];
for(int i=0; i<m; i++){
st = new StringTokenizer(br.readLine());
int a = Integer.parseInt(st.nextToken());
int b = Integer.parseInt(st.nextToken());
int k = Integer.parseInt(st.nextToken());
for(int j=a; j<=b; j++){
balls[j - 1] = k;
}
}
StringBuilder sb = new StringBuilder();
for(int ball : balls){
sb.append(ball + " ");
}
System.out.println(sb);
br.close();
}
}
'Coding Test > 백준' 카테고리의 다른 글
[백준/자바] 5597 - 과제 안 내신 분..? (0) | 2023.05.08 |
---|---|
[백준/자바] 10813 - 공 바꾸기 (0) | 2023.05.08 |
[백준/자바] 1152 - 단어의 개수 (0) | 2023.05.07 |
[백준/자바] 10818 - 최소, 최대 (0) | 2023.05.06 |
[백준/자바] 10951 - A+B - 4 (0) | 2023.05.06 |