Submission #1021022

# Submission time Handle Problem Language Result Execution time Memory
1021022 2024-07-12T12:58:31 Z 0npata Amusement Park (JOI17_amusement_park) C++17
Compilation error
0 ms 0 KB
#include "Joi.h"

using namespace std;
#include<bits/stdc++.h>

#define vec vector

namespace joi {

const int MXN = 10'005;

int t = 0;

vec<int> tree[MXN];
int depth[MXN];
int ind[MXN];
vec<int> g[MXN];

void dfs1(int u, vec<bool>& vis) {
	vis[u] = true;
	for(int v : g[u]) {
		if(vis[v]) continue;
		dfs1(v, vis);
		depth[u] = max(depth[u], 1+depth[v]);
		tree[u].push_back(v);
	}
	sort(tree[u].begin(), tree[u].end(), [&](int x, int y) { return depth[x] > depth[y]; });
}

void dfs2(int u) {
	ind[u] = t;
	t += 1;
	for(int v : tree[u]) {
		dfs2(v);
	}
}

void Joi(int N, int M, int A[], int B[], long long X, int T) {

	vec<bool> vis(N);

	for(int i = 0; i<M; i++) {
		g[A[i]].push_back(B[i]);
		g[B[i]].push_back(A[i]);
	}


	dfs1(0, vis);

	dfs2(0);


	for(int i = 0; i < N; i++){
		int bi = ind[i] % 60;

		int val = (X & ((long long)1<<bi)) != 0;
		MessageBoard(i, val);

	}
}

}


void Joi(int N, int M, int A[], int B[], long long X, int T) { joi::Joi(N, M, A, B, X, T); };



    

Compilation message

/usr/bin/ld: /tmp/ccvCxQ6i.o: in function `main':
grader_ioi.cpp:(.text.startup+0x3f2): undefined reference to `Ioi(int, int, int*, int*, int, int, int)'
collect2: error: ld returned 1 exit status