This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |