Submission #524642

#TimeUsernameProblemLanguageResultExecution timeMemory
524642mosiashvililukaFire (JOI20_ho_t5)C++14
1 / 100
1069 ms4388 KiB
#include<bits/stdc++.h> using namespace std; long long a,b,c,d,e,i,j,ii,jj,zx,xc,t,tes,f[200009],T,l,r,pas; int main(){ ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0); cin>>a>>tes; for(i=1; i<=a; i++) cin>>f[i]; for(t=1; t<=tes; t++){ cin>>T>>l>>r;pas=0;T++; for(i=l; i<=r; i++){ e=0; for(j=max(1LL,i-T+1); j<=i; j++){ e=max(e,f[j]); } pas+=e; } cout<<pas<<"\n"; } 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...