Submission #130667

# Submission time Handle Problem Language Result Execution time Memory
130667 2019-07-15T19:37:28 Z tutis Amusement Park (JOI17_amusement_park) C++17
Compilation error
0 ms 0 KB
#include "Joi.h"
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
mt19937_64 rng(1561561);
int bitas[11000];
vector<int>adj[11000];
set<int>aplankyta;
int t = 0;
set<pair<int, int>>EE;
void dfs(int v, int p = -2)
{
	if (aplankyta.count(v))
		return;
	EE.insert({v, p});
	EE.insert({p, v});
	aplankyta.insert(v);
	t++;
	t %= 60;
	bitas[v] = t;
	for (int x : adj[v])
	{
		dfs(x,v);
	}
}
void Joi(int N, int M, int A[], int B[], long long X, 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(rng() % N);
	for (int i = 0; i < N; i++)
	{
		int s = 0;
		if ((X & (1ll << bitas[i])) > 0)
			s = 1;
		MessageBoard(i, s);
	}
}
#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;
set<pair<int, int>>EE;
vector<int>order;
void dfs(int v, int p = -2)
{
	if (aplankyta.count(v))
		return;
	order.push_back(v);
	EE.insert({v, p});
	EE.insert({p, v});
	aplankyta.insert(v);
	t++;
	t %= 60;
	bitas[v] = t;
	for (int x : adj[v])
	{
		if (aplankyta.count(x))
			continue;
		dfs(x, v);
		order.push_back(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(rng() % N);
	ll X = 0;
	vector<int>stak = {P};
	set<int>bitai;
	set<int>aplankyti;
	int ii = find(order.begin(), order.end(), P);
	while (true)
	{
		X |= V * (1ll << bitas[P]);
		bitai.insert(bitas[P]);
		aplankyti.insert(P);
		if (bitai.size() == 60)
			break;
		int v1 = order[(ii + 1) % v1.size()];
		V = Move(v1);
		P = v1;
		ii++;
	}
	return X;
}

Compilation message

Ioi.cpp: In function 'long long int Ioi(int, int, int*, int*, int, int, int)':
Ioi.cpp:48:45: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization
  int ii = find(order.begin(), order.end(), P);
                                             ^
Ioi.cpp:56:32: error: request for member 'size' in 'v1', which is of non-class type 'int'
   int v1 = order[(ii + 1) % v1.size()];
                                ^~~~