Submission #41742

# Submission time Handle Problem Language Result Execution time Memory
41742 2018-02-21T06:52:09 Z fest Amusement Park (JOI17_amusement_park) C++14
10 / 100
34 ms 13712 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) 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, 0);
		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 Incorrect 7 ms 5340 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 34 ms 11908 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 7 ms 13632 KB Output is correct
2 Correct 7 ms 13632 KB Output is correct
3 Correct 8 ms 13632 KB Output is correct
4 Correct 9 ms 13632 KB Output is correct
5 Correct 9 ms 13632 KB Output is correct
6 Correct 10 ms 13632 KB Output is correct
7 Correct 9 ms 13632 KB Output is correct
8 Correct 9 ms 13632 KB Output is correct
9 Correct 18 ms 13632 KB Output is correct
10 Correct 18 ms 13632 KB Output is correct
11 Correct 18 ms 13632 KB Output is correct
12 Correct 7 ms 13632 KB Output is correct
13 Correct 7 ms 13632 KB Output is correct
14 Correct 7 ms 13632 KB Output is correct
15 Correct 7 ms 13632 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 30 ms 13672 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 34 ms 13712 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -