Submission #647504

#TimeUsernameProblemLanguageResultExecution timeMemory
647504LeonaRagingLost Array (NOI19_lostarray)C++14
100 / 100
28 ms2600 KiB
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define ll long long #define pb push_back #define db(val) "[" #val " = " << (val) << "] " const ll mod = 1e9 + 7; const int maxn = 1e5 + 4; const int INF = 1e9; int n, m, q, res[maxn]; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); //freopen(".INP", "r", stdin); //freopen(".OUT", "w", stdout); cin >> n >> m; fill(res + 1, res + 1 + n, 1); for (int i = 1; i <= m; i++) { int a, b, x; cin >> a >> b >> x; res[a] = max(res[a], x); res[b] = max(res[b], x); } for (int i = 1; i <= n; i++) cout << res[i] << ' '; }
#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...