# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1115179 |
2024-11-20T08:11:38 Z |
staszic_ojuz |
Fire (JOI20_ho_t5) |
C++17 |
|
1000 ms |
1572 KB |
#include <bits/stdc++.h>
using namespace std;
vector<int> vec;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, q, t, l, r;
cin >> n >> q;
for(int i = 0; i < n; i++){
cin >> t;
vec.push_back(t);
}
for(int i = 0; i < q; i++){
cin >> t >> l >> r;
for(int k = 0; k < t; k++){
for(int j = n - 2; j >= 0; j--){
vec[j + 1] = max(vec[j + 1], vec[j]);
}
}
int64_t sum = 0;
for(int j = l - 1; j < r; j++){
sum += vec[j];
}
cout << sum << endl;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Incorrect |
4 ms |
336 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Execution timed out |
1072 ms |
1572 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Execution timed out |
1061 ms |
1488 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1055 ms |
1488 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Incorrect |
4 ms |
336 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |