# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1101382 | ezzzay | Trading (IZhO13_trading) | C++14 | 2059 ms | 15820 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];
for(int j=l[i];j<=r[i];j++){
a[j]=max(a[j],j-l[i]+x[i]);
}
}
for(int i=1;i<=n;i++){
cout<<a[i]<<" ";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |