제출 #134369

#제출 시각아이디문제언어결과실행 시간메모리
134369Kastanda경찰관과 강도 (BOI14_coprobber)C++11
컴파일 에러
0 ms0 KiB
// ItnoE
#include<bits/stdc++.h>
using namespace std;
const int N = 505;
int n, now, P[N][N], C[N][N];
bool dp[N][N][2];
vector < int > Adj[N];
int start(int _n, int _A[N][N])
{
    n = _n;
    for (int i = 0; i < n; i ++)
        for (int j = 0; j < n; j ++)
            if (_A[i][j])
                Adj[i].push_back(j);
    queue < tuple < int , int , int > > qu;
    for (int i = 0; i < n; i ++)
    {
        dp[i][i][0] = dp[i][i][1] = 1;
        P[i][i] = -1;
        qu.push(make_tuple(i, i, 0));
        qu.push(make_tuple(i, i, 1));
    }
    while (qu.size())
    {
        int a, b, w;
        tie(a, b, w) = qu.front();
        qu.pop();
        if (w == 1)
        {
            if (!dp[a][b][0])
            {
                dp[a][b][0] = 1;
                P[a][b] = a;
                qu.push(make_tuple(a, b, 0));
            }
            for (int u : Adj[a])
                if (!dp[u][b][0])
                {
                    dp[u][b][0] = 1;
                    P[u][b] = a;
                    qu.push(make_tuple(u, b, 0));
                }
        }
        if (w == 0)
        {
            for (int u : Adj[b])
            {
                C[a][u] ++;
                if (C[a][u] == Adj[u].size())
                {
                    dp[a][u][1] = 1;
                    qu.push(make_tuple(a, u, 1));
                }
            }
        }
    }
    for (int i = 0; i < n; i ++)
    {
        bool w = 1;
        for (int j = 0; j < n; j ++)
            w &= dp[i][j][0];
        if (w)
        {
            now = i;
            return (i);
        }
    }
    return (-1);
}
int nextMove(int v)
{
    now = P[now][v];
    return (now);
}

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

coprobber.cpp: In function 'int start(int, int (*)[505])':
coprobber.cpp:49:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                 if (C[a][u] == Adj[u].size())
                     ~~~~~~~~^~~~~~~~~~~~~~~~
/tmp/ccUSkBAL.o: In function `main':
grader.cpp:(.text.startup+0x13c): undefined reference to `start(int, bool (*) [500])'
collect2: error: ld returned 1 exit status