답안 #130631

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
130631 2019-07-15T18:53:01 Z tutis Amusement Park (JOI17_amusement_park) C++17
18 / 100
209 ms 3144 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]);
	}
	set<int>aplankyti;
	set<int>bitai;
	ll X = 0;
	while (true)
	{
		X |= V * (1ll << bitas[P]);
		bitai.insert(bitas[P]);
		aplankyti.insert(P);
		if (bitai.size() == 60)
			break;
		shuffle(adj[P].begin(), adj[P].end(), rng);
		int v1 = adj[P][0];
		for (int j : adj[P])
			if (aplankyti.count(j) == false)
				v1 = j;
		V = Move(v1);
		P = v1;
	}
	return X;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 752 KB Output is correct
2 Correct 4 ms 1000 KB Output is correct
3 Correct 4 ms 888 KB Output is correct
4 Correct 4 ms 880 KB Output is correct
5 Correct 4 ms 752 KB Output is correct
6 Correct 4 ms 916 KB Output is correct
7 Correct 4 ms 892 KB Output is correct
8 Correct 8 ms 640 KB Output is correct
9 Correct 4 ms 764 KB Output is correct
10 Correct 4 ms 756 KB Output is correct
11 Correct 8 ms 1216 KB Output is correct
12 Correct 4 ms 764 KB Output is correct
13 Correct 4 ms 892 KB Output is correct
14 Correct 5 ms 892 KB Output is correct
15 Correct 4 ms 764 KB Output is correct
16 Correct 5 ms 764 KB Output is correct
17 Correct 4 ms 764 KB Output is correct
18 Correct 5 ms 892 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 27 ms 3016 KB Output is correct
2 Correct 27 ms 2880 KB Output is correct
3 Correct 27 ms 3144 KB Output is correct
4 Correct 17 ms 2108 KB Output is correct
5 Correct 19 ms 2348 KB Output is correct
6 Correct 19 ms 2456 KB Output is correct
7 Correct 17 ms 2328 KB Output is correct
8 Correct 18 ms 2456 KB Output is correct
9 Correct 17 ms 2328 KB Output is correct
10 Correct 209 ms 2592 KB Output is correct
11 Correct 150 ms 2488 KB Output is correct
12 Correct 17 ms 2304 KB Output is correct
13 Correct 17 ms 2432 KB Output is correct
14 Correct 19 ms 2316 KB Output is correct
15 Correct 19 ms 2464 KB Output is correct
16 Correct 18 ms 2324 KB Output is correct
17 Correct 19 ms 2456 KB Output is correct
18 Correct 19 ms 2432 KB Output is correct
19 Correct 18 ms 2456 KB Output is correct
20 Correct 14 ms 2328 KB Output is correct
21 Correct 16 ms 2492 KB Output is correct
22 Correct 17 ms 2584 KB Output is correct
23 Correct 17 ms 2344 KB Output is correct
24 Correct 18 ms 2544 KB Output is correct
25 Correct 17 ms 2456 KB Output is correct
26 Correct 17 ms 2328 KB Output is correct
27 Correct 17 ms 2656 KB Output is correct
28 Correct 17 ms 2332 KB Output is correct
29 Correct 17 ms 2432 KB Output is correct
30 Correct 17 ms 2444 KB Output is correct
31 Correct 4 ms 760 KB Output is correct
32 Correct 5 ms 892 KB Output is correct
33 Correct 7 ms 764 KB Output is correct
34 Correct 4 ms 756 KB Output is correct
35 Correct 4 ms 840 KB Output is correct
36 Correct 4 ms 756 KB Output is correct
37 Correct 5 ms 756 KB Output is correct
38 Correct 4 ms 756 KB Output is correct
39 Correct 4 ms 888 KB Output is correct
40 Correct 4 ms 760 KB Output is correct
41 Correct 4 ms 884 KB Output is correct
42 Correct 4 ms 888 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 756 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Partially correct 27 ms 2752 KB Partially correct
2 Partially correct 27 ms 2780 KB Partially correct
3 Partially correct 27 ms 2880 KB Partially correct
4 Incorrect 18 ms 2284 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 28 ms 2892 KB Output isn't correct
2 Halted 0 ms 0 KB -