Submission #1115043

# Submission time Handle Problem Language Result Execution time Memory
1115043 2024-11-19T23:03:48 Z AdamGS Fire (JOI20_ho_t5) C++17
0 / 100
1000 ms 1488 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 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 1 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 1040 ms 1488 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 1038 ms 1488 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1052 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 1 ms 336 KB Output isn't correct
3 Halted 0 ms 0 KB -