QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#106335 | #3553. Hamburg Steak | bashkort# | 0 | 50ms | 4032kb | C++20 | 1.6kb | 2023-05-17 14:18:53 | 2024-05-31 13:38:56 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
struct Rect {
int x1, y1, x2, y2;
bool in(int x, int y) {
return x1 <= x && x <= x2 && y1 <= y && y <= y2;
}
};
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, k;
cin >> n >> k;
vector<Rect> r(n);
for (auto &[x1, y1, x2, y2] : r) {
cin >> x1 >> y1 >> x2 >> y2;
}
auto dfs = [&](auto self, vector<Rect> p, int cnt) -> void {
if (cnt == 0) {
if (!p.empty()) {
exit(0);
}
assert(p.empty());
return;
} else if (p.empty()) {
cout << "1 1\n";
self(self, p, cnt - 1);
return;
}
vector<pair<int, int>> pts;
for (auto [x1, y1, x2, y2] : p) {
pts.emplace_back(x1, y1);
pts.emplace_back(x2, y2);
pts.emplace_back(x1, y2);
pts.emplace_back(x2, y1);
}
int m = size(pts);
vector<int> freq(m);
for (auto &r : p) {
for (int i = 0; i < m; ++i) {
freq[i] += r.in(pts[i].first, pts[i].second);
}
}
int i = max_element(freq.begin(), freq.end()) - freq.begin();
cout << pts[i].first << " " << pts[i].second << '\n';
vector<Rect> nxt;
for (int j = 0; j < size(p); ++j) {
if (!p[j].in(pts[i].first, pts[i].second)) {
nxt.push_back(p[j]);
}
}
self(self, nxt, cnt - 1);
};
dfs(dfs, r, k);
return 0;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 41ms
memory: 3752kb
input:
1936 1 275634612 269663887 525116613 936487725 97408668 7442476 814869170 687312206 436819238 107950642 958111100 591552952 7518596 205530980 782566587 854412425 496572510 309198877 998274921 764947740 205948014 311140816 696959672 600779117 332275583 5172242 984611829 780400859 404519140 226954535 ...
output:
502346159 486467192
result:
wrong answer steak L=142022702, D=490830267, R=600183665, U=831021563 not sticked by any skewer
Subtask #2:
score: 0
Wrong Answer
Test #5:
score: 0
Wrong Answer
time: 38ms
memory: 3812kb
input:
1928 2 257715250 61165602 852430884 888048968 291121137 322570367 570606015 908598504 418176729 319924920 611676731 632485660 33180758 215166338 468783003 795212414 441068331 188624227 750676748 613482091 344172819 322492096 940801573 568738370 246507550 338324125 785514636 678843646 100885653 12352...
output:
549209440 505940387 377383130 476234903
result:
wrong answer steak L=137665267, D=519033356, R=555988733, U=954169685 not sticked by any skewer
Subtask #3:
score: 0
Wrong Answer
Test #9:
score: 0
Wrong Answer
time: 50ms
memory: 4032kb
input:
1980 3 580358104 434053443 986861108 684634218 125969708 5379869 593299091 644204766 366688051 54873592 662708561 602035535 211630750 166795940 981075947 676159693 524950613 414516203 951984898 573261034 10925143 210994662 543601795 609644115 82102881 63393894 401995062 922075556 245641393 276511435...
output:
437832567 499726376 817472513 497245559 275025920 499019062
result:
wrong answer steak L=106131177, D=495200963, R=763299821, U=497821293 not sticked by any skewer
Subtask #4:
score: 0
Wrong Answer
Test #21:
score: 0
Wrong Answer
time: 44ms
memory: 3812kb
input:
1989 4 20688201 462820019 870557654 779905491 299122723 258293216 630017062 521792413 430322558 33567880 691187720 757852374 104994597 262388698 979697437 904439328 237383344 375297588 673858769 638443621 715773360 364818076 896724313 888051478 235043050 422124296 833892854 936850257 434942952 25412...
output:
474144548 499382133 741981014 505604023 302970929 498180300 417192661 449142715
result:
wrong answer steak L=653671310, D=211293675, R=741862652, U=584096140 not sticked by any skewer
Subtask #5:
score: 0
Skipped
Dependency #1:
0%
Subtask #6:
score: 0
Skipped
Dependency #2:
0%
Subtask #7:
score: 0
Skipped
Dependency #3:
0%
Subtask #8:
score: 0
Skipped
Dependency #4:
0%