QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#474517 | #8902. Видеонаблюдение | PorNPtree | 15 | 1ms | 3984kb | C++17 | 1.0kb | 2024-07-12 19:37:35 | 2024-07-12 19:37:35 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
signed main() {
int h, w, n; scanf("%d%d%d", &h, &w, &n);
vector<int> px, py;
for (int i = 1, x, y; i <= n; ++i) {
scanf("%d%d", &x, &y);
px.push_back(x), py.push_back(y);
}
sort(px.begin(), px.end()), px.erase(unique(px.begin(), px.end()), px.end());
sort(py.begin(), py.end()), py.erase(unique(py.begin(), py.end()), py.end());
int r1 = px.back() - px[0] + 1, r2 = py.back() - py[0] + 1, res2 = 0;
for (int i = 0; i + 1 < (int)px.size(); ++i) {
if (h - px[i + 1] + 1 + px[i] < px.back() - px[0] + 1) {
r1 = h - px[i + 1] + 1 + px[i];
res2 += min(px[i], h - px[i + 1] + 1);
}
}
for (int i = 0; i + 1 < (int)py.size(); ++i) {
if (w - py[i + 1] + 1 + py[i] < py.back() - py[0] + 1) {
r2 = w - py[i + 1] + 1 + py[i];
res2 += min(py[i], w - py[i + 1] + 1);
}
}
printf("%lld %d\n", 1ll * r1 * r2, res2);
return 0;
}
详细
Subtask #1:
score: 5
Accepted
Test #1:
score: 5
Accepted
time: 0ms
memory: 3744kb
input:
388 366 1 288 22
output:
1 0
result:
ok 2 number(s): "1 0"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3736kb
input:
819482704 658532316 1 123698216 225317189
output:
1 0
result:
ok 2 number(s): "1 0"
Subtask #2:
score: 10
Accepted
Test #3:
score: 10
Accepted
time: 0ms
memory: 3780kb
input:
487 439 2 64 8 334 266
output:
39676 72
result:
ok 2 number(s): "39676 72"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
870965321 869963992 2 835085770 786328420 22764394 733886186
output:
3075419597459310 22764394
result:
ok 2 number(s): "3075419597459310 22764394"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
644365147 678680636 2 72815689 315690171 519297569 315690171
output:
197883268 72815689
result:
ok 2 number(s): "197883268 72815689"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3984kb
input:
825110169 580508287 2 62502582 219347294 62502582 210580221
output:
8767074 0
result:
ok 2 number(s): "8767074 0"
Subtask #3:
score: 0
Wrong Answer
Test #7:
score: 0
Wrong Answer
time: 1ms
memory: 3860kb
input:
1 777 321 1 364 1 34 1 499 1 258 1 502 1 79 1 161 1 472 1 307 1 553 1 492 1 234 1 7 1 365 1 163 1 25 1 252 1 675 1 623 1 236 1 198 1 93 1 563 1 119 1 583 1 422 1 762 1 652 1 125 1 476 1 385 1 23 1 9 1 265 1 323 1 529 1 491 1 550 1 757 1 31 1 145 1 107 1 189 1 436 1 89 1 268 1 456 1 414 1 568 1 530 1...
output:
766 426
result:
wrong answer 2nd numbers differ - expected: '145', found: '426'
Subtask #4:
score: 0
Wrong Answer
Test #18:
score: 0
Wrong Answer
time: 0ms
memory: 3748kb
input:
48 49 15 47 14 40 40 10 40 42 26 34 34 25 26 43 14 25 34 34 46 42 46 43 16 47 16 10 14 42 40 5 34
output:
1320 25
result:
wrong answer 1st numbers differ - expected: '1122', found: '1320'
Subtask #5:
score: 0
Skipped
Dependency #4:
0%
Subtask #6:
score: 0
Skipped
Dependency #4:
0%
Subtask #7:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
0%