#include <bits/stdc++.h>
#include "lokahia.h"
using namespace std;
int p[210];
int visit[210][210];
int num[210];
int findset(int i){
return p[i]==i?p[i]:p[i]=findset(p[i]);
}
int FindBase(int N){
srand(202041);
int counter = 0;
for (int i = 0; i < N; i++) p[i] = i;
int fail = 0;
while (counter < 600){
int a = rand()%N,b = rand()%N;
if (fail > 1000) break;
fail++;
if (a == b) continue;
if (visit[a][b]) continue;
if (findset(a) == findset(b)) continue;
fail = 0;
counter++;
visit[a][b] = visit[b][a] = 1;
int temp = CollectRelics(a,b);
if (temp != -1) {
p[findset(a)] = temp;
p[findset(b)] = temp;
}
}
for (int i = 0; i < N; i++){
num[findset(i)]++;
}
for (int i = 0; i < N; i++) if (num[i] > N/2) return i;
return -1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
776 KB |
Correct : C = 152 |
2 |
Partially correct |
6 ms |
768 KB |
Partially correct : C = 600 |
3 |
Correct |
5 ms |
512 KB |
Correct : C = 0 |
4 |
Correct |
5 ms |
512 KB |
Correct : C = 3 |
5 |
Incorrect |
5 ms |
768 KB |
Wrong |
6 |
Runtime error |
179 ms |
262148 KB |
Execution killed with signal 9 (could be triggered by violating memory limits) |
7 |
Correct |
5 ms |
768 KB |
Correct : C = 147 |
8 |
Incorrect |
5 ms |
768 KB |
Wrong |
9 |
Partially correct |
5 ms |
640 KB |
Partially correct : C = 600 |
10 |
Partially correct |
5 ms |
768 KB |
Partially correct : C = 600 |
11 |
Partially correct |
6 ms |
896 KB |
Partially correct : C = 600 |
12 |
Partially correct |
5 ms |
640 KB |
Partially correct : C = 600 |
13 |
Partially correct |
5 ms |
640 KB |
Partially correct : C = 600 |
14 |
Runtime error |
170 ms |
262148 KB |
Execution killed with signal 9 (could be triggered by violating memory limits) |
15 |
Incorrect |
6 ms |
640 KB |
Wrong |
16 |
Partially correct |
6 ms |
768 KB |
Partially correct : C = 600 |
17 |
Partially correct |
5 ms |
768 KB |
Partially correct : C = 600 |
18 |
Partially correct |
6 ms |
768 KB |
Partially correct : C = 600 |
19 |
Partially correct |
5 ms |
640 KB |
Partially correct : C = 600 |
20 |
Correct |
5 ms |
640 KB |
Correct : C = 91 |
21 |
Incorrect |
6 ms |
768 KB |
Wrong |
22 |
Partially correct |
5 ms |
640 KB |
Partially correct : C = 600 |
23 |
Partially correct |
5 ms |
768 KB |
Partially correct : C = 600 |
24 |
Correct |
5 ms |
640 KB |
Correct : C = 89 |
25 |
Partially correct |
7 ms |
768 KB |
Partially correct : C = 600 |
26 |
Partially correct |
5 ms |
640 KB |
Partially correct : C = 600 |
27 |
Partially correct |
5 ms |
640 KB |
Partially correct : C = 600 |