Submission #762554

# Submission time Handle Problem Language Result Execution time Memory
762554 2023-06-21T13:41:46 Z goodbyehanbyeol Lokahian Relics (FXCUP4_lokahia) C++17
0 / 100
1 ms 596 KB
#include "lokahia.h"
#include <bits/stdc++.h>
using namespace std;

int FindBase(int n){
	if(n == 1) return 0;
	mt19937 gen(time(NULL));
	uniform_int_distribution<int> uid(0, n - 1);

	vector<int> cnt(n);
	int rep = 401;
	for(int i = 0; i < rep; ++i){
		int x = uid(gen), y = uid(gen);
		while(x == y){
			y = uid(gen);
		}
		int rv = CollectRelics(x, y);
		if(rv != -1){
			++cnt[rv];
		}
	}
	int mx = 0, pos = -1;
	for(int i = 0; i < n; ++i){
		if(cnt[i] > mx){
			mx = cnt[i];
			pos = i;
		}
	}
	if(pos == -1) return -1;

	int gocnt = 1;
	for(int i = 0; i < n; ++i){
		if(i == pos) continue;
		gocnt += (CollectRelics(pos, i) != -1);
	}
	if(gocnt > n / 2) return pos;
	return -1;
}
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 596 KB Partially correct : C = 600
2 Partially correct 1 ms 596 KB Partially correct : C = 600
3 Partially correct 1 ms 468 KB Partially correct : C = 401
4 Partially correct 1 ms 596 KB Partially correct : C = 599
5 Partially correct 0 ms 340 KB Partially correct : C = 405
6 Partially correct 1 ms 596 KB Partially correct : C = 600
7 Correct 0 ms 340 KB Correct : C = 0
8 Partially correct 1 ms 468 KB Partially correct : C = 519
9 Partially correct 1 ms 468 KB Partially correct : C = 520
10 Incorrect 1 ms 536 KB Wrong
11 Partially correct 1 ms 468 KB Partially correct : C = 519
12 Partially correct 1 ms 596 KB Partially correct : C = 600
13 Partially correct 1 ms 468 KB Partially correct : C = 519
14 Partially correct 1 ms 468 KB Partially correct : C = 520
15 Partially correct 1 ms 596 KB Partially correct : C = 401
16 Partially correct 1 ms 596 KB Partially correct : C = 599
17 Partially correct 1 ms 468 KB Partially correct : C = 520
18 Partially correct 1 ms 596 KB Partially correct : C = 600
19 Partially correct 1 ms 468 KB Partially correct : C = 520
20 Partially correct 1 ms 596 KB Partially correct : C = 599
21 Partially correct 1 ms 596 KB Partially correct : C = 600
22 Partially correct 1 ms 596 KB Partially correct : C = 599
23 Partially correct 1 ms 596 KB Partially correct : C = 401
24 Partially correct 1 ms 468 KB Partially correct : C = 401
25 Partially correct 1 ms 596 KB Partially correct : C = 599
26 Partially correct 1 ms 596 KB Partially correct : C = 600
27 Partially correct 1 ms 596 KB Partially correct : C = 599