제출 #234666

#제출 시각아이디문제언어결과실행 시간메모리
234666BamiTorabi경찰관과 강도 (BOI14_coprobber)C++14
컴파일 에러
0 ms0 KiB
//Sasayego! Sasayego! Shinzou wo Sasageyo!

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <ctime>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <numeric>
#include <bitset>
#include <ctime>
#define debug(x)  cerr << #x << " = " << x << endl
#define lid (id << 1)
#define rid (lid ^ 1)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair <ll, ll> pll;
typedef pair <int, int> pii;

const ll INF = 1e18;
const ll MOD = 1e9 + 7;

int arumin[MAX_N][MAX_N][2], eren[MAX_N][MAX_N];
int annie[MAX_N][MAX_N], deg[MAX_N], shingeki;
queue <int> Q;

int start(int n, bool A[MAX_N][MAX_N]){
	for (int i = 0; i < n; i++){
		for (int j = 0; j < n; j++)
			if (A[i][j])
				deg[i]++;
		for (int j = 0; j < n; j++)
			annie[j][i] = deg[i];
	}
	for (int i = 0; i < n; i++)
		for (int b = 0; b < 2; b++){
			arumin[i][i][b] = 1;
			eren[i][i] = i;
			Q.push(b * n * n + i * n + j);
		}
	while (!Q.empty()){
		int x = Q.front();;
		Q.pop();
		bool b = (x >= n * n);
		x -= b * n * n;
		int att = x / n;
		int fem = x % n;
		if (b)
			for (int u = 0; u < n; u++)
				if (A[u][fem]){
					annie[att][u]--;
					if (annie[att][u] == 0 && !arumin[att][u][0]){
						arumin[att][u][0] = 1;
						Q.push(n * att + u);
					}
				}
		else
			for (int u = 0; u < n; u++)
				if ((A[u][att] || u == att) && !arumin[u][fem][1]){
					arumin[u][fem][1] = 1;
					eren[u][fem] = att;
					Q.push(n * n + u * n + fem);
				}
	}
	shingeki = -1;
	for (int i = 0; i < n; i++){
		bool flag = true;
		for (int j = 0; j < n; j++)
			flag &= (arumin[i][j][1]);
		if (flag)
			shingeki = i;
	}
	return shingeki;
}

int nextMove(int femaleTitan){
	return shingeki = eren[shingeki][femaleTitan];
}

컴파일 시 표준 에러 (stderr) 메시지

coprobber.cpp:30:12: error: 'MAX_N' was not declared in this scope
 int arumin[MAX_N][MAX_N][2], eren[MAX_N][MAX_N];
            ^~~~~
coprobber.cpp:30:19: error: 'MAX_N' was not declared in this scope
 int arumin[MAX_N][MAX_N][2], eren[MAX_N][MAX_N];
                   ^~~~~
coprobber.cpp:30:35: error: 'MAX_N' was not declared in this scope
 int arumin[MAX_N][MAX_N][2], eren[MAX_N][MAX_N];
                                   ^~~~~
coprobber.cpp:30:42: error: 'MAX_N' was not declared in this scope
 int arumin[MAX_N][MAX_N][2], eren[MAX_N][MAX_N];
                                          ^~~~~
coprobber.cpp:31:11: error: 'MAX_N' was not declared in this scope
 int annie[MAX_N][MAX_N], deg[MAX_N], shingeki;
           ^~~~~
coprobber.cpp:31:18: error: 'MAX_N' was not declared in this scope
 int annie[MAX_N][MAX_N], deg[MAX_N], shingeki;
                  ^~~~~
coprobber.cpp:31:30: error: 'MAX_N' was not declared in this scope
 int annie[MAX_N][MAX_N], deg[MAX_N], shingeki;
                              ^~~~~
coprobber.cpp:34:25: error: 'MAX_N' was not declared in this scope
 int start(int n, bool A[MAX_N][MAX_N]){
                         ^~~~~
coprobber.cpp:34:32: error: 'MAX_N' was not declared in this scope
 int start(int n, bool A[MAX_N][MAX_N]){
                                ^~~~~
coprobber.cpp: In function 'int start(...)':
coprobber.cpp:35:22: error: 'n' was not declared in this scope
  for (int i = 0; i < n; i++){
                      ^
coprobber.cpp:37:8: error: 'A' was not declared in this scope
    if (A[i][j])
        ^
coprobber.cpp:38:5: error: 'deg' was not declared in this scope
     deg[i]++;
     ^~~
coprobber.cpp:38:5: note: suggested alternative: 'drem'
     deg[i]++;
     ^~~
     drem
coprobber.cpp:40:4: error: 'annie' was not declared in this scope
    annie[j][i] = deg[i];
    ^~~~~
coprobber.cpp:40:4: note: suggested alternative: 'finite'
    annie[j][i] = deg[i];
    ^~~~~
    finite
coprobber.cpp:40:18: error: 'deg' was not declared in this scope
    annie[j][i] = deg[i];
                  ^~~
coprobber.cpp:40:18: note: suggested alternative: 'drem'
    annie[j][i] = deg[i];
                  ^~~
                  drem
coprobber.cpp:42:22: error: 'n' was not declared in this scope
  for (int i = 0; i < n; i++)
                      ^
coprobber.cpp:44:4: error: 'arumin' was not declared in this scope
    arumin[i][i][b] = 1;
    ^~~~~~
coprobber.cpp:44:4: note: suggested alternative: '__fmin'
    arumin[i][i][b] = 1;
    ^~~~~~
    __fmin
coprobber.cpp:45:4: error: 'eren' was not declared in this scope
    eren[i][i] = i;
    ^~~~
coprobber.cpp:45:4: note: suggested alternative: 'drem'
    eren[i][i] = i;
    ^~~~
    drem
coprobber.cpp:46:31: error: 'j' was not declared in this scope
    Q.push(b * n * n + i * n + j);
                               ^
coprobber.cpp:51:18: error: 'n' was not declared in this scope
   bool b = (x >= n * n);
                  ^
coprobber.cpp:57:9: error: 'A' was not declared in this scope
     if (A[u][fem]){
         ^
coprobber.cpp:58:6: error: 'annie' was not declared in this scope
      annie[att][u]--;
      ^~~~~
coprobber.cpp:58:6: note: suggested alternative: 'finite'
      annie[att][u]--;
      ^~~~~
      finite
coprobber.cpp:59:33: error: 'arumin' was not declared in this scope
      if (annie[att][u] == 0 && !arumin[att][u][0]){
                                 ^~~~~~
coprobber.cpp:59:33: note: suggested alternative: '__fmin'
      if (annie[att][u] == 0 && !arumin[att][u][0]){
                                 ^~~~~~
                                 __fmin
coprobber.cpp:66:37: error: 'arumin' was not declared in this scope
     if ((A[u][att] || u == att) && !arumin[u][fem][1]){
                                     ^~~~~~
coprobber.cpp:66:37: note: suggested alternative: '__fmin'
     if ((A[u][att] || u == att) && !arumin[u][fem][1]){
                                     ^~~~~~
                                     __fmin
coprobber.cpp:68:6: error: 'eren' was not declared in this scope
      eren[u][fem] = att;
      ^~~~
coprobber.cpp:68:6: note: suggested alternative: 'drem'
      eren[u][fem] = att;
      ^~~~
      drem
coprobber.cpp:55:6: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
   if (b)
      ^
coprobber.cpp:73:22: error: 'n' was not declared in this scope
  for (int i = 0; i < n; i++){
                      ^
coprobber.cpp:76:13: error: 'arumin' was not declared in this scope
    flag &= (arumin[i][j][1]);
             ^~~~~~
coprobber.cpp:76:13: note: suggested alternative: '__fmin'
    flag &= (arumin[i][j][1]);
             ^~~~~~
             __fmin
coprobber.cpp: In function 'int nextMove(int)':
coprobber.cpp:84:20: error: 'eren' was not declared in this scope
  return shingeki = eren[shingeki][femaleTitan];
                    ^~~~
coprobber.cpp:84:20: note: suggested alternative: 'drem'
  return shingeki = eren[shingeki][femaleTitan];
                    ^~~~
                    drem