#include "lokahia.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
int FindBase(int N){
int n = N;
if (n == 1) return 0;
// if (n <= 17) {
// vector<int> g(n, 0);
// for (int i = 0; i < n; i++) {
// for (int j = 0; j < n; j++) if (i != j) {
// int k = CollectRelics(i, j);
// if (k != -1) {
// g[k] |= (1 << i) | (1 << j);
// }
// }
// }
// }
srand(time(NULL));
int qaq = 298 - n;
vector<int> f(n, 0);
for (int i = 1; i <= qaq; i++) {
int x = rand() % n, y = rand() % n;
while (x == y) {
x = rand() % n, y = rand() % n;
}
int k = CollectRelics(x, y);
if (k != -1) f[k]++;
}
int u = 0;
for (int i = 1; i < n; i++)
if (f[i] > f[u]) u = i;
int cnt = 0;
for (int i = 0; i < n; i++) if (i != u) {
int k = CollectRelics(u, i);
if (k != -1) cnt++;
}
if (cnt >= n / 2) return u;
return -1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
688 KB |
Correct : C = 297 |
2 |
Correct |
7 ms |
728 KB |
Correct : C = 297 |
3 |
Correct |
7 ms |
512 KB |
Correct : C = 297 |
4 |
Correct |
7 ms |
640 KB |
Correct : C = 297 |
5 |
Correct |
7 ms |
640 KB |
Correct : C = 297 |
6 |
Correct |
7 ms |
640 KB |
Correct : C = 297 |
7 |
Correct |
6 ms |
600 KB |
Correct : C = 297 |
8 |
Correct |
6 ms |
640 KB |
Correct : C = 297 |
9 |
Correct |
6 ms |
512 KB |
Correct : C = 297 |
10 |
Correct |
6 ms |
512 KB |
Correct : C = 297 |
11 |
Correct |
8 ms |
640 KB |
Correct : C = 297 |
12 |
Correct |
6 ms |
640 KB |
Correct : C = 297 |
13 |
Correct |
7 ms |
640 KB |
Correct : C = 297 |
14 |
Correct |
7 ms |
640 KB |
Correct : C = 297 |
15 |
Incorrect |
6 ms |
512 KB |
Wrong |
16 |
Correct |
6 ms |
640 KB |
Correct : C = 297 |
17 |
Correct |
7 ms |
640 KB |
Correct : C = 297 |
18 |
Correct |
6 ms |
512 KB |
Correct : C = 297 |
19 |
Correct |
6 ms |
688 KB |
Correct : C = 297 |
20 |
Correct |
7 ms |
640 KB |
Correct : C = 297 |
21 |
Correct |
6 ms |
600 KB |
Correct : C = 297 |
22 |
Correct |
6 ms |
640 KB |
Correct : C = 297 |
23 |
Correct |
7 ms |
640 KB |
Correct : C = 297 |
24 |
Incorrect |
7 ms |
744 KB |
Wrong |
25 |
Correct |
6 ms |
512 KB |
Correct : C = 0 |
26 |
Correct |
6 ms |
512 KB |
Correct : C = 297 |
27 |
Correct |
7 ms |
640 KB |
Correct : C = 297 |