Submission #72428

#TimeUsernameProblemLanguageResultExecution timeMemory
72428이시대의진정한망겜스타투 (#118)Lokahian Rampart (FXCUP3_lokahia)C++17
13 / 100
1297 ms178200 KiB
#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)

sungjin.cpp: In function 'void Init(int, int, int, int*, int*, int*)':
sungjin.cpp:18:9: warning: unused variable 'j' [-Wunused-variable]
  int i, j;
         ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...