Submission #1134996

#TimeUsernameProblemLanguageResultExecution timeMemory
1134996definitelymaybeLost Array (NOI19_lostarray)C++20
100 / 100
52 ms1092 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long const ll maxn= 1e5 + 10; ll mx[maxn]; int main() { ll m, n; cin >> n >> m; for (int i = 0; i < m; i ++) { ll a,b,c; cin >> a >> b >> c; // min(x[a], x[b]) = c; mx[a] = max(mx[a], c); mx[b] = max(mx[b], c); } for (int i = 1; i <= n; i++) { if (mx[i] > 0) { cout << mx[i] << " "; } else { cout << 1 << " "; } } }
#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...