Submission #1114940

#TimeUsernameProblemLanguageResultExecution timeMemory
1114940AdamGSFire (JOI20_ho_t5)C++17
0 / 100
630 ms262144 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n,q,k,l,p,maks=0; cin >> n >> q; vector<int>c1; vector<vector<int>>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(int i=0;i<q;++i){ cin >> k >> l >>p; int suma=0; for(int j=l-1;j<p;++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:19: warning: unused variable 'maks' [-Wunused-variable]
    6 |     int 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...