QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#536703 | #8902. Видеонаблюдение | default | 0 | 0ms | 3616kb | C++14 | 677b | 2024-08-29 15:53:14 | 2024-08-29 15:53:15 |
answer
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
long long solve_vertical(vector<int> a, int x) {
sort(a.begin(), a.end());
int n = a.size();
long long result = a[n - 1] - a[0];
for (int i = 1; i < n; ++i) {
long long possible = (x + a[i - 1]) - a[i];
result = min(result, possible);
}
return result + 1;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int h, w, n;
cin >> h >> w >> n;
vector<int> r(n), c(n);
for (int i = 0; i < n; ++i) {
cin >> r[i] >> c[i];
}
cout << solve_vertical(r, h) * solve_vertical(c, w) << '\n';
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3560kb
input:
388 366 1 288 22
output:
1
result:
wrong answer Answer contains longer sequence [length = 2], but output contains 1 elements
Subtask #2:
score: 0
Wrong Answer
Test #3:
score: 0
Wrong Answer
time: 0ms
memory: 3616kb
input:
487 439 2 64 8 334 266
output:
39676
result:
wrong answer Answer contains longer sequence [length = 2], but output contains 1 elements
Subtask #3:
score: 0
Wrong Answer
Test #7:
score: 0
Wrong Answer
time: 0ms
memory: 3500kb
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
result:
wrong answer Answer contains longer sequence [length = 2], but output contains 1 elements
Subtask #4:
score: 0
Wrong Answer
Test #18:
score: 0
Wrong Answer
time: 0ms
memory: 3556kb
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:
1122
result:
wrong answer Answer contains longer sequence [length = 2], but output contains 1 elements
Subtask #5:
score: 0
Skipped
Dependency #4:
0%
Subtask #6:
score: 0
Skipped
Dependency #4:
0%
Subtask #7:
score: 0
Skipped
Dependency #1:
0%