Submission #522045

#TimeUsernameProblemLanguageResultExecution timeMemory
522045blueLost Array (NOI19_lostarray)C++17
100 / 100
83 ms2548 KiB
#include <iostream> #include <vector> using namespace std; using vi = vector<int>; int main() { int N, M; cin >> N >> M; vi res(1+N, 1); for(int j = 1; j <= M; j++) { int A, B, C; cin >> A >> B >> C; for(int z : {A, B}) res[z] = max(res[z], C); } for(int i = 1; i <= N; i++) cout << res[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...