QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#508246 | #1142. Fountain Parks | zhoukangyang# | 0 | 269ms | 175144kb | C++14 | 1.5kb | 2024-08-07 11:00:11 | 2024-08-07 11:00:11 |
Judging History
answer
#include<bits/stdc++.h>
#define L(i, j, k) for(int i = (j); i <= (k); ++i)
#define R(i, j, k) for(int i = (j); i >= (k); --i)
#define ll long long
#define sz(a) ((int) (a).size())
#define vi vector < int >
#define me(a, x) memset(a, x, sizeof(a))
#define ull unsigned long long
#define ld __float128
#define pb emplace_back
#define i128 __int128
using namespace std;
const int N = 1e6 + 7, mod = 1e9 + 7;
map<int,int>mp[N];
set<int> ex[N], ey[N];
void build(vi A, vi B, vi C, vi D);
void construct_roads(vi x, vi y) {
L(i, 0, sz(x) - 1) {
mp[x[i]][y[i]] = i;
}
L(i, 0, sz(x) - 1) {
if(mp[x[i]].count(y[i] + 2)) {
ex[x[i]].insert(y[i]);
}
}
L(i, 0, sz(x) - 1) {
if(mp[x[i] + 2].count(y[i])) {
ey[y[i]].insert(x[i]);
}
}
L(i, 0, sz(x) - 1) {
if(mp[x[i]].count(y[i] + 2) && mp[x[i] + 2].count(y[i]) && mp[x[i] + 2].count(y[i] + 2)) {
int op = ((x[i] + y[i]) / 2) & 1;
if(op == 0) ex[x[i]].erase(y[i]);
else ey[y[i]].erase(x[i]);
}
}
vi U, V, A, B;
L(x, 0, N - 1) {
for(auto&y : ex[x]) {
U.pb(mp[x][y]);
V.pb(mp[x][y + 2]);
if((((x + y) / 2) & 1) == 0)
A.pb(x + 1), B.pb(y + 1);
else
A.pb(x - 1), B.pb(y + 1);
}
}
L(y, 0, N - 1) {
for(auto&x : ey[y]) {
U.pb(mp[x][y]);
V.pb(mp[x + 2][y]);
if((((x + y) / 2) & 1) == 1)
A.pb(x + 1), B.pb(y + 1);
else
A.pb(x + 1), B.pb(y - 1);
}
}
build(U, V, A, B);
}
// int main() {
// construct_roads(vi{4, 4, 6, 4, 2}, vi{4, 6, 4, 2, 4});
// return 0;
// }
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 26ms
memory: 144620kb
input:
ba73dbf9c7d5e5202834d6a500541c 1 2 2
output:
Unauthorized output
result:
wrong output format Unexpected end of file - int32 expected
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: 33ms
memory: 144396kb
input:
ba73dbf9c7d5e5202834d6a500541c 3 200000 2 200000 4 199998 2
output:
Unauthorized output
result:
wrong output format Unexpected end of file - int32 expected
Subtask #5:
score: 0
Wrong Answer
Test #108:
score: 0
Wrong Answer
time: 269ms
memory: 175144kb
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:
Unauthorized output
result:
wrong output format Unexpected end of file - int32 expected
Subtask #6:
score: 0
Skipped
Dependency #1:
0%