답안 #130640

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
130640 2019-07-15T18:58:03 Z tutis Amusement Park (JOI17_amusement_park) C++17
18 / 100
146 ms 3456 KB
#include "Joi.h"
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
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));
	int bitas[N];
	int t = 0;
	for (int i : PP)
	{
		bitas[i] = t;
		t = (t + 1) % 60;
	}
	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);
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;
	}
	vector<int>adj[N];
	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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 884 KB Output is correct
2 Correct 4 ms 1008 KB Output is correct
3 Correct 5 ms 920 KB Output is correct
4 Correct 4 ms 756 KB Output is correct
5 Correct 4 ms 884 KB Output is correct
6 Correct 4 ms 756 KB Output is correct
7 Correct 4 ms 892 KB Output is correct
8 Correct 7 ms 896 KB Output is correct
9 Correct 4 ms 904 KB Output is correct
10 Correct 4 ms 892 KB Output is correct
11 Correct 8 ms 1088 KB Output is correct
12 Correct 4 ms 884 KB Output is correct
13 Correct 4 ms 764 KB Output is correct
14 Correct 4 ms 764 KB Output is correct
15 Correct 4 ms 764 KB Output is correct
16 Correct 4 ms 892 KB Output is correct
17 Correct 4 ms 768 KB Output is correct
18 Correct 4 ms 896 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 27 ms 3456 KB Output is correct
2 Correct 27 ms 3328 KB Output is correct
3 Correct 27 ms 3284 KB Output is correct
4 Correct 18 ms 2464 KB Output is correct
5 Correct 18 ms 2464 KB Output is correct
6 Correct 18 ms 2564 KB Output is correct
7 Correct 18 ms 2460 KB Output is correct
8 Correct 19 ms 2436 KB Output is correct
9 Correct 18 ms 2456 KB Output is correct
10 Correct 95 ms 2468 KB Output is correct
11 Correct 81 ms 2460 KB Output is correct
12 Correct 18 ms 2304 KB Output is correct
13 Correct 18 ms 2452 KB Output is correct
14 Correct 19 ms 2424 KB Output is correct
15 Correct 19 ms 2492 KB Output is correct
16 Correct 19 ms 2464 KB Output is correct
17 Correct 19 ms 2456 KB Output is correct
18 Correct 19 ms 2464 KB Output is correct
19 Correct 19 ms 2328 KB Output is correct
20 Correct 18 ms 2464 KB Output is correct
21 Correct 16 ms 2612 KB Output is correct
22 Correct 19 ms 2584 KB Output is correct
23 Correct 17 ms 2464 KB Output is correct
24 Correct 18 ms 2328 KB Output is correct
25 Correct 18 ms 2468 KB Output is correct
26 Correct 18 ms 2656 KB Output is correct
27 Correct 18 ms 2656 KB Output is correct
28 Correct 18 ms 2476 KB Output is correct
29 Correct 17 ms 2440 KB Output is correct
30 Correct 17 ms 2324 KB Output is correct
31 Correct 4 ms 756 KB Output is correct
32 Correct 4 ms 892 KB Output is correct
33 Correct 5 ms 964 KB Output is correct
34 Correct 4 ms 892 KB Output is correct
35 Correct 4 ms 972 KB Output is correct
36 Correct 4 ms 884 KB Output is correct
37 Correct 4 ms 1004 KB Output is correct
38 Correct 4 ms 1020 KB Output is correct
39 Correct 4 ms 764 KB Output is correct
40 Correct 4 ms 892 KB Output is correct
41 Correct 4 ms 968 KB Output is correct
42 Correct 5 ms 768 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 844 KB Output is correct
2 Correct 4 ms 764 KB Output is correct
3 Correct 4 ms 844 KB Output is correct
4 Incorrect 6 ms 1064 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Partially correct 28 ms 3336 KB Partially correct
2 Partially correct 30 ms 3448 KB Partially correct
3 Partially correct 28 ms 3424 KB Partially correct
4 Partially correct 18 ms 2524 KB Partially correct
5 Partially correct 19 ms 2500 KB Partially correct
6 Partially correct 19 ms 2500 KB Partially correct
7 Partially correct 18 ms 2528 KB Partially correct
8 Partially correct 19 ms 2472 KB Partially correct
9 Partially correct 19 ms 2524 KB Partially correct
10 Partially correct 146 ms 2628 KB Partially correct
11 Partially correct 107 ms 2624 KB Partially correct
12 Partially correct 17 ms 2440 KB Partially correct
13 Partially correct 17 ms 2432 KB Partially correct
14 Partially correct 17 ms 2564 KB Partially correct
15 Partially correct 18 ms 2492 KB Partially correct
16 Incorrect 18 ms 2656 KB Output isn't correct
17 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 28 ms 3336 KB Output isn't correct
2 Halted 0 ms 0 KB -