Submission #130656

# Submission time Handle Problem Language Result Execution time Memory
130656 2019-07-15T19:15:08 Z tutis Amusement Park (JOI17_amusement_park) C++17
0 / 100
824 ms 5660 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;
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);
	}
}
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(0);
	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;
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;
}
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 1476 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 54 ms 5324 KB Output is correct
2 Correct 52 ms 5568 KB Output is correct
3 Correct 54 ms 5504 KB Output is correct
4 Correct 31 ms 3868 KB Output is correct
5 Correct 32 ms 4504 KB Output is correct
6 Correct 32 ms 4272 KB Output is correct
7 Correct 34 ms 4448 KB Output is correct
8 Correct 31 ms 4376 KB Output is correct
9 Correct 32 ms 4468 KB Output is correct
10 Correct 585 ms 4396 KB Output is correct
11 Correct 824 ms 4508 KB Output is correct
12 Correct 28 ms 3692 KB Output is correct
13 Correct 27 ms 3728 KB Output is correct
14 Correct 32 ms 3964 KB Output is correct
15 Correct 31 ms 4000 KB Output is correct
16 Correct 31 ms 3992 KB Output is correct
17 Correct 31 ms 4036 KB Output is correct
18 Correct 31 ms 4004 KB Output is correct
19 Correct 31 ms 4140 KB Output is correct
20 Correct 23 ms 4528 KB Output is correct
21 Correct 23 ms 4512 KB Output is correct
22 Correct 32 ms 4336 KB Output is correct
23 Correct 33 ms 4604 KB Output is correct
24 Correct 33 ms 4372 KB Output is correct
25 Correct 33 ms 4620 KB Output is correct
26 Correct 33 ms 4248 KB Output is correct
27 Correct 33 ms 4384 KB Output is correct
28 Correct 32 ms 4456 KB Output is correct
29 Correct 28 ms 4100 KB Output is correct
30 Correct 30 ms 4108 KB Output is correct
31 Incorrect 5 ms 1396 KB Wrong Answer [7]
32 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 1472 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 54 ms 5468 KB Partially correct
2 Partially correct 53 ms 5504 KB Partially correct
3 Partially correct 52 ms 5660 KB Partially correct
4 Partially correct 30 ms 3992 KB Partially correct
5 Partially correct 31 ms 4760 KB Partially correct
6 Partially correct 31 ms 4384 KB Partially correct
7 Partially correct 32 ms 4380 KB Partially correct
8 Partially correct 32 ms 4300 KB Partially correct
9 Partially correct 32 ms 4296 KB Partially correct
10 Incorrect 321 ms 4264 KB Output isn't correct
11 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 52 ms 5184 KB Output isn't correct
2 Halted 0 ms 0 KB -