QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#456780 | #8780. Training, Round 2 | ucup-team3678 | WA | 0ms | 4280kb | C++14 | 1.1kb | 2024-06-28 13:24:41 | 2024-06-28 13:24:43 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N = 5005;
set<int> S[N], z[N];
signed main() {
int n, p, q; scanf("%d%d%d", &n, &p, &q);
S[0].insert(0), z[0].insert(0);
for (int i = 1; i <= n; ++i) {
int a, b, c, d; scanf("%d%d%d%d", &a, &b, &c, &d);
a -= p, b -= p, c -= q, d -= q;
for (int j = a; j < i && j <= d; ++j) {
set<int>::iterator it = z[j].lower_bound(c);
vector<int> rm;
vector< pair<int, int> > ad;
while (it != z[j].end() && *it <= d) {
rm.push_back(*it);
if (!S[j].count(*it + 1)) ad.push_back({j, *it + 1});
if (!S[j + 1].count(*it)) ad.push_back({j + 1, *it});
++it;
}
for (auto x : rm) z[j].erase(x);
for (auto [x, y] : ad) S[x].insert(y), z[x].insert(y);
}
}
int res = 0;
for (int i = 0; i <= n; ++i) {
if (!S[i].empty()) res = max(res, i + *--S[i].end());
}
printf("%d\n", res);
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 4280kb
input:
3 0 0 0 1 0 1 1 1 0 1 1 1 1 1
output:
3
result:
ok single line: '3'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 4280kb
input:
5000 801577551 932138594 801577551 801577551 932138594 932138594 801577552 801577552 932138594 932138594 801577552 801577552 932138595 932138595 801577552 801577552 932138596 932138596 801577553 801577553 932138596 932138596 801577553 801577553 932138597 932138597 801577553 801577553 932138598 93213...
output:
1
result:
wrong answer 1st lines differ - expected: '5000', found: '1'