#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 cur = 0;
vector<int> pos;
for (int i = 0; i < N; i++){
int q = query(0,i);
if (q != -1) pos.push_back(i);
}
for (auto x : pos){
int q = query(cur,x);
if (q != -1 && q > cur) cur = q;
}
/*int ct = 0;
for (int i = 0; i < N; i++){
if (i == cur || query(i,cur) != -1) ct++;
if (ct > N/2) break;
}*/
return cur;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
768 KB |
Wrong |
2 |
Correct |
6 ms |
768 KB |
Correct : C = 297 |
3 |
Correct |
5 ms |
768 KB |
Correct : C = 177 |
4 |
Incorrect |
5 ms |
768 KB |
Wrong |
5 |
Incorrect |
5 ms |
768 KB |
Wrong |
6 |
Incorrect |
5 ms |
768 KB |
Wrong |
7 |
Incorrect |
5 ms |
768 KB |
Wrong |
8 |
Incorrect |
5 ms |
768 KB |
Wrong |
9 |
Incorrect |
6 ms |
768 KB |
Wrong |
10 |
Incorrect |
5 ms |
768 KB |
Wrong |
11 |
Correct |
5 ms |
768 KB |
Correct : C = 236 |
12 |
Partially correct |
5 ms |
768 KB |
Partially correct : C = 312 |
13 |
Incorrect |
5 ms |
768 KB |
Wrong |
14 |
Correct |
5 ms |
768 KB |
Correct : C = 298 |
15 |
Partially correct |
5 ms |
768 KB |
Partially correct : C = 394 |
16 |
Correct |
5 ms |
768 KB |
Correct : C = 234 |
17 |
Incorrect |
5 ms |
768 KB |
Wrong |
18 |
Incorrect |
5 ms |
768 KB |
Wrong |
19 |
Incorrect |
6 ms |
768 KB |
Wrong |
20 |
Partially correct |
5 ms |
928 KB |
Partially correct : C = 310 |
21 |
Correct |
5 ms |
768 KB |
Correct : C = 175 |
22 |
Partially correct |
5 ms |
768 KB |
Partially correct : C = 396 |
23 |
Correct |
5 ms |
768 KB |
Correct : C = 183 |
24 |
Incorrect |
6 ms |
768 KB |
Wrong |
25 |
Correct |
5 ms |
640 KB |
Correct : C = 7 |
26 |
Correct |
5 ms |
768 KB |
Correct : C = 175 |
27 |
Correct |
5 ms |
640 KB |
Correct : C = 0 |