Submission #1114984

#TimeUsernameProblemLanguageResultExecution timeMemory
1114984AdamGSFire (JOI20_ho_t5)C++17
1 / 100
226 ms262144 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long n,q,k,l,p,maks=0; cin >> n >> q; vector<long long>c1; vector<vector<long long>>c3; for(int i=0;i<n;++i){ cin >> k; c1.push_back(k); } for(int i=0;i<=200;++i){ for(int j=n-1;j>0;--j){ c1[j]=max(c1[j],c1[j-1]); } c3.push_back(c1); } for(long long i=0;i<q;++i){ cin >> k >> l >>p; long long suma=0; for(long long j=l-1;j<p;++j){ //cout << c3[k-1][j] << ' '; suma +=c3[k-1][j]; } cout << suma << endl; } return 0; }

Compilation message (stderr)

ho_t5.cpp: In function 'int main()':
ho_t5.cpp:6:25: warning: unused variable 'maks' [-Wunused-variable]
    6 |     long long n,q,k,l,p,maks=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...