Submission #247165

# Submission time Handle Problem Language Result Execution time Memory
247165 2020-07-11T07:00:41 Z oolimry Lokahian Relics (FXCUP4_lokahia) C++17
0 / 100
6 ms 640 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] >= 150) 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 Incorrect 6 ms 512 KB Wrong
2 Partially correct 5 ms 640 KB Partially correct : C = 400
3 Partially correct 5 ms 512 KB Partially correct : C = 400
4 Partially correct 5 ms 640 KB Partially correct : C = 400
5 Partially correct 5 ms 640 KB Partially correct : C = 400
6 Partially correct 5 ms 512 KB Partially correct : C = 400
7 Partially correct 6 ms 640 KB Partially correct : C = 400
8 Incorrect 6 ms 640 KB Wrong
9 Incorrect 5 ms 640 KB Wrong
10 Partially correct 5 ms 640 KB Partially correct : C = 400
11 Partially correct 5 ms 640 KB Partially correct : C = 400
12 Partially correct 5 ms 640 KB Partially correct : C = 400
13 Partially correct 6 ms 640 KB Partially correct : C = 400
14 Incorrect 6 ms 640 KB Wrong
15 Partially correct 5 ms 512 KB Partially correct : C = 400
16 Partially correct 5 ms 640 KB Partially correct : C = 400
17 Partially correct 5 ms 512 KB Partially correct : C = 400
18 Incorrect 5 ms 640 KB Wrong
19 Correct 5 ms 512 KB Correct : C = 0
20 Incorrect 5 ms 640 KB Wrong
21 Incorrect 5 ms 512 KB Wrong
22 Partially correct 4 ms 512 KB Partially correct : C = 400
23 Partially correct 5 ms 512 KB Partially correct : C = 400
24 Partially correct 5 ms 640 KB Partially correct : C = 400
25 Partially correct 5 ms 512 KB Partially correct : C = 400
26 Incorrect 6 ms 512 KB Wrong
27 Incorrect 6 ms 512 KB Wrong