QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#524566 | #1142. Fountain Parks | Mousa_Aboubaker# | 0 | 169ms | 45844kb | C++20 | 1.3kb | 2024-08-19 20:03:51 | 2024-08-19 20:03:51 |
Judging History
answer
#include "parks.h"
#include <bits/stdc++.h>
using namespace std;
int construct_roads(std::vector<int> X, std::vector<int> Y)
{
vector<int> dx{0, 0, 2, -2}, dy{2, -2, 0, 0};
set<pair<int, int>> locations;
for(int i = 0; i < X.size(); i++)
{
locations.insert({X[i], Y[i]});
}
auto dfs = [&](auto self, int x, int y) -> void
{
locations.erase({x, y});
for(int i = 0; i < 4; i++)
{
if(locations.find({x + dx[i], y + dy[i]}) != locations.end())
{
self(self, x + dx[i], y + dy[i]);
}
}
};
dfs(dfs, X.front(), Y.front());
if(!locations.empty())
{
return 0;
}
int n = X.size() - 1;
vector<int> u(n), v(n), a(n), b(n);
vector<tuple<int, int, int>> cord;
for(int i = 0; i < n + 1; i++)
{
cord.push_back({X[i], Y[i], i});
}
sort(cord.begin(), cord.end());
for(int i = 0; i < n; i++)
{
auto [x1, y1, f1] = cord[i];
auto [x2, y2, f2] = cord[i + 1];
u[i] = f1;
a[i] = y2 - 1;
b[i] = 1;
v[i] = f2;
}
build(u, v, a, b);
return 1;
}
// void build(std::vector<int> u, std::vector<int> v, std::vector<int> a, std::vector<int> b);
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 5
Accepted
time: 0ms
memory: 3776kb
input:
ba73dbf9c7d5e5202834d6a500541c 1 2 2
output:
3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix OK 1 0
result:
ok
Test #2:
score: 0
Wrong Answer
time: 0ms
memory: 4060kb
input:
ba73dbf9c7d5e5202834d6a500541c 2 2 2 2 4
output:
3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix OK 1 1 0 1 3 1
result:
wrong answer Tree (a[0], b[0]) = (3, 1) is not adjacent to edge between u[0]=0 @(2, 2) and v[0]=1 @(2, 4)
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Wrong Answer
Test #82:
score: 0
Wrong Answer
time: 0ms
memory: 3800kb
input:
ba73dbf9c7d5e5202834d6a500541c 3 200000 2 200000 4 199998 2
output:
3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix OK 1 2 2 0 1 1 0 1 3 1
result:
wrong answer Tree (a[0], b[0]) = (1, 1) is not adjacent to edge between u[0]=2 @(199998, 2) and v[0]=0 @(200000, 2)
Subtask #5:
score: 0
Wrong Answer
Test #108:
score: 0
Wrong Answer
time: 169ms
memory: 45844kb
input:
ba73dbf9c7d5e5202834d6a500541c 200000 82422 100002 100002 52498 82816 2 97624 2 100002 58032 20638 100002 100002 7646 80512 2 2 10584 28426 100002 2 83036 2 64556 47872 100002 55196 2 85350 100002 2 95376 2 23942 12488 100002 83178 2 2 9086 85598 2 100002 78820 100002 10868 98810 2 84182 100002 2 71...
output:
3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix OK 1 199999 199575 112394 3 1 112394 150136 5 1 150136 127248 7 1 127248 13121 9 1 13121 11799 11 1 11799 23271 13 1 23271 18663 15 1 18663 40400 17 1 40400 111415 19 1 111415 196272 21 1 196272 50327 23 1 50327 23534 25 1 23534 184173 27 1 184173 190527 29 1...
result:
wrong answer Tree (a[0], b[0]) = (3, 1) is not adjacent to edge between u[0]=199575 @(2, 2) and v[0]=112394 @(2, 4)
Subtask #6:
score: 0
Skipped
Dependency #1:
0%