Submission #517321

# Submission time Handle Problem Language Result Execution time Memory
517321 2022-01-23T03:28:57 Z bebecanvas Lost Array (NOI19_lostarray) C++14
100 / 100
28 ms 3240 KB
#include <bits/stdc++.h>

using namespace std;
#define int long long
#define endl '\n'

signed main(){
 
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    int n, m; cin >> n >> m;
    int a[100005];
    for(int i=0; i<=n; i++){a[i]=1;}
    
    for(int i=0; i<m; i++){
		int b, c, d; cin >> b >> c >> d;
		a[b]= max(a[b], d);
		a[c]= max(a[c], d);
	}
	
	for(int i=1; i<=n; i++){cout<< a[i] << " ";}
    
    
    
    

	
	
    
  
}


# Verdict Execution time Memory Grader output
1 Correct 1 ms 972 KB Output is correct
2 Correct 1 ms 972 KB Output is correct
3 Correct 1 ms 972 KB Output is correct
4 Correct 1 ms 972 KB Output is correct
5 Correct 1 ms 972 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 972 KB Output is correct
2 Correct 1 ms 972 KB Output is correct
3 Correct 1 ms 972 KB Output is correct
4 Correct 1 ms 972 KB Output is correct
5 Correct 1 ms 972 KB Output is correct
6 Correct 2 ms 1100 KB Output is correct
7 Correct 1 ms 1084 KB Output is correct
8 Correct 6 ms 1232 KB Output is correct
9 Correct 1 ms 1104 KB Output is correct
10 Correct 5 ms 1232 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 972 KB Output is correct
2 Correct 1 ms 972 KB Output is correct
3 Correct 1 ms 972 KB Output is correct
4 Correct 1 ms 972 KB Output is correct
5 Correct 1 ms 972 KB Output is correct
6 Correct 2 ms 1100 KB Output is correct
7 Correct 1 ms 1084 KB Output is correct
8 Correct 6 ms 1232 KB Output is correct
9 Correct 1 ms 1104 KB Output is correct
10 Correct 5 ms 1232 KB Output is correct
11 Correct 1 ms 976 KB Output is correct
12 Correct 2 ms 1104 KB Output is correct
13 Correct 1 ms 1084 KB Output is correct
14 Correct 1 ms 1104 KB Output is correct
15 Correct 2 ms 1104 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 972 KB Output is correct
2 Correct 8 ms 972 KB Output is correct
3 Correct 11 ms 1096 KB Output is correct
4 Correct 4 ms 972 KB Output is correct
5 Correct 2 ms 972 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 972 KB Output is correct
2 Correct 1 ms 972 KB Output is correct
3 Correct 1 ms 972 KB Output is correct
4 Correct 1 ms 972 KB Output is correct
5 Correct 1 ms 972 KB Output is correct
6 Correct 2 ms 1100 KB Output is correct
7 Correct 1 ms 1084 KB Output is correct
8 Correct 6 ms 1232 KB Output is correct
9 Correct 1 ms 1104 KB Output is correct
10 Correct 5 ms 1232 KB Output is correct
11 Correct 1 ms 976 KB Output is correct
12 Correct 2 ms 1104 KB Output is correct
13 Correct 1 ms 1084 KB Output is correct
14 Correct 1 ms 1104 KB Output is correct
15 Correct 2 ms 1104 KB Output is correct
16 Correct 4 ms 972 KB Output is correct
17 Correct 8 ms 972 KB Output is correct
18 Correct 11 ms 1096 KB Output is correct
19 Correct 4 ms 972 KB Output is correct
20 Correct 2 ms 972 KB Output is correct
21 Correct 17 ms 2080 KB Output is correct
22 Correct 14 ms 2124 KB Output is correct
23 Correct 18 ms 2352 KB Output is correct
24 Correct 19 ms 2464 KB Output is correct
25 Correct 28 ms 3240 KB Output is correct