Submission #468779

# Submission time Handle Problem Language Result Execution time Memory
468779 2021-08-29T15:22:37 Z Omegaman Broken Device (JOI17_broken_device) C++14
0 / 100
56 ms 2356 KB
#include "Annalib.h"
#include <math.h>

bool isInArr(int ArrLen, int Arr[], int val) {
	for ( int i = 0; i < ArrLen; i++ )
		if (Arr[i] == val)
			return true;
	return false;
}

void Anna(int N, long long X, int K, int P[]){
	const int xl = int(log2(X) + 0.5);

	bool xa[N];
	long long x = X;
	for( int i = 0; i < N; i++ ){
		xa[i] = x % 2;
		x /= 2;
	}

	bool F[N];

	for ( int i = 0; i < N; i++ ) {
		F[i] = !isInArr(K, P, i);
	}
	
	bool M[N];

	int j = 0;
	for( int i = 0; i < N; i++){
		if (j < (xl/3+0.5)*3 &&
			F[i] &&
			(F[i + 1] == xa[j + 0] || F[i + 1]) &&
			(F[i + 2] == xa[j + 1] || F[i + 2])) {

			M[i + 0] =         1;
			M[i + 1] = xa[j + 0];
			M[i + 2] = xa[j + 1];
          
			j += 2;
			i += 2;
		} else {
			M[i] = 0;
		}
	}

	for ( int i = 0; i < N; i++ ) {
		Set(i, (int)M[i]);
	}
}
#include "Brunolib.h"

long long Bruno( int N, int A[] ){
	long long X = 0;
	long long inc = 1;

	int len = 0;

	for( int i = 0; i < N; i++){
		if (A[i]) {
			len += 2;
			i += 2;
		}
	}

	bool M[len];

	int j = 0;
	for( int i = 0; i < N && j < len; i++){
		if (A[i]) {
			M[j + 0] = A[i + 1];
			M[j + 1] = A[i + 2];
			i += 2;
			j += 2;
		}
	}

	for (int i = 0; i < len; i++) {
		X += inc * M[i];
		inc *= 2;
	}

	return X;
}
# Verdict Execution time Memory Grader output
1 Partially correct 41 ms 2272 KB Output isn't correct - L* = 0
2 Partially correct 41 ms 2172 KB Output is partially correct - L* = 14
3 Partially correct 43 ms 2292 KB Output isn't correct - L* = 0
4 Partially correct 41 ms 2240 KB Output isn't correct - L* = 0
5 Partially correct 43 ms 2232 KB Output isn't correct - L* = 0
6 Partially correct 41 ms 2260 KB Output is partially correct - L* = 18
7 Partially correct 44 ms 2320 KB Output isn't correct - L* = 0
8 Partially correct 44 ms 2220 KB Output isn't correct - L* = 0
9 Partially correct 45 ms 2272 KB Output isn't correct - L* = 0
10 Partially correct 49 ms 2196 KB Output isn't correct - L* = 0
11 Partially correct 56 ms 2224 KB Output isn't correct - L* = 0
12 Partially correct 41 ms 2324 KB Output isn't correct - L* = 0
13 Partially correct 41 ms 2228 KB Output is partially correct - L* = 18
14 Partially correct 41 ms 2268 KB Output isn't correct - L* = 0
15 Partially correct 41 ms 2356 KB Output isn't correct - L* = 0
16 Partially correct 50 ms 2276 KB Output isn't correct - L* = 0
17 Partially correct 41 ms 2152 KB Output isn't correct - L* = 0
18 Partially correct 44 ms 2240 KB Output isn't correct - L* = 0
19 Partially correct 43 ms 2144 KB Output isn't correct - L* = 0
20 Partially correct 41 ms 2192 KB Output isn't correct - L* = 0
21 Partially correct 41 ms 2272 KB Output isn't correct - L* = 0
22 Partially correct 41 ms 2304 KB Output is partially correct - L* = 15
23 Partially correct 46 ms 2328 KB Output isn't correct - L* = 0
24 Partially correct 41 ms 2200 KB Output isn't correct - L* = 0
25 Partially correct 49 ms 2296 KB Output isn't correct - L* = 0
26 Partially correct 44 ms 2152 KB Output isn't correct - L* = 0
27 Partially correct 43 ms 2156 KB Output isn't correct - L* = 0
28 Partially correct 51 ms 2144 KB Output isn't correct - L* = 0
29 Partially correct 44 ms 2192 KB Output isn't correct - L* = 0
30 Partially correct 41 ms 2256 KB Output is partially correct - L* = 15
31 Partially correct 41 ms 2212 KB Output isn't correct - L* = 0
32 Partially correct 43 ms 2272 KB Output is partially correct - L* = 14
33 Partially correct 41 ms 2148 KB Output is partially correct - L* = 16
34 Partially correct 45 ms 2192 KB Output isn't correct - L* = 0
35 Partially correct 48 ms 2236 KB Output is partially correct - L* = 23
36 Partially correct 41 ms 2264 KB Output is partially correct - L* = 15
37 Partially correct 44 ms 2268 KB Output isn't correct - L* = 0
38 Partially correct 41 ms 2272 KB Output isn't correct - L* = 0
39 Partially correct 44 ms 2336 KB Output isn't correct - L* = 0
40 Partially correct 41 ms 2192 KB Output isn't correct - L* = 0