Submission #762559

# Submission time Handle Problem Language Result Execution time Memory
762559 2023-06-21T13:47:04 Z goodbyehanbyeol Lokahian Relics (FXCUP4_lokahia) C++17
0 / 100
2 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 = 301;
	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 468 KB Partially correct : C = 420
2 Correct 0 ms 340 KB Correct : C = 0
3 Partially correct 1 ms 468 KB Partially correct : C = 419
4 Partially correct 1 ms 596 KB Partially correct : C = 500
5 Partially correct 1 ms 596 KB Partially correct : C = 500
6 Partially correct 1 ms 596 KB Partially correct : C = 499
7 Partially correct 1 ms 596 KB Partially correct : C = 301
8 Partially correct 1 ms 596 KB Partially correct : C = 499
9 Partially correct 1 ms 596 KB Partially correct : C = 500
10 Partially correct 2 ms 596 KB Partially correct : C = 500
11 Partially correct 1 ms 468 KB Partially correct : C = 301
12 Partially correct 1 ms 468 KB Partially correct : C = 419
13 Partially correct 1 ms 596 KB Partially correct : C = 499
14 Partially correct 1 ms 468 KB Partially correct : C = 419
15 Partially correct 1 ms 468 KB Partially correct : C = 419
16 Partially correct 1 ms 596 KB Partially correct : C = 301
17 Partially correct 1 ms 468 KB Partially correct : C = 420
18 Incorrect 1 ms 596 KB Wrong
19 Partially correct 2 ms 596 KB Partially correct : C = 500
20 Partially correct 1 ms 468 KB Partially correct : C = 305
21 Partially correct 1 ms 468 KB Partially correct : C = 420
22 Partially correct 1 ms 468 KB Partially correct : C = 420
23 Partially correct 1 ms 596 KB Partially correct : C = 499
24 Partially correct 1 ms 596 KB Partially correct : C = 499
25 Partially correct 1 ms 468 KB Partially correct : C = 301
26 Partially correct 2 ms 596 KB Partially correct : C = 500
27 Partially correct 1 ms 596 KB Partially correct : C = 500