답안 #562463

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
562463 2022-05-14T12:18:11 Z DanShaders Broken Device 2 (JOI22_device2) C++17
54 / 100
247 ms 9480 KB
//bs:flags:grader.cpp
#include "Anna.h"
#include "Bruno.h"

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;

namespace x = __gnu_pbds;
template <typename T>
using ordered_set = x::tree<T, x::null_type, less<T>, x::rb_tree_tag, x::tree_order_statistics_node_update>;

template <typename T>
using normal_queue = priority_queue<T, vector<T>, greater<>>;

#define all(x) begin(x), end(x)
#define sz(x) ((int) (x).size())
#define x first
#define y second
using ll = long long;
using ld = long double;

const ll MAGIC = 960389134456460687;

int Declare() {
	return 540;
}

pair<vector<int>, vector<int>> Anna(ll n) {
	n ^= MAGIC;
	vector<int> x;
	for (int i = 0; i < Declare() / 2; ++i) {
		x.push_back(1);
		x.push_back(0);
	}
	vector<int> y;
	for (int i = 0; i < 60; ++i) {
		y.push_back(1);
		y.push_back(1);
		y.push_back(1);
		if (n >> i & 1) {
			y.push_back(1);
			y.push_back(1);
			y.push_back(0);
			y.push_back(0);
		}
		y.push_back(0);
		y.push_back(0);
		y.push_back(0);
	}
	while (sz(y) < Declare()) {
		y.push_back(1);
		y.push_back(0);
	}
	return {x, y};
}

ll Bruno(vector<int> a) {
	int balance = 0, mx = 0;
	ll ans = 0;
	int i = 0;

	for (int u : a) {
		balance += (u == 0 ? -1 : 1);
		if (balance < 2) {
			if (mx >= 5) {
				ans |= 1ll << i;
				++i;
			} else if (mx >= 3) {
				++i;
			}
			mx = 0;
		} else {
			mx = max(mx, balance);
		}
	}
	ans ^= MAGIC;
	return ans;
}
//bs:flags:grader.cpp
#include "Anna.h"
#include "Bruno.h"

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;

namespace x = __gnu_pbds;
template <typename T>
using ordered_set = x::tree<T, x::null_type, less<T>, x::rb_tree_tag, x::tree_order_statistics_node_update>;

template <typename T>
using normal_queue = priority_queue<T, vector<T>, greater<>>;

#define all(x) begin(x), end(x)
#define sz(x) ((int) (x).size())
#define x first
#define y second
using ll = long long;
using ld = long double;

const ll MAGIC = 960389134456460687;

int Declare() {
	return 540;
}

pair<vector<int>, vector<int>> Anna(ll n) {
	n ^= MAGIC;
	vector<int> x;
	for (int i = 0; i < Declare() / 2; ++i) {
		x.push_back(1);
		x.push_back(0);
	}
	vector<int> y;
	for (int i = 0; i < 60; ++i) {
		y.push_back(1);
		y.push_back(1);
		y.push_back(1);
		if (n >> i & 1) {
			y.push_back(1);
			y.push_back(1);
			y.push_back(0);
			y.push_back(0);
		}
		y.push_back(0);
		y.push_back(0);
		y.push_back(0);
	}
	while (sz(y) < Declare()) {
		y.push_back(1);
		y.push_back(0);
	}
	return {x, y};
}

ll Bruno(vector<int> a) {
	int balance = 0, mx = 0;
	ll ans = 0;
	int i = 0;

	for (int u : a) {
		balance += (u == 0 ? -1 : 1);
		if (balance < 2) {
			if (mx >= 5) {
				ans |= 1ll << i;
				++i;
			} else if (mx >= 3) {
				++i;
			}
			mx = 0;
		} else {
			mx = max(mx, balance);
		}
	}
	ans ^= MAGIC;
	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 648 KB Output is correct
2 Correct 219 ms 9176 KB Output is correct
3 Correct 212 ms 9124 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 648 KB Output is correct
2 Correct 219 ms 9176 KB Output is correct
3 Correct 212 ms 9124 KB Output is correct
4 Correct 216 ms 9240 KB Output is correct
5 Correct 221 ms 9400 KB Output is correct
6 Correct 220 ms 9244 KB Output is correct
7 Correct 217 ms 9392 KB Output is correct
8 Correct 221 ms 9196 KB Output is correct
9 Correct 221 ms 9112 KB Output is correct
10 Correct 217 ms 9336 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 648 KB Output is correct
2 Correct 219 ms 9176 KB Output is correct
3 Correct 212 ms 9124 KB Output is correct
4 Correct 216 ms 9240 KB Output is correct
5 Correct 221 ms 9400 KB Output is correct
6 Correct 220 ms 9244 KB Output is correct
7 Correct 217 ms 9392 KB Output is correct
8 Correct 221 ms 9196 KB Output is correct
9 Correct 221 ms 9112 KB Output is correct
10 Correct 217 ms 9336 KB Output is correct
11 Correct 230 ms 9128 KB Output is correct
12 Correct 220 ms 9212 KB Output is correct
13 Correct 219 ms 9084 KB Output is correct
14 Correct 223 ms 9184 KB Output is correct
15 Correct 247 ms 9196 KB Output is correct
16 Correct 230 ms 9212 KB Output is correct
17 Correct 239 ms 9152 KB Output is correct
18 Correct 243 ms 9236 KB Output is correct
19 Correct 247 ms 9264 KB Output is correct
20 Correct 232 ms 9256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 648 KB Output is correct
2 Correct 219 ms 9176 KB Output is correct
3 Correct 212 ms 9124 KB Output is correct
4 Correct 216 ms 9240 KB Output is correct
5 Correct 221 ms 9400 KB Output is correct
6 Correct 220 ms 9244 KB Output is correct
7 Correct 217 ms 9392 KB Output is correct
8 Correct 221 ms 9196 KB Output is correct
9 Correct 221 ms 9112 KB Output is correct
10 Correct 217 ms 9336 KB Output is correct
11 Correct 230 ms 9128 KB Output is correct
12 Correct 220 ms 9212 KB Output is correct
13 Correct 219 ms 9084 KB Output is correct
14 Correct 223 ms 9184 KB Output is correct
15 Correct 247 ms 9196 KB Output is correct
16 Correct 230 ms 9212 KB Output is correct
17 Correct 239 ms 9152 KB Output is correct
18 Correct 243 ms 9236 KB Output is correct
19 Correct 247 ms 9264 KB Output is correct
20 Correct 232 ms 9256 KB Output is correct
21 Correct 226 ms 9176 KB Output is correct
22 Correct 237 ms 9152 KB Output is correct
23 Correct 232 ms 9312 KB Output is correct
24 Correct 228 ms 9256 KB Output is correct
25 Correct 225 ms 9196 KB Output is correct
26 Correct 218 ms 9184 KB Output is correct
27 Correct 216 ms 9212 KB Output is correct
28 Correct 226 ms 9480 KB Output is correct
29 Correct 221 ms 9184 KB Output is correct
30 Correct 218 ms 9144 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 648 KB Output is correct
2 Correct 219 ms 9176 KB Output is correct
3 Correct 212 ms 9124 KB Output is correct
4 Correct 216 ms 9240 KB Output is correct
5 Correct 221 ms 9400 KB Output is correct
6 Correct 220 ms 9244 KB Output is correct
7 Correct 217 ms 9392 KB Output is correct
8 Correct 221 ms 9196 KB Output is correct
9 Correct 221 ms 9112 KB Output is correct
10 Correct 217 ms 9336 KB Output is correct
11 Correct 230 ms 9128 KB Output is correct
12 Correct 220 ms 9212 KB Output is correct
13 Correct 219 ms 9084 KB Output is correct
14 Correct 223 ms 9184 KB Output is correct
15 Correct 247 ms 9196 KB Output is correct
16 Correct 230 ms 9212 KB Output is correct
17 Correct 239 ms 9152 KB Output is correct
18 Correct 243 ms 9236 KB Output is correct
19 Correct 247 ms 9264 KB Output is correct
20 Correct 232 ms 9256 KB Output is correct
21 Correct 226 ms 9176 KB Output is correct
22 Correct 237 ms 9152 KB Output is correct
23 Correct 232 ms 9312 KB Output is correct
24 Correct 228 ms 9256 KB Output is correct
25 Correct 225 ms 9196 KB Output is correct
26 Correct 218 ms 9184 KB Output is correct
27 Correct 216 ms 9212 KB Output is correct
28 Correct 226 ms 9480 KB Output is correct
29 Correct 221 ms 9184 KB Output is correct
30 Correct 218 ms 9144 KB Output is correct
31 Correct 221 ms 9128 KB Output is correct
32 Correct 226 ms 9200 KB Output is correct
33 Correct 218 ms 9268 KB Output is correct
34 Incorrect 10 ms 1672 KB Wrong Answer [4]
35 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Partially correct 223 ms 9160 KB Output is partially correct
2 Partially correct 222 ms 9404 KB Output is partially correct
3 Partially correct 224 ms 9216 KB Output is partially correct
4 Partially correct 220 ms 9368 KB Output is partially correct
5 Partially correct 229 ms 9256 KB Output is partially correct
6 Partially correct 219 ms 9340 KB Output is partially correct
7 Partially correct 219 ms 9240 KB Output is partially correct
8 Partially correct 216 ms 9252 KB Output is partially correct
9 Partially correct 226 ms 9200 KB Output is partially correct
10 Partially correct 219 ms 9440 KB Output is partially correct
11 Partially correct 217 ms 9220 KB Output is partially correct
12 Partially correct 234 ms 9152 KB Output is partially correct
13 Partially correct 224 ms 9136 KB Output is partially correct
14 Partially correct 213 ms 9248 KB Output is partially correct
15 Partially correct 221 ms 9268 KB Output is partially correct
16 Partially correct 222 ms 9208 KB Output is partially correct
17 Partially correct 216 ms 9192 KB Output is partially correct
18 Partially correct 220 ms 9204 KB Output is partially correct
19 Partially correct 224 ms 9308 KB Output is partially correct
20 Partially correct 219 ms 9156 KB Output is partially correct