Submission #69069

# Submission time Handle Problem Language Result Execution time Memory
69069 2018-08-19T18:46:23 Z IvanC Broken Device (JOI17_broken_device) C++17
41 / 100
73 ms 3808 KB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;

const int MAXN = 150;

static int possivel[MAXN],resposta[MAXN];

void Anna( int N, long long X, int K, int P[] ){

	memset(possivel,1,sizeof(possivel));
	memset(resposta,0,sizeof(resposta));
	possivel[N] = 0;

	for(int i = 0;i<K;i++) possivel[P[i]] = 0;

	vector<int> digitos;
	while(X != 0){
		digitos.push_back(X % 2);
		X /= 2;
	}
	reverse(digitos.begin(),digitos.end());

	for(int i =0;i+1<N && !digitos.empty();i++){
		if(!possivel[i]){
			continue;
		}
		if(digitos.back() == 0){
			resposta[i] = 1;
			resposta[i+1] = 0;
			possivel[i+1] = 0;
			digitos.pop_back();
		}
		else{
			if(possivel[i+1]){
				resposta[i] = 1;
				resposta[i+1] = 1;
				possivel[i+1] = 0;
				digitos.pop_back();
			}
			else{
				continue;
			}
		}
	}

	for(int i = 0;i<N;i++){
		Set( i, resposta[i] );
	}

}
#include "Brunolib.h"

long long Bruno( int N, int A[] ){

	long long ans = 0;
	int last = 0;
	
	for(int i = 0;i+1<N;i++){
		if(A[i] == 0) continue;
		if(A[i+1] == 0){
			last++;
		}
		else{
			ans += (1LL << last);
			last++;
			A[i+1] = 0;
		}
	}

	return ans;

}
# Verdict Execution time Memory Grader output
1 Partially correct 47 ms 3056 KB Output is partially correct - L* = 17
2 Partially correct 45 ms 3440 KB Output is partially correct - L* = 16
3 Partially correct 41 ms 3504 KB Output is partially correct - L* = 18
4 Partially correct 57 ms 3520 KB Output is partially correct - L* = 17
5 Partially correct 51 ms 3520 KB Output is partially correct - L* = 17
6 Partially correct 52 ms 3688 KB Output is partially correct - L* = 17
7 Partially correct 66 ms 3696 KB Output is partially correct - L* = 18
8 Partially correct 55 ms 3696 KB Output is partially correct - L* = 18
9 Partially correct 47 ms 3736 KB Output is partially correct - L* = 18
10 Partially correct 50 ms 3736 KB Output is partially correct - L* = 16
11 Partially correct 44 ms 3736 KB Output is partially correct - L* = 17
12 Partially correct 52 ms 3736 KB Output is partially correct - L* = 20
13 Partially correct 49 ms 3736 KB Output is partially correct - L* = 18
14 Partially correct 44 ms 3736 KB Output is partially correct - L* = 18
15 Partially correct 43 ms 3736 KB Output is partially correct - L* = 16
16 Partially correct 45 ms 3736 KB Output is partially correct - L* = 17
17 Partially correct 51 ms 3736 KB Output is partially correct - L* = 17
18 Partially correct 41 ms 3736 KB Output is partially correct - L* = 16
19 Partially correct 44 ms 3736 KB Output is partially correct - L* = 18
20 Partially correct 51 ms 3736 KB Output is partially correct - L* = 15
21 Partially correct 47 ms 3736 KB Output is partially correct - L* = 17
22 Partially correct 46 ms 3736 KB Output is partially correct - L* = 16
23 Partially correct 53 ms 3736 KB Output is partially correct - L* = 15
24 Partially correct 70 ms 3736 KB Output is partially correct - L* = 17
25 Partially correct 60 ms 3736 KB Output is partially correct - L* = 21
26 Partially correct 73 ms 3736 KB Output is partially correct - L* = 16
27 Partially correct 49 ms 3736 KB Output is partially correct - L* = 18
28 Partially correct 54 ms 3736 KB Output is partially correct - L* = 19
29 Partially correct 66 ms 3736 KB Output is partially correct - L* = 16
30 Partially correct 43 ms 3736 KB Output is partially correct - L* = 20
31 Partially correct 47 ms 3736 KB Output is partially correct - L* = 17
32 Partially correct 43 ms 3736 KB Output is partially correct - L* = 18
33 Partially correct 48 ms 3736 KB Output is partially correct - L* = 17
34 Partially correct 46 ms 3736 KB Output is partially correct - L* = 18
35 Partially correct 47 ms 3736 KB Output is partially correct - L* = 16
36 Partially correct 48 ms 3808 KB Output is partially correct - L* = 15
37 Partially correct 48 ms 3808 KB Output is partially correct - L* = 16
38 Partially correct 46 ms 3808 KB Output is partially correct - L* = 18
39 Partially correct 46 ms 3808 KB Output is partially correct - L* = 17
40 Partially correct 47 ms 3808 KB Output is partially correct - L* = 15