# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
754761 |
2023-06-08T13:49:28 Z |
Pring |
Fire (JOI20_ho_t5) |
C++14 |
|
1 ms |
340 KB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> pii;
const int MXN = 20;
int n, q, a[MXN], ans[MXN];
vector<pair<pii, int>> v[MXN];
int32_t main() {
cin >> n >> q;
for (int i = 0; i < n; i++) cin >> a[i];
for (int i = 0; i < q; i++) {
int t, l, r;
cin >> t >> l >> r;
v[t].push_back({{l, r}, i});
}
for (int i = 1; i <= n; i++) {
for (int j = n - 1; j > 0; j--) a[j] = max(a[j], a[j - 1]);
for (auto &j : v[i]) {
for (int k = j.first.first; k <= j.first.second; k++) ans[j.second] += a[k - 1];
}
}
for (int i = 0; i < q; i++) cout << ans[i] << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
300 KB |
Output is correct |
2 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 11 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
300 KB |
Output is correct |
2 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 11 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
300 KB |
Output is correct |
2 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 11 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
300 KB |
Output is correct |
2 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 11 |
3 |
Halted |
0 ms |
0 KB |
- |