Submission #1075888

#TimeUsernameProblemLanguageResultExecution timeMemory
1075888raphaelpCop 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 / sz == pos / sz && R - sz == 1) return R; if (R % sz == pos % sz &&R = pos + sz) return R; if (R % sz < pos % sz) { pos--; return pos; } if (R % sz - 1 > pos % sz) { pos++; return pos; } if (R % sz == pos % sz + 1 && R / sz == pos / sz + 1) return pos; pos += sz; return pos; } /*int main() { intsz= 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:17:28: error: lvalue required as left operand of assignment
   17 |     if (R % sz == pos % sz &&R = pos + sz)
      |         ~~~~~~~~~~~~~~~~~~~^~~