Submission #247226

#TimeUsernameProblemLanguageResultExecution timeMemory
247226dantoh000로카히아 유적 (FXCUP4_lokahia)C++17
0 / 100
7 ms916 KiB
#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; }

Compilation message (stderr)

lokahia.cpp: In function 'int FindBase(int)':
lokahia.cpp:12:17: warning: variable 'e' set but not used [-Wunused-but-set-variable]
     int s = -1, e = -1;
                 ^
#Verdict Execution timeMemoryGrader output
Fetching results...