Submission #100870

# Submission time Handle Problem Language Result Execution time Memory
100870 2019-03-15T01:09:48 Z Pro_ktmr Broken Device (JOI17_broken_device) C++14
0 / 100
6 ms 1004 KB
#include"bits/stdc++.h"
using namespace std;
#define LL long long
#define MP make_pair
#include"Annalib.h"

//void Set(int pos, int bit)
//N=150
void Anna(int N, long long X, int K, int P[]){
	bool canUse[150];
	for(int i=0; i<N; i++) canUse[i] = true;
	for(int i=0; i<K; i++) canUse[P[i]] = false;
	int now = 0;
	for(int i=0; i+1<N; i++){
		if(canUse[i] && canUse[i+1]){
			Set(i, 1);
			Set(i+1, (X>>now)%2);
			i++;
			now++;
		}
		else if(canUse[i] && (X>>now)%2 == 0){
			Set(i, 1);
			Set(i+1, (X>>now)%2);
			i++;
			now++;
		}
		else{
			Set(i, 0);
			if(i == N-2) Set(N-1, 0);
		}
	}
}
#include"bits/stdc++.h"
using namespace std;
#define LL long long
#define MP make_pair
#include"Brunolib.h"

long long Bruno(int N, int A[]){
	long long ans;
	int now = 0;
	for(int i=0; i+1<N; i++){
		if(A[i] == 1){
			ans += A[i+1]<<now;
			i++;
			now++;
		}
	}
	return ans;
}

Compilation message

Bruno.cpp: In function 'long long int Bruno(int, int*)':
Bruno.cpp:17:9: warning: 'ans' may be used uninitialized in this function [-Wmaybe-uninitialized]
  return ans;
         ^~~
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 780 KB Wrong Answer [4]
2 Incorrect 4 ms 868 KB Wrong Answer [4]
3 Incorrect 4 ms 780 KB Wrong Answer [4]
4 Incorrect 4 ms 644 KB Wrong Answer [4]
5 Incorrect 3 ms 644 KB Wrong Answer [4]
6 Incorrect 5 ms 644 KB Wrong Answer [4]
7 Incorrect 5 ms 780 KB Wrong Answer [4]
8 Incorrect 5 ms 872 KB Wrong Answer [4]
9 Incorrect 5 ms 872 KB Wrong Answer [4]
10 Incorrect 4 ms 868 KB Wrong Answer [4]
11 Incorrect 4 ms 876 KB Wrong Answer [4]
12 Incorrect 5 ms 780 KB Wrong Answer [4]
13 Incorrect 4 ms 772 KB Wrong Answer [4]
14 Incorrect 4 ms 780 KB Wrong Answer [4]
15 Incorrect 3 ms 644 KB Wrong Answer [4]
16 Incorrect 4 ms 936 KB Wrong Answer [4]
17 Incorrect 4 ms 872 KB Wrong Answer [4]
18 Incorrect 4 ms 772 KB Wrong Answer [4]
19 Incorrect 5 ms 972 KB Wrong Answer [4]
20 Incorrect 4 ms 700 KB Wrong Answer [4]
21 Incorrect 4 ms 780 KB Wrong Answer [4]
22 Incorrect 6 ms 644 KB Wrong Answer [4]
23 Incorrect 4 ms 896 KB Wrong Answer [4]
24 Incorrect 5 ms 772 KB Wrong Answer [4]
25 Incorrect 4 ms 644 KB Wrong Answer [4]
26 Incorrect 4 ms 772 KB Wrong Answer [4]
27 Incorrect 5 ms 644 KB Wrong Answer [4]
28 Incorrect 4 ms 1004 KB Wrong Answer [4]
29 Incorrect 4 ms 876 KB Wrong Answer [4]
30 Incorrect 4 ms 780 KB Wrong Answer [4]
31 Incorrect 4 ms 644 KB Wrong Answer [4]
32 Incorrect 3 ms 780 KB Wrong Answer [4]
33 Incorrect 4 ms 644 KB Wrong Answer [4]
34 Incorrect 4 ms 776 KB Wrong Answer [4]
35 Incorrect 4 ms 644 KB Wrong Answer [4]
36 Incorrect 4 ms 644 KB Wrong Answer [4]
37 Incorrect 5 ms 780 KB Wrong Answer [4]
38 Incorrect 5 ms 780 KB Wrong Answer [4]
39 Incorrect 4 ms 644 KB Wrong Answer [4]
40 Incorrect 5 ms 648 KB Wrong Answer [4]