Submission #69068

# Submission time Handle Problem Language Result Execution time Memory
69068 2018-08-19T18:36:14 Z IvanC Broken Device (JOI17_broken_device) C++17
0 / 100
81 ms 12368 KB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;

const int MAXN = 150;
const int MAXL = 60;

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

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

	memset(possivel,1,sizeof(possivel));

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

	int last = 0,ptr = 0;
	while(last < MAXL && ptr + 1 < N){
		if(!possivel[ptr]){
			ptr++;
		}
		else{
			long long digito = (X & (1LL << last));
			if(digito){
				if(possivel[ptr+1]){
					resposta[ptr] = 1;
					resposta[ptr+1] = 1;
					last++;
					ptr += 2;
				}
				else{
					ptr++;
				}
			}
			else{
				resposta[ptr] = 1;
				resposta[ptr+1] = 0;
				last++;
				ptr += 2;
			}
		}
	}

	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;
	int i = 0;

	while(i < N){
		if(A[i] == 1){
			ans += (A[i+1])*(1LL << last);
			last++;
			i += 2;
		}
		else{
			i++;
		}
	}

	return ans;

}
# Verdict Execution time Memory Grader output
1 Incorrect 41 ms 3056 KB Output isn't correct - L* = 0
2 Incorrect 53 ms 3856 KB Output isn't correct - L* = 0
3 Incorrect 50 ms 4088 KB Output isn't correct - L* = 0
4 Incorrect 72 ms 4584 KB Output isn't correct - L* = 0
5 Incorrect 46 ms 4656 KB Output isn't correct - L* = 0
6 Incorrect 52 ms 4904 KB Output isn't correct - L* = 0
7 Incorrect 55 ms 5144 KB Output isn't correct - L* = 0
8 Incorrect 53 ms 5336 KB Output isn't correct - L* = 0
9 Incorrect 54 ms 5592 KB Output isn't correct - L* = 0
10 Incorrect 77 ms 5840 KB Output isn't correct - L* = 0
11 Incorrect 49 ms 5984 KB Output isn't correct - L* = 0
12 Incorrect 43 ms 6200 KB Output isn't correct - L* = 0
13 Incorrect 44 ms 6504 KB Output isn't correct - L* = 0
14 Incorrect 52 ms 6632 KB Output isn't correct - L* = 0
15 Incorrect 62 ms 7096 KB Output isn't correct - L* = 0
16 Incorrect 79 ms 7144 KB Output isn't correct - L* = 0
17 Incorrect 54 ms 7256 KB Output isn't correct - L* = 0
18 Incorrect 49 ms 7472 KB Output isn't correct - L* = 0
19 Incorrect 46 ms 7680 KB Output isn't correct - L* = 0
20 Incorrect 53 ms 7936 KB Output isn't correct - L* = 0
21 Incorrect 56 ms 8112 KB Output isn't correct - L* = 0
22 Incorrect 48 ms 8320 KB Output isn't correct - L* = 0
23 Incorrect 44 ms 8576 KB Output isn't correct - L* = 0
24 Incorrect 43 ms 8736 KB Output isn't correct - L* = 0
25 Incorrect 50 ms 8952 KB Output isn't correct - L* = 0
26 Incorrect 44 ms 9168 KB Output isn't correct - L* = 0
27 Incorrect 53 ms 9384 KB Output isn't correct - L* = 0
28 Incorrect 46 ms 9640 KB Output isn't correct - L* = 0
29 Incorrect 48 ms 10320 KB Output isn't correct - L* = 0
30 Incorrect 81 ms 10320 KB Output isn't correct - L* = 0
31 Incorrect 46 ms 10320 KB Output isn't correct - L* = 0
32 Incorrect 52 ms 10440 KB Output isn't correct - L* = 0
33 Incorrect 44 ms 10688 KB Output isn't correct - L* = 0
34 Incorrect 46 ms 11120 KB Output isn't correct - L* = 0
35 Incorrect 41 ms 11120 KB Output isn't correct - L* = 0
36 Incorrect 49 ms 11288 KB Output isn't correct - L* = 0
37 Incorrect 57 ms 11536 KB Output isn't correct - L* = 0
38 Incorrect 63 ms 11720 KB Output isn't correct - L* = 0
39 Incorrect 57 ms 11928 KB Output isn't correct - L* = 0
40 Incorrect 52 ms 12368 KB Output isn't correct - L* = 0