# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
247224 | 2020-07-11T08:12:58 Z | dantoh000 | Lokahian Relics (FXCUP4_lokahia) | C++17 | 0 ms | 0 KB |
#include <bits/stdc++.h> using namespace std; //#include "lokahia.h" int Q[205][205]; int query(int i, int j){ if (i == j) return Q[i][i] = i; else if (Q[i][j] == -1) return Q[i][j] = Q[j][i] = CollectRelics(i,j); else return Q[i][j]; } int FindBase(int N){ memset(Q,-1,sizeof(Q)); int s = -1, e = -1; for (int i = 0; i < N/2; i++){ if (query(i,(i+N/2+1)%N) != -1){ s = i; e = (i+N/2+1)%N; break; } } if (s == -1) return -1; else return s; }