# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
440569 | MetalPower | Fountain Parks (IOI21_parks) | C++17 | 776 ms | 81016 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#include "parks.h"
#define pii pair<int, int>
#define fi first
#define se second
#define mp make_pair
const int MX = 2e5 + 10;
int dx[4] = {2, -2, 0, 0}, dy[4] = {0, 0, 2, -2};
int dgx[4] = {1, 1, -1, -1}, dgy[4] = {1, -1, 1, -1};
pii pos[MX]; map<pii, int> nd;
bool vis[MX];
void dfs(int u){
vis[u] = true;
int nx = pos[u].fi, ny = pos[u].se;
for(int i = 0; i < 4; i++){
int v = nd[mp(nx + dx[i], ny + dy[i])];
if(v != 0 && !vis[v]) dfs(v);
}
}
// if there doesn't exist 2 * 2 squares
// we can color the 2 * 2 cells by black or white like a chess board
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |