답안 #101874

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
101874 2019-03-20T15:52:37 Z hugo_pm Broken Device (JOI17_broken_device) C++17
41 / 100
75 ms 3072 KB
#include "Annalib.h"

typedef long long llg;
const int borne = 155;
int lenSeq, nbCas;
bool bloque[borne];
int ret[borne];
long long nombre;


void solve()
{
	int i = 0;
	for (int b = 59; b >= 0; --b) {
		int c = 0;
		if (nombre & (1LL << (long long)(b))) c = 1;
		while (bloque[i] || (bloque[i+1] && c)) ++i;
		if (i+1 >= lenSeq) return;
		ret[i] = 1;
		ret[i+1] = c;
		i += 2;
	}
}

void Anna( int N, long long X, int K, int P[] ){
	lenSeq = N;
	nombre = X;

	for (int i = 0; i < N; ++i) { bloque[i] = false; ret[i] = 0; }
	for (int i = 0; i < K; ++i) bloque[P[i]] = true;
	solve();
	for (int i = 0; i < N; ++i) Set(i, ret[i]);
	return;
}
#include "Brunolib.h"

long long Bruno( int N, int A[] ){
	long long X = 0;
	int i = 0;
	for (int b = 59; b >= 0; --b) {
		while (A[i] == 0) ++i;
		++i;	
		if (A[i] == 1) X += 1LL << (long long)(b);
		++i;
	}
	return X;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 40 ms 2816 KB Output is partially correct - L* = 15
2 Partially correct 44 ms 2816 KB Output is partially correct - L* = 16
3 Partially correct 43 ms 3056 KB Output is partially correct - L* = 16
4 Partially correct 39 ms 3072 KB Output is partially correct - L* = 15
5 Partially correct 49 ms 2816 KB Output is partially correct - L* = 15
6 Partially correct 53 ms 2952 KB Output is partially correct - L* = 15
7 Partially correct 40 ms 3072 KB Output is partially correct - L* = 15
8 Partially correct 37 ms 3072 KB Output is partially correct - L* = 16
9 Partially correct 37 ms 2816 KB Output is partially correct - L* = 18
10 Partially correct 37 ms 2816 KB Output is partially correct - L* = 15
11 Partially correct 47 ms 2816 KB Output is partially correct - L* = 19
12 Partially correct 50 ms 3056 KB Output is partially correct - L* = 20
13 Partially correct 46 ms 3056 KB Output is partially correct - L* = 15
14 Partially correct 37 ms 2816 KB Output is partially correct - L* = 15
15 Partially correct 41 ms 2816 KB Output is partially correct - L* = 17
16 Partially correct 35 ms 2816 KB Output is partially correct - L* = 17
17 Partially correct 44 ms 3056 KB Output is partially correct - L* = 17
18 Partially correct 41 ms 3072 KB Output is partially correct - L* = 16
19 Partially correct 71 ms 2800 KB Output is partially correct - L* = 18
20 Partially correct 37 ms 2800 KB Output is partially correct - L* = 18
21 Partially correct 40 ms 2800 KB Output is partially correct - L* = 15
22 Partially correct 43 ms 2816 KB Output is partially correct - L* = 16
23 Partially correct 39 ms 2816 KB Output is partially correct - L* = 17
24 Partially correct 41 ms 2816 KB Output is partially correct - L* = 16
25 Partially correct 53 ms 3056 KB Output is partially correct - L* = 15
26 Partially correct 50 ms 2872 KB Output is partially correct - L* = 16
27 Partially correct 36 ms 2816 KB Output is partially correct - L* = 16
28 Partially correct 35 ms 3072 KB Output is partially correct - L* = 16
29 Partially correct 36 ms 3072 KB Output is partially correct - L* = 15
30 Partially correct 50 ms 3072 KB Output is partially correct - L* = 15
31 Partially correct 40 ms 3056 KB Output is partially correct - L* = 17
32 Partially correct 39 ms 3056 KB Output is partially correct - L* = 18
33 Partially correct 43 ms 3072 KB Output is partially correct - L* = 17
34 Partially correct 41 ms 2816 KB Output is partially correct - L* = 16
35 Partially correct 47 ms 3056 KB Output is partially correct - L* = 15
36 Partially correct 45 ms 3072 KB Output is partially correct - L* = 20
37 Partially correct 75 ms 2800 KB Output is partially correct - L* = 16
38 Partially correct 47 ms 3056 KB Output is partially correct - L* = 18
39 Partially correct 39 ms 2816 KB Output is partially correct - L* = 15
40 Partially correct 59 ms 2800 KB Output is partially correct - L* = 15