# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1114940 | AdamGS | Fire (JOI20_ho_t5) | C++17 | 630 ms | 262144 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |