Submission #759951

# Submission time Handle Problem Language Result Execution time Memory
759951 2023-06-17T05:56:39 Z denniskim Lokahian Relics (FXCUP4_lokahia) C++17
0 / 100
595 ms 780 KB
#include "lokahia.h"
#include <bits/stdc++.h>

using namespace std;
typedef int ll;
typedef __int128 lll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
#define MAX 9223372036854775807LL
#define MIN -9223372036854775807LL
#define INF 0x3f3f3f3f3f3f3f3f
#define fi first
#define se second
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cout << fixed; cout.precision(10);
#define sp << " "
#define en << "\n"
#define compress(v) sort(v.begin(), v.end()), v.erase(unique(v.begin(), v.end()), v.end())

ll chk[210][210];
ll cou[210];

ll FindBase(ll N)
{
	srand(time(NULL));
	
	for(ll i = 0 ; i < 300 ; i++)
	{
		ll num1 = rand() % N, num2 = rand() % N;
		ll coco = 0;
		
		while(chk[num1][num2] || num1 == num2)
		{
			num1 = rand() % N;
			num2 = rand() % N;
			coco++;
			
			if(coco >= 100000)
				break;
		}
		
		if(coco >= 100000)
			continue;
		
		ll gap = CollectRelics(num1, num2);
		chk[num1][num2] = chk[num2][num1] = 1;
		
		if(gap != -1)
			cou[gap]++;
	}
	
	ll maxx = 0, sum = 0, ans = 0;
	
	for(ll i = 0 ; i < N ; i++)
	{
		if(cou[i] > maxx)
		{
			maxx = cou[i];
			ans = i;
		}
		
		sum += cou[i];
	}
	
	if(sum - maxx * 2 <= 5)
		return ans;
	
	return -1;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 596 KB Correct : C = 300
2 Incorrect 1 ms 596 KB Wrong
3 Correct 595 ms 468 KB Correct : C = 10
4 Incorrect 1 ms 596 KB Wrong
5 Correct 1 ms 724 KB Correct : C = 300
6 Incorrect 1 ms 596 KB Wrong
7 Correct 519 ms 444 KB Correct : C = 0
8 Correct 1 ms 596 KB Correct : C = 300
9 Correct 1 ms 596 KB Correct : C = 300
10 Correct 1 ms 724 KB Correct : C = 300
11 Correct 1 ms 724 KB Correct : C = 300
12 Incorrect 1 ms 724 KB Wrong
13 Incorrect 1 ms 660 KB Wrong
14 Incorrect 1 ms 724 KB Wrong
15 Correct 1 ms 780 KB Correct : C = 300
16 Incorrect 1 ms 724 KB Wrong
17 Correct 1 ms 724 KB Correct : C = 300
18 Correct 1 ms 724 KB Correct : C = 300
19 Correct 1 ms 596 KB Correct : C = 300
20 Incorrect 1 ms 596 KB Wrong
21 Correct 1 ms 724 KB Correct : C = 300
22 Correct 1 ms 724 KB Correct : C = 300
23 Correct 1 ms 596 KB Correct : C = 300
24 Incorrect 1 ms 596 KB Wrong
25 Incorrect 1 ms 724 KB Wrong
26 Incorrect 1 ms 724 KB Wrong
27 Incorrect 1 ms 724 KB Wrong