Submission #1115715

# Submission time Handle Problem Language Result Execution time Memory
1115715 2024-11-20T20:53:04 Z staszic_ojuz Fire (JOI20_ho_t5) C++17
0 / 100
1000 ms 3000 KB
#include <iostream>

using namespace std;
int tr[200000];
int akttr[200000];
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n,q;
    cin >> n >> q;
    for (int i=0; i<n; i++){
        cin >> tr[i];
    }
    for (int i=0; i<q; i++){
        int t,l,r,wyn=0;
        for (int i=0; i<n; i++) akttr[i]=tr[i];
        cin >> t >> l >> r;
        for (int k=0; k<t; k++){
            for (int j=n-1; j; j--){
                akttr[j]=max(akttr[j],akttr[j-1]);
            }
        }
        for (int k=l-1; k<r; k++){
            //cout << akttr[k] << ' ';
            wyn+=akttr[k];
        }
        cout << wyn << '\n';
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Incorrect 3 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 1024 ms 3000 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 2640 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1028 ms 2128 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 3 ms 336 KB Output isn't correct
3 Halted 0 ms 0 KB -