Submission #123047

# Submission time Handle Problem Language Result Execution time Memory
123047 2019-06-30T06:00:46 Z tjd229 Broken Device (JOI17_broken_device) C++14
0 / 100
36 ms 3568 KB
#include "Annalib.h"
void Anna(int N, long long X, int K, int P[]) {
	int mem[150];
	for (int i = 0; i < N; ++i) mem[i] = -1;
	for (int i = 0; i < K; ++i) mem[P[i]] = 0;
	for (int pos = 0; X && pos + 1 < N; ++pos) {
		if (mem[pos] == 0 && mem[pos + 1] == 0) continue;
		else if (mem[pos] == 0 && mem[pos + 1]==-1) {//01

			if (X & 1) {
				mem[pos + 1] = 1;
				X >>= 1;
			}
		}
		else if (mem[pos] == -1 && mem[pos + 1] == -1) {//00->1X
			mem[pos] = 1;
			mem[++pos] = X & 1;
			X >>= 1;
		}
		else if (mem[pos] == 1 && mem[pos + 1] == -1) {//10->1X
			mem[pos] = 1;
			mem[++pos] = X & 1;
			X >>= 1;
		}
	}
	for (int i = 0; i < N; ++i) Set(i, mem[i] < 0 ? 0 : mem[i]);
	//for (int i = 0; i < 10; ++i) printf("%d ",mem[i]);
}
#include "Brunolib.h"

long long Bruno( int N, int A[] ){
	long long X = 0;
	int recon[60] = { 0 };
	int pos = 0;
	for (int i = 0; i + 1 < N; ++i) {
		int b2 = A[i] + A[i] + A[i + 1];
		if (b2&1) recon[pos++] = 1;
		else if (b2 & 2) recon[pos++] = 0;
		if (b2 & 2)++i;
	}
	while (pos--) {
		X <<= 1;
		X += recon[pos];
	}
	return X;
}
# Verdict Execution time Memory Grader output
1 Runtime error 24 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Runtime error 23 ms 3056 KB Execution killed with signal 11 (could be triggered by violating memory limits)
3 Runtime error 24 ms 3056 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Runtime error 24 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Runtime error 23 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Runtime error 23 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Runtime error 24 ms 3056 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Runtime error 24 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
9 Runtime error 23 ms 3056 KB Execution killed with signal 11 (could be triggered by violating memory limits)
10 Runtime error 23 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
11 Runtime error 24 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Runtime error 23 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
13 Runtime error 24 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
14 Runtime error 23 ms 3056 KB Execution killed with signal 11 (could be triggered by violating memory limits)
15 Runtime error 24 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
16 Runtime error 24 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
17 Runtime error 24 ms 3056 KB Execution killed with signal 11 (could be triggered by violating memory limits)
18 Runtime error 23 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
19 Runtime error 23 ms 3056 KB Execution killed with signal 11 (could be triggered by violating memory limits)
20 Runtime error 25 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
21 Runtime error 23 ms 3056 KB Execution killed with signal 11 (could be triggered by violating memory limits)
22 Runtime error 24 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
23 Runtime error 24 ms 3064 KB Execution killed with signal 11 (could be triggered by violating memory limits)
24 Runtime error 24 ms 3264 KB Execution killed with signal 11 (could be triggered by violating memory limits)
25 Runtime error 23 ms 3056 KB Execution killed with signal 11 (could be triggered by violating memory limits)
26 Runtime error 24 ms 3568 KB Execution killed with signal 11 (could be triggered by violating memory limits)
27 Runtime error 23 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
28 Runtime error 24 ms 3144 KB Execution killed with signal 11 (could be triggered by violating memory limits)
29 Runtime error 23 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
30 Runtime error 24 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
31 Runtime error 23 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
32 Runtime error 24 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
33 Runtime error 24 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
34 Runtime error 36 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
35 Runtime error 23 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
36 Runtime error 23 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
37 Runtime error 24 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
38 Runtime error 23 ms 3056 KB Execution killed with signal 11 (could be triggered by violating memory limits)
39 Runtime error 23 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
40 Runtime error 23 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)