# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1101380 | ezzzay | Trading (IZhO13_trading) | C++14 | 1 ms | 6484 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 int long long
#define ff first
#define ss second
#define pb push_back
const int N=3e6;
int x[N];
int l[N],r[N];
int a[N];
signed main(){
int n,m;
cin>>n>>m;
for(int i=1;i<=m;i++){
cin>>l[i]>>r[i]>>x[i];
a[l[i]]=max(x[i],a[l[i]]);
for(int j=l[i];j<=r[i];j++){
a[j]=max(a[j],a[j-1]+1);
}
}
for(int i=1;i<=n;i++){
cout<<a[i]<<" ";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |