답안 #41746

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
41746 2018-02-21T06:55:26 Z fest Amusement Park (JOI17_amusement_park) C++14
28 / 100
34 ms 13864 KB
#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};

void Joi(int n, int m, int A[], int B[], long long x, int T) {
	if (T <= 2) {
		for (int i = 0; i < 60; i++) {
			if (x & (1ll << i)) MessageBoard(i, 1);
			else MessageBoard(i, 0);
		}
		for (int i = 60; i < n; i++) MessageBoard(i, 0);
	}
	else {
		for (int i = 0; i < n; i += 60) {
			for (int j = 0; j < 60; j++) {
				if (i + j >= n) break;
				if (x & (1ll << j)) MessageBoard(i + j, 1);
				else MessageBoard(i + j, 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 bool was[N];

static int rev[N];

static vector<int> g[N];

void dfs(int v, int pr) {
	was[v] = 1;
	for (auto u : g[v]) {
		if (was[u]) continue;
		rev[u] = Move(u);
		dfs(u, v);
	}
	if (pr >= 0) Move(pr);
}

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]);
	rev[start] = msg;
	if (T != 3) {
		dfs(start, -1);
		ll ret = 0;
		for (int i = 0; i < 60; i++) ret |= ((rev[i] * 1ll) << i);	
		return ret;
	}
	int v = start;
	int cnt = 120;
	while (v > 0 && cnt) {
		cnt--;
		v--;
		rev[v] = Move(v);
	} 
	int st = ((v + 59) / 60) * 60;
	while (v < st) {
		v++;
		rev[v] = Move(v);
	}
	ll ret = 0;
	for (int i = st; i < st + 60; i++) {
		if (i != st) rev[i] = Move(i); 	
	  ret |= ((rev[i] * 1ll) << (i - st)); 
	}
	return ret;
}

Compilation message

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];
             ^
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 5708 KB Output is correct
2 Correct 7 ms 10520 KB Output is correct
3 Correct 7 ms 10632 KB Output is correct
4 Correct 7 ms 10632 KB Output is correct
5 Correct 6 ms 10632 KB Output is correct
6 Correct 7 ms 10632 KB Output is correct
7 Correct 7 ms 10704 KB Output is correct
8 Correct 9 ms 10776 KB Output is correct
9 Correct 7 ms 10800 KB Output is correct
10 Correct 7 ms 10824 KB Output is correct
11 Correct 11 ms 10868 KB Output is correct
12 Correct 7 ms 10912 KB Output is correct
13 Correct 8 ms 10912 KB Output is correct
14 Correct 8 ms 10912 KB Output is correct
15 Correct 8 ms 10912 KB Output is correct
16 Correct 8 ms 10912 KB Output is correct
17 Correct 9 ms 10912 KB Output is correct
18 Correct 7 ms 10912 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 34 ms 12276 KB Output is correct
2 Correct 34 ms 13752 KB Output is correct
3 Correct 34 ms 13864 KB Output is correct
4 Correct 24 ms 13864 KB Output is correct
5 Correct 30 ms 13864 KB Output is correct
6 Correct 24 ms 13864 KB Output is correct
7 Correct 23 ms 13864 KB Output is correct
8 Correct 22 ms 13864 KB Output is correct
9 Correct 23 ms 13864 KB Output is correct
10 Correct 20 ms 13864 KB Output is correct
11 Correct 21 ms 13864 KB Output is correct
12 Correct 24 ms 13864 KB Output is correct
13 Correct 21 ms 13864 KB Output is correct
14 Correct 21 ms 13864 KB Output is correct
15 Correct 22 ms 13864 KB Output is correct
16 Correct 24 ms 13864 KB Output is correct
17 Correct 21 ms 13864 KB Output is correct
18 Correct 23 ms 13864 KB Output is correct
19 Correct 23 ms 13864 KB Output is correct
20 Correct 19 ms 13864 KB Output is correct
21 Correct 18 ms 13864 KB Output is correct
22 Correct 25 ms 13864 KB Output is correct
23 Correct 24 ms 13864 KB Output is correct
24 Correct 26 ms 13864 KB Output is correct
25 Correct 21 ms 13864 KB Output is correct
26 Correct 22 ms 13864 KB Output is correct
27 Correct 24 ms 13864 KB Output is correct
28 Correct 24 ms 13864 KB Output is correct
29 Correct 21 ms 13864 KB Output is correct
30 Correct 23 ms 13864 KB Output is correct
31 Correct 7 ms 13864 KB Output is correct
32 Correct 8 ms 13864 KB Output is correct
33 Correct 7 ms 13864 KB Output is correct
34 Correct 6 ms 13864 KB Output is correct
35 Correct 6 ms 13864 KB Output is correct
36 Correct 6 ms 13864 KB Output is correct
37 Correct 6 ms 13864 KB Output is correct
38 Correct 6 ms 13864 KB Output is correct
39 Correct 6 ms 13864 KB Output is correct
40 Correct 8 ms 13864 KB Output is correct
41 Correct 8 ms 13864 KB Output is correct
42 Correct 6 ms 13864 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 13864 KB Output is correct
2 Correct 7 ms 13864 KB Output is correct
3 Correct 6 ms 13864 KB Output is correct
4 Correct 8 ms 13864 KB Output is correct
5 Correct 8 ms 13864 KB Output is correct
6 Correct 8 ms 13864 KB Output is correct
7 Correct 8 ms 13864 KB Output is correct
8 Correct 8 ms 13864 KB Output is correct
9 Correct 16 ms 13864 KB Output is correct
10 Correct 19 ms 13864 KB Output is correct
11 Correct 16 ms 13864 KB Output is correct
12 Correct 7 ms 13864 KB Output is correct
13 Correct 6 ms 13864 KB Output is correct
14 Correct 7 ms 13864 KB Output is correct
15 Correct 7 ms 13864 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 33 ms 13864 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 32 ms 13864 KB Output isn't correct
2 Halted 0 ms 0 KB -