제출 #41795

#제출 시각아이디문제언어결과실행 시간메모리
41795festAmusement Park (JOI17_amusement_park)C++14
78 / 100
52 ms20672 KiB
#include "Joi.h"
// fest
#include <bits/stdc++.h>	

#define pb push_back
#define F first
#define S second
#define y1 dasdasfasfas
#define x1 wqdadfasfasfas
#define All(c) c.begin(), c.end()
#define SZ(A) (int((A).size()))
#define umap unordered_map
#define FILENAME ""
#define __ fflush(stdout)

typedef long long ll;
typedef long double ld;    

using namespace std;                           

inline double Time() {return (clock() * 1.0) / CLOCKS_PER_SEC; }             

static const int N = 200500, inf = 1e9 * 2, MOD = (int)1e9 + 7;

static char CH[N];

static const ll INF = 1e18;

static const int dx[] = {1, -1, 0, 0, -1, 1, -1, 1};
static const int dy[] = {0, 0, 1, -1, -1, 1, 1, -1};

static int in[N], timer;

static bool was[N];

static vector<int> g[N];

static void dfs(int v) {
	was[v] = 1;
	in[v] = ++timer;
	for (auto u : g[v]) {
		if (was[u]) continue;
		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]].pb(B[i]);
		g[B[i]].pb(A[i]);
	} 
	dfs(0);
	for (int i = 0; i < n; i++) {
		if ((1ll << (in[i] % 60)) & x) MessageBoard(i, 1);
		else MessageBoard(i, 0);
	}
}
#include "Ioi.h"
// fest
#include <bits/stdc++.h>	

#define pb push_back
#define F first
#define S second
#define y1 dasdasfasfas
#define x1 wqdadfasfasfas
#define All(c) c.begin(), c.end()
#define SZ(A) (int((A).size()))
#define umap unordered_map
#define FILENAME ""
#define __ fflush(stdout)

typedef long long ll;
typedef long double ld;    

using namespace std;                           

inline double Time() {return (clock() * 1.0) / CLOCKS_PER_SEC; }             

static const int N = 200500, inf = 1e9 * 2, MOD = (int)1e9 + 7;

static char CH[N];

static const ll INF = 1e18;

static const int dx[] = {1, -1, 0, 0, -1, 1, -1, 1};
static const int dy[] = {0, 0, 1, -1, -1, 1, 1, -1};

static int in[N], timer, up[N], bit[N], dont;

static bool was[N];

static vector<int> g[N];

static void dfs(int v) {
	was[v] = 1;
	in[v] = ++timer;
	for (auto u : g[v]) {
		if (was[u]) continue;
		up[u] = v;
		dfs(u);        
	}
}

static void dfs1(int v) {
	if (!dont) return;
	was[v] = 1;
	for (auto u : g[v]) {
		if (was[u]) continue;
		if (in[u] > in[v]) {
			if (bit[in[u] % 60] == -1) dont--;
			bit[in[u] % 60] = Move(u);
			dfs1(u);
			if (!dont) return;
			Move(v);
		}
	}
	assert(v > 0);
	if (was[up[v]]) return;
	if (bit[in[up[v]] % 60] == -1) dont--;
	bit[in[up[v]] % 60] = Move(up[v]);
	if (!dont) return;	
	dfs1(up[v]);
}

long long Ioi(int n, int m, int A[], int B[], int start, int msg, int T) {
	for (int i = 0; i < m; i++) g[A[i]].pb(B[i]), g[B[i]].pb(A[i]);
	dfs(0);
	for (int i = 0; i < 60; i++) bit[i] = -1;
	dont = 60;
	bit[in[start] % 60] = msg;
	dont--;
	memset(was, 0, sizeof(was));
	dfs1(start);
	ll ret = 0;
	for (int i = 0; i < 60; i++) ret |= ((bit[i] * 1ll) << i);
	return ret;
}

컴파일 시 표준 에러 (stderr) 메시지

Joi.cpp:25:13: warning: 'CH' defined but not used [-Wunused-variable]
 static char CH[N];
             ^

Ioi.cpp:25:13: warning: 'CH' defined but not used [-Wunused-variable]
 static char CH[N];
             ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...