Submission #100871

# Submission time Handle Problem Language Result Execution time Memory
100871 2019-03-15T01:13:02 Z Pro_ktmr Broken Device (JOI17_broken_device) C++14
0 / 100
2000 ms 384 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;
	int cnt = 0;
	for(int i=0; i+1<N; i++){
		if(canUse[i] && canUse[i+1]){
			Set(i, 1);
			Set(i+1, (X>>now)%2);
			cnt += 2;
			i++;
			now++;
		}
		else if(canUse[i] && (X>>now)%2 == 0){
			Set(i, 1);
			Set(i+1, 0);
			cnt+= 2;
			i++;
			now++;
		}
		else{
			Set(i, 0);
			cnt += 1;
			if(i == N-2){
				Set(N-1, 0);
				cnt += 1;
			}
		}
	}
	while(cnt < N){
		
	}
}
#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 Execution timed out 2057 ms 384 KB Time limit exceeded
2 Execution timed out 2039 ms 384 KB Time limit exceeded
3 Execution timed out 2058 ms 384 KB Time limit exceeded
4 Execution timed out 2057 ms 384 KB Time limit exceeded
5 Execution timed out 2056 ms 384 KB Time limit exceeded
6 Execution timed out 2053 ms 384 KB Time limit exceeded
7 Execution timed out 2061 ms 384 KB Time limit exceeded
8 Execution timed out 2051 ms 256 KB Time limit exceeded
9 Execution timed out 2050 ms 384 KB Time limit exceeded
10 Execution timed out 2035 ms 384 KB Time limit exceeded
11 Execution timed out 2044 ms 384 KB Time limit exceeded
12 Execution timed out 2044 ms 384 KB Time limit exceeded
13 Execution timed out 2043 ms 384 KB Time limit exceeded
14 Execution timed out 2043 ms 256 KB Time limit exceeded
15 Execution timed out 2037 ms 384 KB Time limit exceeded
16 Execution timed out 2054 ms 256 KB Time limit exceeded
17 Execution timed out 2033 ms 256 KB Time limit exceeded
18 Execution timed out 2037 ms 256 KB Time limit exceeded
19 Execution timed out 2048 ms 256 KB Time limit exceeded
20 Execution timed out 2037 ms 256 KB Time limit exceeded
21 Execution timed out 2060 ms 256 KB Time limit exceeded
22 Execution timed out 2044 ms 256 KB Time limit exceeded
23 Execution timed out 2047 ms 256 KB Time limit exceeded
24 Execution timed out 2040 ms 256 KB Time limit exceeded
25 Execution timed out 2051 ms 256 KB Time limit exceeded
26 Execution timed out 2066 ms 384 KB Time limit exceeded
27 Execution timed out 2048 ms 384 KB Time limit exceeded
28 Execution timed out 2064 ms 256 KB Time limit exceeded
29 Execution timed out 2064 ms 384 KB Time limit exceeded
30 Execution timed out 2044 ms 256 KB Time limit exceeded
31 Execution timed out 2049 ms 256 KB Time limit exceeded
32 Execution timed out 2043 ms 256 KB Time limit exceeded
33 Execution timed out 2056 ms 384 KB Time limit exceeded
34 Execution timed out 2037 ms 256 KB Time limit exceeded
35 Execution timed out 2029 ms 256 KB Time limit exceeded
36 Execution timed out 2033 ms 384 KB Time limit exceeded
37 Execution timed out 2056 ms 256 KB Time limit exceeded
38 Execution timed out 2041 ms 256 KB Time limit exceeded
39 Execution timed out 2037 ms 256 KB Time limit exceeded
40 Execution timed out 2025 ms 384 KB Time limit exceeded