제출 #254929

#제출 시각아이디문제언어결과실행 시간메모리
254929super_j6경찰관과 강도 (BOI14_coprobber)C++14
14 / 100
65 ms1784 KiB
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> using namespace std; #define endl '\n' #define ll long long #define pi pair<int, int> #define f first #define s second const int mxn = 500; int n, m, k; int c; pi f(int x){ return {x / k, x % k}; } int ff(pi p){ return p.f * k + p.s; } int start(int N, bool g[mxn][mxn]){ n = N; for(k = 1; k < n && g[k - 1][k]; k++); return c = ff({0, 0}); } int nextMove(int r){ pi pc = f(c), pr = f(r); pr.f -= pc.f, pr.s -= pc.s; if(abs(pr.f) > abs(pr.s)){ pc.f += 2 * (pr.f > 0) - 1; }else if(abs(pr.s) > abs(pr.f)){ pc.s += 2 * (pr.s > 0) - 1; } return c = ff(pc); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...