Submission #125592

# Submission time Handle Problem Language Result Execution time Memory
125592 2019-07-06T03:36:03 Z tjd229 Broken Device (JOI17_broken_device) C++14
0 / 100
40 ms 3512 KB
#include "Annalib.h"

void Anna(int N, long long X, int K, int P[]) {
	int A[150];
	for (int i = 0; i < N; ++i) A[i] = 1;
	for (int i = 0; i < K; ++i) A[P[i]] = 0;
	
	for (int i = 0; i < N ; i += 3) {
		int s = A[i] + A[i + 1] + A[i + 2];
		if (!s) continue;
		if (X & 1) {
			if ((X & 2) && s == 3) X >>= 2;//111
			else if ((X & 2) == 0 && (A[i + 2] & A[i])) X >>= 2, A[i + 1] = 0;//101
			else if (A[i + 2]) A[i] = A[i + 1] = 0, X >>= 1;//001 or 110
			else if (A[i + 1] & A[i]) A[i + 2] = 0, X >>= 1;
			else A[i] = A[i + 1] = A[i + 2] = 0;
		}
		else{
			if ((X & 2) && A[i+1] + A[i + 2] == 2) {//011[01]
				A[i] = 0;
				X >>= 2;
			}
			else if ((X & 2) == 0 && A[i]) {//010[00]
				A[i] = A[i + 2] = 0;
				X >>= 2;
			}
			else if (A[i]) {//100
				A[i+1] = A[i + 2] = 0;
				X >>= 1;
			}
			else A[i] = A[i + 1] = A[i + 2] = 0;
		}
		

	}
	for (int i = 0; i < N; ++i) Set(i, A[i]);
}
#include "Brunolib.h"
long long Bruno(int N, int A[]) {
	long long X = 0;
	int recon[70] = { 0 };
	int pos = 0;
	for (int i = 0; i < N && pos<60; i += 3) {
		int mask = (A[i] << 2) + A[i + 1] + A[i + 1] + A[i + 2];
		if (mask == 1 || mask == 6) recon[pos++] = 1;
		else if (mask == 2) pos += 2;
		else if (mask == 3) recon[++pos] = 1, ++pos;
		else if (mask == 4) ++pos;
		else if (mask == 5) recon[pos++] = 1, ++pos;
		else if (mask == 7)
			recon[pos] = recon[pos + 1] = 1, pos += 2;
	}
	//printf("%d\n",pos);
	pos = 60;
	while (pos--) {
		X <<= 1;
		X += recon[pos];
	}
	return X;
}
# Verdict Execution time Memory Grader output
1 Incorrect 39 ms 3312 KB Output isn't correct - L* = 0
2 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
3 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
4 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
5 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
6 Incorrect 39 ms 3312 KB Output isn't correct - L* = 0
7 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
8 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
9 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
10 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
11 Incorrect 40 ms 3232 KB Output isn't correct - L* = 0
12 Incorrect 39 ms 3312 KB Output isn't correct - L* = 0
13 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
14 Incorrect 39 ms 3312 KB Output isn't correct - L* = 0
15 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
16 Incorrect 39 ms 3184 KB Output isn't correct - L* = 0
17 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
18 Incorrect 39 ms 3064 KB Output isn't correct - L* = 0
19 Incorrect 39 ms 3312 KB Output isn't correct - L* = 0
20 Incorrect 39 ms 3312 KB Output isn't correct - L* = 0
21 Incorrect 39 ms 3312 KB Output isn't correct - L* = 0
22 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
23 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
24 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
25 Incorrect 39 ms 3512 KB Output isn't correct - L* = 0
26 Incorrect 39 ms 3312 KB Output isn't correct - L* = 0
27 Incorrect 39 ms 3312 KB Output isn't correct - L* = 0
28 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
29 Incorrect 40 ms 3056 KB Output isn't correct - L* = 0
30 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
31 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
32 Incorrect 39 ms 3312 KB Output isn't correct - L* = 0
33 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
34 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
35 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
36 Incorrect 39 ms 3312 KB Output isn't correct - L* = 0
37 Incorrect 39 ms 3136 KB Output isn't correct - L* = 0
38 Incorrect 39 ms 3312 KB Output isn't correct - L* = 0
39 Incorrect 40 ms 3312 KB Output isn't correct - L* = 0
40 Incorrect 39 ms 3312 KB Output isn't correct - L* = 0