Submission #1101382

#TimeUsernameProblemLanguageResultExecution timeMemory
1101382ezzzayTrading (IZhO13_trading)C++14
0 / 100
2059 ms15820 KiB
#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 timeMemoryGrader output
Fetching results...