Submission #41743

# Submission time Handle Problem Language Result Execution time Memory
41743 2018-02-21T06:54:10 Z fest Amusement Park (JOI17_amusement_park) C++14
28 / 100
37 ms 18796 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 <= 2) {
		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];
             ^
# Verdict Execution time Memory Grader output
1 Correct 6 ms 5340 KB Output is correct
2 Correct 7 ms 10216 KB Output is correct
3 Correct 7 ms 10472 KB Output is correct
4 Correct 7 ms 10700 KB Output is correct
5 Correct 7 ms 10812 KB Output is correct
6 Correct 8 ms 10920 KB Output is correct
7 Correct 7 ms 10920 KB Output is correct
8 Correct 8 ms 11068 KB Output is correct
9 Correct 7 ms 11216 KB Output is correct
10 Correct 7 ms 11216 KB Output is correct
11 Correct 10 ms 11224 KB Output is correct
12 Correct 7 ms 11232 KB Output is correct
13 Correct 7 ms 11232 KB Output is correct
14 Correct 7 ms 11232 KB Output is correct
15 Correct 7 ms 11232 KB Output is correct
16 Correct 7 ms 11232 KB Output is correct
17 Correct 7 ms 11232 KB Output is correct
18 Correct 7 ms 11232 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 37 ms 12648 KB Output is correct
2 Correct 32 ms 14124 KB Output is correct
3 Correct 33 ms 14412 KB Output is correct
4 Correct 22 ms 14640 KB Output is correct
5 Correct 23 ms 14640 KB Output is correct
6 Correct 21 ms 14640 KB Output is correct
7 Correct 21 ms 14640 KB Output is correct
8 Correct 21 ms 14640 KB Output is correct
9 Correct 22 ms 14640 KB Output is correct
10 Correct 22 ms 14640 KB Output is correct
11 Correct 20 ms 14640 KB Output is correct
12 Correct 22 ms 14640 KB Output is correct
13 Correct 22 ms 14732 KB Output is correct
14 Correct 20 ms 14832 KB Output is correct
15 Correct 21 ms 15072 KB Output is correct
16 Correct 22 ms 15400 KB Output is correct
17 Correct 21 ms 15592 KB Output is correct
18 Correct 21 ms 15800 KB Output is correct
19 Correct 26 ms 15948 KB Output is correct
20 Correct 17 ms 16252 KB Output is correct
21 Correct 17 ms 16616 KB Output is correct
22 Correct 21 ms 16812 KB Output is correct
23 Correct 22 ms 17004 KB Output is correct
24 Correct 22 ms 17192 KB Output is correct
25 Correct 24 ms 17384 KB Output is correct
26 Correct 21 ms 17576 KB Output is correct
27 Correct 34 ms 17768 KB Output is correct
28 Correct 22 ms 17960 KB Output is correct
29 Correct 20 ms 18056 KB Output is correct
30 Correct 24 ms 18228 KB Output is correct
31 Correct 7 ms 18400 KB Output is correct
32 Correct 7 ms 18400 KB Output is correct
33 Correct 8 ms 18400 KB Output is correct
34 Correct 9 ms 18400 KB Output is correct
35 Correct 6 ms 18400 KB Output is correct
36 Correct 7 ms 18400 KB Output is correct
37 Correct 6 ms 18400 KB Output is correct
38 Correct 6 ms 18400 KB Output is correct
39 Correct 6 ms 18400 KB Output is correct
40 Correct 6 ms 18400 KB Output is correct
41 Correct 8 ms 18400 KB Output is correct
42 Correct 6 ms 18400 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 18400 KB Output is correct
2 Correct 6 ms 18400 KB Output is correct
3 Correct 7 ms 18400 KB Output is correct
4 Correct 8 ms 18400 KB Output is correct
5 Correct 8 ms 18400 KB Output is correct
6 Correct 8 ms 18400 KB Output is correct
7 Correct 8 ms 18400 KB Output is correct
8 Correct 8 ms 18400 KB Output is correct
9 Correct 15 ms 18400 KB Output is correct
10 Correct 20 ms 18400 KB Output is correct
11 Correct 16 ms 18400 KB Output is correct
12 Correct 6 ms 18400 KB Output is correct
13 Correct 6 ms 18400 KB Output is correct
14 Correct 6 ms 18400 KB Output is correct
15 Correct 7 ms 18400 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 30 ms 18592 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 28 ms 18796 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -