# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
72428 | 이시대의진정한망겜스타투 (#118) | Lokahian Rampart (FXCUP3_lokahia) | C++17 | 1297 ms | 178200 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 "sungjin.h"
int X[1010][1010], Y[1010][1010], n, m, vis[1010][1010];
int w[1010][1010][4], dx[4] = { 0,0,1,-1 }, dy[4] = { 1,-1,0,0 };
int Rev[4] = { 1,0,3,2 };
void DFS(int x, int y) {
if (x<0 || y<0 || x>n + 1 || y>m + 1 || vis[x][y])return;
vis[x][y] = 1;
for (int i = 0; i < 4; i++) {
if(!w[x][y][i])DFS(x + dx[i], y + dy[i]);
}
}
void Init(int N, int M, int W, int R[], int C[], int dir[]) {
int i, j;
n = N, m = M;
for (i = 0; i < W; i++) {
dir[i]--;
w[R[i]][C[i]][dir[i]] = 1;
w[R[i]+dx[dir[i]]][C[i]+dy[dir[i]]][Rev[dir[i]]] = 1;
}
DFS(0, 0);
}
int WereSameTerritory(int R1, int C1, int R2, int C2) {
if (!vis[R1][C1] && !vis[R2][C2])return 1;
return 0;
}
#include "dowoon.h"
int w[1010][1010];
int Guess(int N, int M) {
int i, j;
for (i = 1; i <= N; i++) {
for (j = 1; j < M; j++) {
if (Ask(i, j, i, j + 1))w[i][j] = w[i][j+1]=1;
}
}
for (i = 1; i < N; i++) {
for (j = 1; j <= M; j++) {
if (Ask(i, j, i + 1, j))w[i][j] = w[i + 1][j] = 1;
}
}
int res = 0;
for (i = 1; i <= N; i++)for (j = 1; j <= M; j++) {
if (w[i][j])res++;
}
if (res * 2 > M*N)return 1;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |