Submission #157096

# Submission time Handle Problem Language Result Execution time Memory
157096 2019-10-09T13:36:55 Z Saboon Amusement Park (JOI17_amusement_park) C++14
0 / 100
36 ms 4508 KB
#include "Joi.h"
#include <bits/stdc++.h>

using namespace std;

const int maxn = 10000 + 10;
bool visited[maxn];
int st[maxn], Time = 0;
vector<int> g[maxn];

void dfs(int v){
	visited[v] = 1;
	st[v] = Time ++;
	for (auto u : g[v])
		if (!visited[u])
			dfs(u);
}

void Joi(int N, int M, int A[], int B[], long long X, int T) {
	for (int i = 0; i < M; i++){
		g[A[i]].push_back(B[i]);
		g[B[i]].push_back(A[i]);
	}
	for (int i = 0; i < N; i++)
		sort(g[i].begin(), g[i].end());
	dfs(0);
	for (int i = 0; i < N; i++){
		bool r = 0;
		if (X & (1 << (st[i] % 60)))
			r = 1;
		MessageBoard(i, r);
	}
}
#include "Ioi.h"
#include <bits/stdc++.h>
using namespace std;

const int maxn = 10000 + 10;
bool visited[maxn];
int st[maxn], Time = 0;
vector<int> g[maxn];
int now, board, cnt = 0;
int b[maxn];

void dfs(int v, int par = -1){
	visited[v] = 1;
	st[v] = Time ++;
	if (now == v)
		b[st[v] % 60] = board;

	for (auto u : g[v]){
		if (!visited[u]){
			if (v == now and cnt < 120){
				now = u;
				cnt ++;
				board = Move(u);
			}
			dfs(u, v);
		}
	}
	if (par != -1 and v == now and cnt < 120){
		now = par;
		cnt ++;
		board = Move(par);
	}
}

long long Ioi(int N, int M, int A[], int B[], int P, int V, int T) {
	for (int i = 0; i < M; i++){
		g[A[i]].push_back(B[i]);
		g[B[i]].push_back(A[i]);
	}
	for (int i = 0; i < N; i++)
		sort(g[i].begin(), g[i].end());
	memset(b, -1, sizeof b);
	now = P;
	board = V;
	dfs(0);
	long long ret = 0;
	for (int i = 0; i < 60; i++)
		ret += 1ll * b[i] * (1ll << i);
	return ret;
}
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 1396 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 35 ms 4360 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 1404 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 36 ms 4508 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 35 ms 4352 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -