Submission #149343

# Submission time Handle Problem Language Result Execution time Memory
149343 2019-09-01T06:17:13 Z Ian and 2-bit memory(#3648, percywtc, nhho, ulna) Lokahian Relics (FXCUP4_lokahia) C++17
0 / 100
7 ms 640 KB
#include <bits/stdc++.h>

using namespace std;


#include "lokahia.h"
int tmp;

int FindBase(int N){
if (N == 1)
	return 0;
srand(123);
	int left = 600 - (N - 1);
	map<int, int> m;
	while (left) {
		int ta = rand() % N;
		int tb = rand() % N;
		if (ta == tb) continue;
		// printf("%d  %d %d\n", ++tmp, ta, tb);
		int tc = CollectRelics(ta, tb);
		if (tc != -1)
		m[tc]++;
		left--;
	}
	int ans = -1, ma = -1;
	//for (auto& i : m) printf("%d %d\n", i.first, i.second);
	for (auto& i : m)
		if (i.second >= ma) {
			ans = i.first;
			ma = i.second;
		}
	// printf("%d %d\n", ans, ma);
	if (ans == -1)
		return ans;
	ma = 1;
	for (int i = 0; i < N; i++)
		if (i != ans) {
			int ta = CollectRelics(i, ans);
			if (ta <= ans && ta != -1) {
				ma++;
				ans = ta;
			}
		}
	if (ma > N / 2)
		return ans;
	return -1;
}
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 640 KB Wrong
2 Partially correct 7 ms 640 KB Partially correct : C = 600
3 Partially correct 7 ms 640 KB Partially correct : C = 600
4 Partially correct 6 ms 564 KB Partially correct : C = 600
5 Partially correct 6 ms 512 KB Partially correct : C = 600
6 Partially correct 6 ms 592 KB Partially correct : C = 402
7 Partially correct 6 ms 640 KB Partially correct : C = 482
8 Partially correct 7 ms 600 KB Partially correct : C = 600
9 Partially correct 7 ms 640 KB Partially correct : C = 600
10 Partially correct 6 ms 600 KB Partially correct : C = 401
11 Partially correct 6 ms 512 KB Partially correct : C = 600
12 Partially correct 7 ms 640 KB Partially correct : C = 600
13 Partially correct 7 ms 640 KB Partially correct : C = 600
14 Partially correct 7 ms 512 KB Partially correct : C = 600
15 Partially correct 7 ms 600 KB Partially correct : C = 600
16 Partially correct 7 ms 640 KB Partially correct : C = 600
17 Partially correct 7 ms 640 KB Partially correct : C = 600
18 Correct 6 ms 476 KB Correct : C = 0
19 Partially correct 6 ms 600 KB Partially correct : C = 600
20 Partially correct 7 ms 600 KB Partially correct : C = 600
21 Partially correct 7 ms 512 KB Partially correct : C = 600
22 Partially correct 6 ms 640 KB Partially correct : C = 600
23 Partially correct 6 ms 512 KB Partially correct : C = 600
24 Partially correct 7 ms 640 KB Partially correct : C = 600
25 Partially correct 7 ms 640 KB Partially correct : C = 600
26 Partially correct 6 ms 604 KB Partially correct : C = 481
27 Partially correct 6 ms 640 KB Partially correct : C = 600