Submission #247160

# Submission time Handle Problem Language Result Execution time Memory
247160 2020-07-11T06:58:48 Z oolimry Lokahian Relics (FXCUP4_lokahia) C++17
0 / 100
7 ms 688 KB
#include "lokahia.h"
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> ii;

int FindBase(int N){
	srand(time(NULL));
	vector<int> v;
	
	if(N == 1){
		return 0;
	}
	
	for(int i = 0;i < N;i++) v.push_back(i);

	
	int cnt = 0;
	map<int,int> occur;
	
	while(cnt < 400){
		int a = rand() % N, b = rand() % N;
		if(a == b) continue;
		
		cnt++;
		int x = CollectRelics(a,b);
		occur[x]++;
	}
	
	int best = 0;
	for(int i = 0;i < N;i++){
		if(occur[best] < occur[i]){
			best = i;
		}
	}
	
	
	if(occur[best] >= 100) return best;
	/*
	int total = 0;
	for(int i = 0;i < N;i++){
		if(i == best){
			total++;
			continue;
		}
		
		if(CollectRelics(i,best) != -1) total++;
	}
	*/
	
	//if(total > (N/2) ) return best;
	return -1;
}
# Verdict Execution time Memory Grader output
1 Partially correct 5 ms 512 KB Partially correct : C = 400
2 Partially correct 5 ms 640 KB Partially correct : C = 400
3 Incorrect 7 ms 512 KB Wrong
4 Partially correct 6 ms 688 KB Partially correct : C = 400
5 Incorrect 5 ms 512 KB Wrong
6 Partially correct 5 ms 640 KB Partially correct : C = 400
7 Partially correct 5 ms 512 KB Partially correct : C = 400
8 Correct 5 ms 512 KB Correct : C = 0
9 Partially correct 5 ms 512 KB Partially correct : C = 400
10 Incorrect 5 ms 616 KB Wrong
11 Incorrect 6 ms 640 KB Wrong
12 Partially correct 6 ms 640 KB Partially correct : C = 400
13 Incorrect 5 ms 512 KB Wrong
14 Partially correct 6 ms 640 KB Partially correct : C = 400
15 Partially correct 6 ms 640 KB Partially correct : C = 400
16 Incorrect 5 ms 640 KB Wrong
17 Partially correct 6 ms 512 KB Partially correct : C = 400
18 Partially correct 5 ms 640 KB Partially correct : C = 400
19 Partially correct 5 ms 640 KB Partially correct : C = 400
20 Incorrect 5 ms 512 KB Wrong
21 Partially correct 5 ms 640 KB Partially correct : C = 400
22 Partially correct 6 ms 640 KB Partially correct : C = 400
23 Partially correct 5 ms 640 KB Partially correct : C = 400
24 Partially correct 7 ms 640 KB Partially correct : C = 400
25 Partially correct 5 ms 512 KB Partially correct : C = 400
26 Partially correct 5 ms 640 KB Partially correct : C = 400
27 Incorrect 7 ms 640 KB Wrong