답안 #562460

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
562460 2022-05-14T12:16:38 Z DanShaders Broken Device 2 (JOI22_device2) C++17
69 / 100
268 ms 9780 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 550;
}

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 550;
}

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 2 ms 644 KB Output is correct
2 Correct 239 ms 9564 KB Output is correct
3 Correct 229 ms 9292 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 644 KB Output is correct
2 Correct 239 ms 9564 KB Output is correct
3 Correct 229 ms 9292 KB Output is correct
4 Correct 233 ms 9232 KB Output is correct
5 Correct 236 ms 9284 KB Output is correct
6 Correct 248 ms 9380 KB Output is correct
7 Correct 268 ms 9372 KB Output is correct
8 Correct 233 ms 9488 KB Output is correct
9 Correct 237 ms 9408 KB Output is correct
10 Correct 227 ms 9360 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 644 KB Output is correct
2 Correct 239 ms 9564 KB Output is correct
3 Correct 229 ms 9292 KB Output is correct
4 Correct 233 ms 9232 KB Output is correct
5 Correct 236 ms 9284 KB Output is correct
6 Correct 248 ms 9380 KB Output is correct
7 Correct 268 ms 9372 KB Output is correct
8 Correct 233 ms 9488 KB Output is correct
9 Correct 237 ms 9408 KB Output is correct
10 Correct 227 ms 9360 KB Output is correct
11 Correct 241 ms 9472 KB Output is correct
12 Correct 245 ms 9480 KB Output is correct
13 Correct 235 ms 9368 KB Output is correct
14 Correct 231 ms 9412 KB Output is correct
15 Correct 254 ms 9240 KB Output is correct
16 Correct 229 ms 9400 KB Output is correct
17 Correct 227 ms 9780 KB Output is correct
18 Correct 245 ms 9360 KB Output is correct
19 Correct 238 ms 9348 KB Output is correct
20 Correct 242 ms 9332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 644 KB Output is correct
2 Correct 239 ms 9564 KB Output is correct
3 Correct 229 ms 9292 KB Output is correct
4 Correct 233 ms 9232 KB Output is correct
5 Correct 236 ms 9284 KB Output is correct
6 Correct 248 ms 9380 KB Output is correct
7 Correct 268 ms 9372 KB Output is correct
8 Correct 233 ms 9488 KB Output is correct
9 Correct 237 ms 9408 KB Output is correct
10 Correct 227 ms 9360 KB Output is correct
11 Correct 241 ms 9472 KB Output is correct
12 Correct 245 ms 9480 KB Output is correct
13 Correct 235 ms 9368 KB Output is correct
14 Correct 231 ms 9412 KB Output is correct
15 Correct 254 ms 9240 KB Output is correct
16 Correct 229 ms 9400 KB Output is correct
17 Correct 227 ms 9780 KB Output is correct
18 Correct 245 ms 9360 KB Output is correct
19 Correct 238 ms 9348 KB Output is correct
20 Correct 242 ms 9332 KB Output is correct
21 Correct 236 ms 9348 KB Output is correct
22 Correct 251 ms 9380 KB Output is correct
23 Correct 229 ms 9272 KB Output is correct
24 Correct 244 ms 9312 KB Output is correct
25 Correct 231 ms 9224 KB Output is correct
26 Correct 229 ms 9340 KB Output is correct
27 Correct 238 ms 9240 KB Output is correct
28 Correct 236 ms 9372 KB Output is correct
29 Correct 266 ms 9332 KB Output is correct
30 Correct 241 ms 9432 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 644 KB Output is correct
2 Correct 239 ms 9564 KB Output is correct
3 Correct 229 ms 9292 KB Output is correct
4 Correct 233 ms 9232 KB Output is correct
5 Correct 236 ms 9284 KB Output is correct
6 Correct 248 ms 9380 KB Output is correct
7 Correct 268 ms 9372 KB Output is correct
8 Correct 233 ms 9488 KB Output is correct
9 Correct 237 ms 9408 KB Output is correct
10 Correct 227 ms 9360 KB Output is correct
11 Correct 241 ms 9472 KB Output is correct
12 Correct 245 ms 9480 KB Output is correct
13 Correct 235 ms 9368 KB Output is correct
14 Correct 231 ms 9412 KB Output is correct
15 Correct 254 ms 9240 KB Output is correct
16 Correct 229 ms 9400 KB Output is correct
17 Correct 227 ms 9780 KB Output is correct
18 Correct 245 ms 9360 KB Output is correct
19 Correct 238 ms 9348 KB Output is correct
20 Correct 242 ms 9332 KB Output is correct
21 Correct 236 ms 9348 KB Output is correct
22 Correct 251 ms 9380 KB Output is correct
23 Correct 229 ms 9272 KB Output is correct
24 Correct 244 ms 9312 KB Output is correct
25 Correct 231 ms 9224 KB Output is correct
26 Correct 229 ms 9340 KB Output is correct
27 Correct 238 ms 9240 KB Output is correct
28 Correct 236 ms 9372 KB Output is correct
29 Correct 266 ms 9332 KB Output is correct
30 Correct 241 ms 9432 KB Output is correct
31 Correct 234 ms 9280 KB Output is correct
32 Correct 248 ms 9260 KB Output is correct
33 Correct 229 ms 9360 KB Output is correct
34 Correct 250 ms 9296 KB Output is correct
35 Correct 230 ms 9292 KB Output is correct
36 Correct 262 ms 9372 KB Output is correct
37 Correct 225 ms 9340 KB Output is correct
38 Correct 247 ms 9472 KB Output is correct
39 Correct 231 ms 9288 KB Output is correct
40 Correct 245 ms 9356 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 257 ms 9288 KB Output is partially correct
2 Partially correct 262 ms 9452 KB Output is partially correct
3 Partially correct 225 ms 9332 KB Output is partially correct
4 Partially correct 255 ms 9220 KB Output is partially correct
5 Partially correct 262 ms 9340 KB Output is partially correct
6 Partially correct 240 ms 9284 KB Output is partially correct
7 Partially correct 239 ms 9316 KB Output is partially correct
8 Partially correct 250 ms 9352 KB Output is partially correct
9 Partially correct 241 ms 9304 KB Output is partially correct
10 Partially correct 237 ms 9336 KB Output is partially correct
11 Partially correct 230 ms 9368 KB Output is partially correct
12 Partially correct 244 ms 9400 KB Output is partially correct
13 Partially correct 227 ms 9320 KB Output is partially correct
14 Partially correct 231 ms 9316 KB Output is partially correct
15 Partially correct 241 ms 9396 KB Output is partially correct
16 Partially correct 238 ms 9400 KB Output is partially correct
17 Partially correct 238 ms 9276 KB Output is partially correct
18 Partially correct 226 ms 9584 KB Output is partially correct
19 Partially correct 240 ms 9292 KB Output is partially correct
20 Partially correct 234 ms 9348 KB Output is partially correct