Submission #1075886

#TimeUsernameProblemLanguageResultExecution timeMemory
1075886raphaelpCop and Robber (BOI14_coprobber)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "coprobber.h"
using namespace std;
vector<vector<int>> AR;
int pos = 0, sz = 1;
int start(int N, bool A[500][500])
{
    while (A[sz - 1][sz])
        sz++;
    return 0;
}

int nextMove(int R)
{
    if (R / N == pos / N && R - N == 1)
        return R;
    if (R % N == pos % N &&R = pos + N)
        return R;
    if (R % N < pos % N)
    {
        pos--;
        return pos;
    }
    if (R % N - 1 > pos % N)
    {
        pos++;
        return pos;
    }
    if (R % N == pos % N + 1 && R / N == pos / N + 1)
        return pos;
    pos += N;
    return pos;
}
/*int main()
{
    int N = 5;
    bool A[5][5] = {{0, 1, 0, 0, 0}, {1, 0, 1, 0, 0}, {0, 1, 0, 1, 0}, {0, 0, 1, 0, 1}, {0, 0, 0, 1, 0}};
    start(N, A);
    nextMove(4);
}*/

Compilation message (stderr)

coprobber.cpp: In function 'int nextMove(int)':
coprobber.cpp:15:13: error: 'N' was not declared in this scope
   15 |     if (R / N == pos / N && R - N == 1)
      |             ^
coprobber.cpp:17:13: error: 'N' was not declared in this scope
   17 |     if (R % N == pos % N &&R = pos + N)
      |             ^
coprobber.cpp:19:13: error: 'N' was not declared in this scope
   19 |     if (R % N < pos % N)
      |             ^
coprobber.cpp:24:13: error: 'N' was not declared in this scope
   24 |     if (R % N - 1 > pos % N)
      |             ^
coprobber.cpp:29:13: error: 'N' was not declared in this scope
   29 |     if (R % N == pos % N + 1 && R / N == pos / N + 1)
      |             ^
coprobber.cpp:31:12: error: 'N' was not declared in this scope
   31 |     pos += N;
      |            ^