Submission #857023

#TimeUsernameProblemLanguageResultExecution timeMemory
857023StefanSebezFire (JOI20_ho_t5)C++14
1 / 100
1091 ms6992 KiB
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { int n,q;cin>>n>>q; int a[n+1];for(int i=1;i<=n;i++)cin>>a[i]; while(q--) { int l,r,t;cin>>t>>l>>r; int b[n+1]={0};for(int i=1;i<=n;i++)b[i]=a[i]; while(t--) { int c[n+1]; for(int i=1;i<=n;i++)c[i]=max(b[i],b[i-1]); for(int i=1;i<=n;i++)b[i]=c[i]; } int res=0; for(int i=l;i<=r;i++) res+=b[i]; cout<<res<<endl; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...