-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10810.java
More file actions
25 lines (24 loc) · 843 Bytes
/
10810.java
File metadata and controls
25 lines (24 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import java.io.*;
import java.util.*;
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[] num = new int[N+1];
for(int x=0;x<M;x++){
st = new StringTokenizer(br.readLine());
int i = Integer.parseInt(st.nextToken());
int j = Integer.parseInt(st.nextToken());
int k = Integer.parseInt(st.nextToken());
for(int y=i;y<=j;y++){
num[y]=k;
}
}
for(int i=1;i<=N;i++){
System.out.print(num[i] + " ");
}
br.close();
}
}