Submission #1075901

#TimeUsernameProblemLanguageResultExecution timeMemory
1075901raphaelpCop and Robber (BOI14_coprobber)C++14
14 / 100
52 ms1872 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 - pos == 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...