Submission #130655

# Submission time Handle Problem Language Result Execution time Memory
130655 2019-07-15T19:13:29 Z tutis Amusement Park (JOI17_amusement_park) C++17
Compilation error
0 ms 0 KB
#include "Ioi.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
mt19937_64 rng(1561561);
int bitas[11000];
vector<int>adj[11000];
set<int>aplankyta;
int t = 0;
void dfs(int v)
{
	t++;
	t %= 60;
	bitas[v] = t;
	if (aplankyta.count(v))
		return;
	aplankyta.insert(v);
	for (int x : adj[v])
	{
		dfs(x);
	}
}
long long Ioi(int N, int M, int A[], int B[], int P, int V, int T)
{
	vector<int>PP(N);
	iota(PP.begin(), PP.end(), 0);
	shuffle(PP.begin(), PP.end(), mt19937_64(15651));
	for (int i = 0; i < M; i++)
	{
		adj[A[i]].push_back(B[i]);
		adj[B[i]].push_back(A[i]);
	}
	for (int i = 0; i < N; i++)
		shuffle(adj[i].begin(), adj[i].end(), rng);
	dfs(0);
	ll X = 0;
	vector<int>stak = {P};
	set<int>bitai;
	set<int>aplankyti;
	while (true)
	{
		X |= V * (1ll << bitas[P]);
		bitai.insert(bitas[P]);
		aplankyti.insert(P);
		if (bitai.size() == 60)
			break;
		int v1 = -1;
		for (int j : adj[P])
			if (aplankyti.count(j) == false)
				v1 = j;
		if (v1 == -1)
		{
			stak.pop_back();
			v1 = stak.back();
		}
		else
		{
			stak.push_back(v1);
		}
		V = Move(v1);
		P = v1;
	}
	return X;
}
#include "Ioi.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
mt19937_64 rng(1561561);
long long Ioi(int N, int M, int A[], int B[], int P, int V, int T)
{
	vector<int>PP(N);
	iota(PP.begin(), PP.end(), 0);
	shuffle(PP.begin(), PP.end(), mt19937_64(15651));
	int bitas[N];
	int t = 0;
	for (int i : PP)
	{
		bitas[i] = t;
		t = (t + 1) % 60;
	}
	for (int i = 0; i < M; i++)
	{
		adj[A[i]].push_back(B[i]);
		adj[B[i]].push_back(A[i]);
	}
	for (int i = 0; i < N; i++)
		shuffle(adj[i].begin(), adj[i].end(), rng);
	set<int>aplankyti;
	set<int>bitai;
	ll X = 0;
	vector<int>stak = {P};
	while (true)
	{
		X |= V * (1ll << bitas[P]);
		bitai.insert(bitas[P]);
		aplankyti.insert(P);
		if (bitai.size() == 60)
			break;
		int v1 = -1;
		for (int j : adj[P])
			if (aplankyti.count(j) == false)
				v1 = j;
		if (v1 == -1)
		{
			stak.pop_back();
			v1 = stak.back();
		}
		else
		{
			stak.push_back(v1);
		}
		V = Move(v1);
		P = v1;
	}
	return X;
}

Compilation message

Joi.cpp: In function 'long long int Ioi(int, int, int*, int*, int, int, int)':
Joi.cpp:60:7: error: 'Move' was not declared in this scope
   V = Move(v1);
       ^~~~

Ioi.cpp: In function 'long long int Ioi(int, int, int*, int*, int, int, int)':
Ioi.cpp:20:3: error: 'adj' was not declared in this scope
   adj[A[i]].push_back(B[i]);
   ^~~
Ioi.cpp:24:11: error: 'adj' was not declared in this scope
   shuffle(adj[i].begin(), adj[i].end(), rng);
           ^~~
Ioi.cpp:37:16: error: 'adj' was not declared in this scope
   for (int j : adj[P])
                ^~~