답안 #379444

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
379444 2021-03-18T09:17:34 Z oolimry 로카히아 유적 (FXCUP4_lokahia) C++17
0 / 100
375 ms 1280 KB
#include "lokahia.h"
#include <bits/stdc++.h>
using namespace std;
#define sz(x) (int) (x).size()
#define all(x) (x).begin(), (x).end()
#define show(x) cerr << #x << " is " << x << endl;
#define show2(x, y) cerr << #x << " is " << x << "," << #y << " is " << y << endl;
typedef long long lint;
typedef pair<lint,lint> ii;

int n;
vector<int> adj[205];
int vis[205];
mt19937 rng(time(NULL));

void dfs(int u){
	if(vis[u]) return;
	vis[u] = 1;
	for(int v : adj[u]){
		dfs(v);
	}
}
int go(int a){
	fill(vis,vis+n,0);
	dfs(a);
	int cnt = 0;
	for(int i = 0;i < n;i++) cnt += vis[i];
	return cnt;
}

int FindBase(int N){
	n = N;
	int qrylimit = 600;
	
	int total = 10000000;
	
	vector<int> stuff;
	for(int i = 0;i < n;i++){
		stuff.push_back(i);
	}
	while(qrylimit >  0 and total > 0){
		int a = stuff[rng()%sz(stuff)];
		int b = stuff[rng()%sz(stuff)];
		total--;
		if(a == b) continue;
		
		int x = CollectRelics(a,b); qrylimit--;
		if(x != -1){
			adj[x].push_back(a);
			adj[x].push_back(b);
		}
	}
		
	for(int i = 0;i < n;i++){
		if(go(i) > n/2) return i;
	}
	assert(false);
	return -1;
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 4 ms 1132 KB Execution killed with signal 6
2 Runtime error 2 ms 1132 KB Execution killed with signal 6
3 Partially correct 2 ms 620 KB Partially correct : C = 600
4 Runtime error 4 ms 1132 KB Execution killed with signal 6
5 Partially correct 1 ms 620 KB Partially correct : C = 600
6 Runtime error 3 ms 1280 KB Execution killed with signal 6
7 Partially correct 1 ms 492 KB Partially correct : C = 600
8 Partially correct 1 ms 620 KB Partially correct : C = 600
9 Runtime error 2 ms 1004 KB Execution killed with signal 6
10 Partially correct 1 ms 620 KB Partially correct : C = 600
11 Runtime error 2 ms 1004 KB Execution killed with signal 6
12 Runtime error 3 ms 1276 KB Execution killed with signal 6
13 Runtime error 2 ms 1004 KB Execution killed with signal 6
14 Runtime error 2 ms 1004 KB Execution killed with signal 6
15 Runtime error 2 ms 1004 KB Execution killed with signal 6
16 Partially correct 1 ms 620 KB Partially correct : C = 600
17 Runtime error 3 ms 1132 KB Execution killed with signal 6
18 Partially correct 1 ms 620 KB Partially correct : C = 600
19 Partially correct 1 ms 620 KB Partially correct : C = 600
20 Runtime error 2 ms 1132 KB Execution killed with signal 6
21 Partially correct 1 ms 620 KB Partially correct : C = 600
22 Correct 375 ms 548 KB Correct : C = 0
23 Partially correct 2 ms 620 KB Partially correct : C = 600
24 Runtime error 3 ms 1132 KB Execution killed with signal 6
25 Runtime error 2 ms 1132 KB Execution killed with signal 6
26 Runtime error 2 ms 1132 KB Execution killed with signal 6
27 Runtime error 3 ms 1132 KB Execution killed with signal 6