Submission #310985

# Submission time Handle Problem Language Result Execution time Memory
310985 2020-10-09T01:16:51 Z peuch Broken Device (JOI17_broken_device) C++17
0 / 100
2 ms 1032 KB
#include "Annalib.h"
#include<bits/stdc++.h>
using namespace std;

void Anna(int N, long long X, int K, int P[]){
	
	int marc[N + 10];
	memset(marc, 0, sizeof(marc));
	
	for(int i = 0; i < K; i++)
		marc[P[i]] = 1;

	int it1 = 60, it2 = N - 1;
	
	for(; it1 >= 0; it1--){
		while((marc[it2] || (marc[it2 - 1] && (1LL << ((long long)it1)))) && it2 > 1) {
			Set(it2, 0);
			it2--;
		}
		Set(it2, 1);
		it2--;	
		if((1LL << ((long long)it1)) & X) Set(it2, 1);
		else Set(it2, 0);
		it2--;
	}
	
	while(it2 >= 0){
		Set(it2, 0);
		it2--;
	}
	
	return;
}
#include "Brunolib.h"
#include<bits/stdc++.h>
using namespace std;

long long Bruno(int N, int A[]){
	
	int it1 = 60, it2 = N - 1;
	long long ret = 0;
	
	for(; it2 > 0; it2--){
		if(A[it2]){
			it2--;
			ret |= ((long long) A[it2]) << (long long)it1;
			it1--;
		}
		if(it1 < 0) break;
	}

	return ret;
}

Compilation message

Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:16:46: warning: '<<' in boolean context, did you mean '<' ? [-Wint-in-bool-context]
   16 |   while((marc[it2] || (marc[it2 - 1] && (1LL << ((long long)it1)))) && it2 > 1) {
      |                                         ~~~~~^~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 776 KB Wrong Answer [1]
2 Incorrect 1 ms 784 KB Wrong Answer [1]
3 Incorrect 0 ms 780 KB Wrong Answer [1]
4 Incorrect 0 ms 772 KB Wrong Answer [1]
5 Incorrect 1 ms 856 KB Wrong Answer [1]
6 Incorrect 0 ms 900 KB Wrong Answer [1]
7 Incorrect 1 ms 824 KB Wrong Answer [1]
8 Incorrect 0 ms 772 KB Wrong Answer [1]
9 Incorrect 2 ms 772 KB Wrong Answer [1]
10 Incorrect 1 ms 784 KB Wrong Answer [1]
11 Incorrect 0 ms 932 KB Wrong Answer [1]
12 Incorrect 1 ms 784 KB Wrong Answer [1]
13 Incorrect 0 ms 772 KB Wrong Answer [1]
14 Incorrect 1 ms 772 KB Wrong Answer [1]
15 Incorrect 0 ms 772 KB Wrong Answer [1]
16 Incorrect 0 ms 776 KB Wrong Answer [1]
17 Incorrect 0 ms 772 KB Wrong Answer [1]
18 Incorrect 0 ms 772 KB Wrong Answer [1]
19 Incorrect 1 ms 932 KB Wrong Answer [1]
20 Incorrect 2 ms 912 KB Wrong Answer [1]
21 Incorrect 1 ms 784 KB Wrong Answer [1]
22 Incorrect 1 ms 900 KB Wrong Answer [1]
23 Incorrect 2 ms 788 KB Wrong Answer [1]
24 Incorrect 2 ms 784 KB Wrong Answer [1]
25 Incorrect 0 ms 780 KB Wrong Answer [1]
26 Incorrect 1 ms 1032 KB Wrong Answer [1]
27 Incorrect 1 ms 784 KB Wrong Answer [1]
28 Incorrect 1 ms 772 KB Wrong Answer [1]
29 Incorrect 0 ms 788 KB Wrong Answer [1]
30 Incorrect 1 ms 780 KB Wrong Answer [1]
31 Incorrect 1 ms 772 KB Wrong Answer [1]
32 Incorrect 0 ms 788 KB Wrong Answer [1]
33 Incorrect 0 ms 644 KB Wrong Answer [1]
34 Incorrect 0 ms 772 KB Wrong Answer [1]
35 Incorrect 0 ms 784 KB Wrong Answer [1]
36 Incorrect 1 ms 908 KB Wrong Answer [1]
37 Incorrect 0 ms 644 KB Wrong Answer [1]
38 Incorrect 1 ms 788 KB Wrong Answer [1]
39 Incorrect 2 ms 1032 KB Wrong Answer [1]
40 Incorrect 2 ms 788 KB Wrong Answer [1]