11781 | 2024-11-10 17:31:20 | Mittomen | Szemetessor | cpp17 | Wrong answer 0/100 | 252ms | 1264 KiB |
#include <iostream>
#include <cstdint>
#define MIN(a, b) a < b ? a : b
#define MAX(a, b) a > b ? a : b
using namespace std;
// subtask 4 only
int main() {
int n, k;
int bins[200000] = {};
int total = 0;
cin >> n;
cin >> k;
int l = n, r = 0; // left and right ends of the interval
int bin;
int amount;
for (int i = 0; i < n; i++) {
cin >> amount;
bins[i] = amount;
}
for (int i = 0; i < k; i++) {
cin >> bin;
cin >> amount;
bins[bin] -= amount;
l = MIN(l, bin);
r = MAX(r, bin);
}
for (int i = l; i <= r; i++) {
total += bins[i];
}
cout << total;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 1ms | 1080 KiB | ||||
2 | Wrong answer | 2ms | 1080 KiB | ||||
subtask2 | 0/17 | ||||||
3 | Wrong answer | 2ms | 1080 KiB | ||||
4 | Wrong answer | 2ms | 996 KiB | ||||
5 | Wrong answer | 1ms | 1080 KiB | ||||
6 | Accepted | 1ms | 1080 KiB | ||||
7 | Wrong answer | 2ms | 1080 KiB | ||||
8 | Wrong answer | 2ms | 1080 KiB | ||||
9 | Wrong answer | 1ms | 1080 KiB | ||||
10 | Accepted | 2ms | 1080 KiB | ||||
11 | Wrong answer | 1ms | 1080 KiB | ||||
subtask3 | 0/25 | ||||||
12 | Wrong answer | 118ms | 1180 KiB | ||||
13 | Wrong answer | 115ms | 1176 KiB | ||||
14 | Wrong answer | 136ms | 1184 KiB | ||||
15 | Wrong answer | 135ms | 1176 KiB | ||||
16 | Wrong answer | 145ms | 1080 KiB | ||||
17 | Wrong answer | 192ms | 1176 KiB | ||||
18 | Wrong answer | 240ms | 1188 KiB | ||||
19 | Wrong answer | 246ms | 1184 KiB | ||||
20 | Wrong answer | 239ms | 1080 KiB | ||||
subtask4 | 0/20 | ||||||
21 | Wrong answer | 122ms | 1184 KiB | ||||
22 | Wrong answer | 143ms | 1080 KiB | ||||
23 | Wrong answer | 123ms | 1080 KiB | ||||
24 | Wrong answer | 144ms | 1080 KiB | ||||
25 | Wrong answer | 129ms | 1080 KiB | ||||
26 | Wrong answer | 189ms | 1080 KiB | ||||
27 | Wrong answer | 236ms | 1080 KiB | ||||
28 | Wrong answer | 236ms | 1180 KiB | ||||
29 | Wrong answer | 252ms | 1084 KiB | ||||
30 | Wrong answer | 207ms | 1184 KiB | ||||
subtask5 | 0/38 | ||||||
31 | Wrong answer | 2ms | 1080 KiB | ||||
32 | Wrong answer | 2ms | 1264 KiB | ||||
33 | Wrong answer | 2ms | 1080 KiB | ||||
34 | Wrong answer | 2ms | 1080 KiB | ||||
35 | Wrong answer | 13ms | 1180 KiB | ||||
36 | Wrong answer | 135ms | 1184 KiB | ||||
37 | Wrong answer | 240ms | 1080 KiB | ||||
38 | Wrong answer | 239ms | 1184 KiB | ||||
39 | Wrong answer | 239ms | 1176 KiB | ||||
40 | Wrong answer | 239ms | 1080 KiB | ||||
41 | Wrong answer | 238ms | 1260 KiB | ||||
42 | Wrong answer | 240ms | 1176 KiB |