Submission #567538

#TimeUsernameProblemLanguageResultExecution timeMemory
567538CaroLindaLost Array (NOI19_lostarray)C++14
100 / 100
30 ms2592 KiB
#include <bits/stdc++.h> #define lp(i,a,b) for(int i = a ; i < b ;i++ ) #define pb push_back #define ll long long #define all(x) x.begin(),x.end() #define sz(x) (int)x.size() #define mk make_pair #define ff first #define ss second #define pii pair<int,int> const int MAXN = 1e5+10 ; using namespace std ; int N , M ; int A[MAXN] ; int main(){ ios_base::sync_with_stdio(false) ; cin.tie(0) ; cin >> N >> M ; fill(A+1,A+1+N , 1 ) ; for(int i =1 , a ,b , c ; i <= M ; i++ ){ cin >> a >> b >> c ; A[a] = max(A[a] , c ) ; A[b] = max(A[b] , c ) ; } for(int i =1 ; i <= N ; i++ ) cout << A[i] << " "; cout << "\n" ; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...