Submission #24869

# Submission time Handle Problem Language Result Execution time Memory
24869 2017-06-16T12:32:11 Z khsoo01 Broken Device (JOI17_broken_device) C++11
0 / 100
78 ms 2836 KB
#include "Annalib.h"
typedef long long ll;
int br[155], cur;

int idx[9] = {7, 5, 4, 3, 6, 2, 1, 0};
int val[9] = {1, 3, 2, 0, 0, 1, 0, 0};
int mod[9] = {4, 4, 4, 4, 2, 2, 2, 1};

void Write (int X) {
	for(int i=2;i>=0;i--) {
		Set(cur+i, X%2);
		X /= 2;
	}
	cur += 3;
}

void Anna( int N, long long X, int K, int P[] ) {
	for(int i=0;i<N;i++) br[i] = 0;
	for(int i=0;i<K;i++) br[P[i]] = 1;
	cur = 0;
	for(int i=0;i<N;i+=3) {
		int tmp = 4*br[i] + 2*br[i+1] + br[i+2];
		for(int j=0;j<8;j++) {
			if((tmp&idx[j])==idx[j] && X%mod[j]==val[j]) {
				Write(idx[j]);
				X /= mod[j];
				break;
			}
		}
	}
}
#include "Brunolib.h"

int idx[9] = {7, 5, 4, 3, 6, 2, 1, 0};
int val[9] = {1, 3, 2, 0, 0, 1, 0, 0};
int mod[9] = {4, 4, 4, 4, 2, 2, 2, 1};

long long Bruno( int N, int A[] ){
	long long ans = 0;
	for(int i=N-3;i>=0;i-=3) {
		int cur = 4*A[i]+2*A[i+1]+A[i+2];
		for(int j=0;j<8;j++) {
			if(cur == idx[j]) {
				ans *= mod[j];
				ans += val[j];
			}
		}
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 41 ms 2836 KB Output isn't correct - L* = 0
2 Incorrect 55 ms 2836 KB Output isn't correct - L* = 0
3 Incorrect 45 ms 2836 KB Output isn't correct - L* = 0
4 Incorrect 38 ms 2836 KB Output isn't correct - L* = 0
5 Incorrect 45 ms 2836 KB Output isn't correct - L* = 0
6 Incorrect 45 ms 2836 KB Output isn't correct - L* = 0
7 Incorrect 41 ms 2836 KB Output isn't correct - L* = 0
8 Incorrect 52 ms 2836 KB Output isn't correct - L* = 0
9 Incorrect 59 ms 2836 KB Output isn't correct - L* = 0
10 Incorrect 62 ms 2836 KB Output isn't correct - L* = 0
11 Incorrect 56 ms 2836 KB Output isn't correct - L* = 0
12 Incorrect 38 ms 2836 KB Output isn't correct - L* = 0
13 Incorrect 78 ms 2836 KB Output isn't correct - L* = 0
14 Incorrect 54 ms 2836 KB Output isn't correct - L* = 0
15 Incorrect 52 ms 2836 KB Output isn't correct - L* = 0
16 Incorrect 52 ms 2836 KB Output isn't correct - L* = 0
17 Incorrect 65 ms 2836 KB Output isn't correct - L* = 0
18 Incorrect 68 ms 2836 KB Output isn't correct - L* = 0
19 Incorrect 62 ms 2836 KB Output isn't correct - L* = 0
20 Incorrect 39 ms 2836 KB Output isn't correct - L* = 0
21 Incorrect 52 ms 2836 KB Output isn't correct - L* = 0
22 Incorrect 49 ms 2836 KB Output isn't correct - L* = 0
23 Incorrect 54 ms 2836 KB Output isn't correct - L* = 0
24 Incorrect 32 ms 2836 KB Output isn't correct - L* = 0
25 Incorrect 56 ms 2836 KB Output isn't correct - L* = 0
26 Incorrect 35 ms 2836 KB Output isn't correct - L* = 0
27 Incorrect 45 ms 2836 KB Output isn't correct - L* = 0
28 Incorrect 62 ms 2836 KB Output isn't correct - L* = 0
29 Incorrect 41 ms 2836 KB Output isn't correct - L* = 0
30 Incorrect 41 ms 2836 KB Output isn't correct - L* = 0
31 Incorrect 46 ms 2836 KB Output isn't correct - L* = 0
32 Incorrect 59 ms 2836 KB Output isn't correct - L* = 0
33 Incorrect 52 ms 2836 KB Output isn't correct - L* = 0
34 Incorrect 41 ms 2836 KB Output isn't correct - L* = 0
35 Incorrect 48 ms 2836 KB Output isn't correct - L* = 0
36 Incorrect 62 ms 2836 KB Output isn't correct - L* = 0
37 Incorrect 49 ms 2836 KB Output isn't correct - L* = 0
38 Incorrect 41 ms 2836 KB Output isn't correct - L* = 0
39 Incorrect 52 ms 2836 KB Output isn't correct - L* = 0
40 Incorrect 52 ms 2836 KB Output isn't correct - L* = 0