# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
899598 | pcc | Lost Array (NOI19_lostarray) | C++14 | 22 ms | 3940 KiB |
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 <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define fs first
#define sc second
#define tlll tuple<ll,ll,ll>
const ll inf = 1e9;
const ll mxn = 1e5+10;
pair<pii,int> ask[mxn];
int ans[mxn];
int main(){
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int n,m;
fill(ans,ans+mxn,1);
cin>>n>>m;
for(int i = 0;i<m;i++){
cin>>ask[i].fs.fs>>ask[i].fs.sc>>ask[i].sc;
ans[ask[i].fs.fs] = max(ans[ask[i].fs.fs],ask[i].sc);
ans[ask[i].fs.sc] = max(ans[ask[i].fs.sc],ask[i].sc);
}
for(int i =0;i<m;i++){
assert(min(ans[ask[i].fs.fs],ans[ask[i].fs.sc]) == ask[i].sc);
}
for(int i = 1;i<=n;i++)cout<<ans[i]<<' ';return 0;
}
Compilation message (stderr)
# | 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... |