Submission #1075893

#TimeUsernameProblemLanguageResultExecution timeMemory
1075893raphaelpCop and Robber (BOI14_coprobber)C++14
0 / 100
1 ms344 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); }*/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...