Submission #715722

# Submission time Handle Problem Language Result Execution time Memory
715722 2023-03-27T16:12:25 Z valerikk Broken Device (JOI17_broken_device) C++17
69 / 100
45 ms 2412 KB
#include "Annalib.h"
#include <bits/stdc++.h>

using namespace std;

void Anna( int N, long long X, int K, int P[] ){
	mt19937 rnd(239);
	vector<int> ord(N);
	iota(ord.begin(), ord.end(), 0);
	shuffle(ord.begin(), ord.end(), rnd);
	vector<int> bad(N, 0);
	for (int i = 0; i < K; ++i) {
		bad[P[i]] = 1;
	}
	vector<int> a(N, 0);
	for (int i = 0; i + 2 < N; i += 3) {
		if (!bad[ord[i]] && !bad[ord[i + 1]] && !bad[ord[i + 2]]) {
			int mask = X % 7 + 1;
			for (int j = 0; j < 3; ++j) {
				a[ord[i + j]] = (mask >> j) & 1;
			}
			X /= 7;
		}
	}
	for (int i = 0; i < N; ++i) {
		Set(i, a[i]);
	}
}
#include "Brunolib.h"
#include <bits/stdc++.h>

using namespace std;

long long Bruno( int N, int A[] ){
	mt19937 rnd(239);
	vector<int> ord(N);
	iota(ord.begin(), ord.end(), 0);
	shuffle(ord.begin(), ord.end(), rnd);
	long long X = 0;
	vector<int> digits;
	for (int i = 0; i + 2 < N; i += 3) {
		if (A[ord[i]] || A[ord[i + 1]] || A[ord[i + 2]]) {
			int mask = 0;
			for (int j = 2; j >= 0; --j) {
				mask = mask * 2 + A[ord[i + j]];
			}
			digits.push_back(mask - 1);
		}
	}
	reverse(digits.begin(), digits.end());
	for (int d : digits) {
		X = X * 7 + d;
	}
	return X;
}
# Verdict Execution time Memory Grader output
1 Partially correct 41 ms 2204 KB Output is partially correct - L* = 32
2 Partially correct 42 ms 2280 KB Output is partially correct - L* = 32
3 Partially correct 41 ms 2368 KB Output is partially correct - L* = 31
4 Partially correct 41 ms 2336 KB Output is partially correct - L* = 32
5 Partially correct 41 ms 2256 KB Output is partially correct - L* = 32
6 Partially correct 44 ms 2360 KB Output is partially correct - L* = 34
7 Partially correct 42 ms 2296 KB Output is partially correct - L* = 33
8 Partially correct 40 ms 2236 KB Output is partially correct - L* = 33
9 Partially correct 41 ms 2304 KB Output is partially correct - L* = 32
10 Partially correct 41 ms 2276 KB Output is partially correct - L* = 30
11 Partially correct 44 ms 2148 KB Output is partially correct - L* = 31
12 Partially correct 43 ms 2320 KB Output is partially correct - L* = 34
13 Partially correct 41 ms 2220 KB Output is partially correct - L* = 33
14 Partially correct 40 ms 2404 KB Output is partially correct - L* = 32
15 Partially correct 41 ms 2328 KB Output is partially correct - L* = 32
16 Partially correct 41 ms 2304 KB Output is partially correct - L* = 31
17 Partially correct 40 ms 2240 KB Output is partially correct - L* = 33
18 Partially correct 43 ms 2252 KB Output is partially correct - L* = 33
19 Partially correct 42 ms 2340 KB Output is partially correct - L* = 29
20 Partially correct 44 ms 2332 KB Output is partially correct - L* = 32
21 Partially correct 41 ms 2244 KB Output is partially correct - L* = 33
22 Partially correct 43 ms 2172 KB Output is partially correct - L* = 34
23 Partially correct 41 ms 2348 KB Output is partially correct - L* = 33
24 Partially correct 41 ms 2264 KB Output is partially correct - L* = 32
25 Partially correct 41 ms 2212 KB Output is partially correct - L* = 32
26 Partially correct 41 ms 2348 KB Output is partially correct - L* = 31
27 Partially correct 41 ms 2260 KB Output is partially correct - L* = 32
28 Partially correct 41 ms 2396 KB Output is partially correct - L* = 32
29 Partially correct 41 ms 2252 KB Output is partially correct - L* = 32
30 Partially correct 43 ms 2228 KB Output is partially correct - L* = 31
31 Partially correct 43 ms 2368 KB Output is partially correct - L* = 33
32 Partially correct 41 ms 2272 KB Output is partially correct - L* = 31
33 Partially correct 45 ms 2272 KB Output is partially correct - L* = 32
34 Partially correct 41 ms 2292 KB Output is partially correct - L* = 32
35 Partially correct 41 ms 2324 KB Output is partially correct - L* = 30
36 Partially correct 41 ms 2156 KB Output is partially correct - L* = 30
37 Partially correct 45 ms 2412 KB Output is partially correct - L* = 34
38 Partially correct 43 ms 2340 KB Output is partially correct - L* = 31
39 Partially correct 41 ms 2388 KB Output is partially correct - L* = 33
40 Partially correct 41 ms 2312 KB Output is partially correct - L* = 32