답안 #310989

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
310989 2020-10-09T01:27:23 Z peuch Broken Device (JOI17_broken_device) C++17
8 / 100
46 ms 3584 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];
	int on[N + 10];
	memset(marc, 0, sizeof(marc));
	memset(on, 0, sizeof(on));
	
	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]) && it2 > 1) {
			// Set(it2, 0);
			it2--;
			if(it2 < 0) break;
		}
		// Set(it2, 1);
		on[it2] = 1;
		it2--;	
		if(it2 < 0) break;
		if((1LL << ((long long)it1)) & X) on[it2] = 1; // Set(it2, 1);
		it2--;
		if(it2 < 0) break;
	}

	for(int i = 0; i < N; i++){
		Set(i, on[i]);
	}
	
	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;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 43 ms 3056 KB Output is partially correct - L* = 15
2 Partially correct 45 ms 3312 KB Output is partially correct - L* = 15
3 Partially correct 46 ms 3072 KB Output is partially correct - L* = 14
4 Partially correct 44 ms 3056 KB Output is partially correct - L* = 14
5 Partially correct 45 ms 3072 KB Output is partially correct - L* = 15
6 Partially correct 43 ms 3056 KB Output is partially correct - L* = 15
7 Partially correct 46 ms 3056 KB Output is partially correct - L* = 14
8 Partially correct 45 ms 3072 KB Output is partially correct - L* = 14
9 Partially correct 44 ms 3056 KB Output is partially correct - L* = 16
10 Partially correct 44 ms 3056 KB Output is partially correct - L* = 14
11 Partially correct 44 ms 3072 KB Output is partially correct - L* = 16
12 Partially correct 44 ms 3056 KB Output is partially correct - L* = 14
13 Partially correct 44 ms 3072 KB Output is partially correct - L* = 15
14 Partially correct 44 ms 3072 KB Output is partially correct - L* = 14
15 Partially correct 45 ms 2928 KB Output is partially correct - L* = 15
16 Partially correct 44 ms 3072 KB Output is partially correct - L* = 15
17 Partially correct 44 ms 3056 KB Output is partially correct - L* = 14
18 Partially correct 43 ms 3072 KB Output is partially correct - L* = 16
19 Partially correct 45 ms 3584 KB Output is partially correct - L* = 18
20 Partially correct 44 ms 3064 KB Output is partially correct - L* = 14
21 Partially correct 43 ms 3072 KB Output is partially correct - L* = 15
22 Partially correct 44 ms 3056 KB Output is partially correct - L* = 15
23 Partially correct 43 ms 3072 KB Output is partially correct - L* = 15
24 Partially correct 44 ms 3072 KB Output is partially correct - L* = 16
25 Partially correct 44 ms 3072 KB Output is partially correct - L* = 14
26 Partially correct 44 ms 3056 KB Output is partially correct - L* = 16
27 Partially correct 45 ms 3056 KB Output is partially correct - L* = 14
28 Partially correct 44 ms 3328 KB Output is partially correct - L* = 15
29 Partially correct 45 ms 3072 KB Output is partially correct - L* = 15
30 Partially correct 44 ms 3072 KB Output is partially correct - L* = 14
31 Partially correct 44 ms 3136 KB Output is partially correct - L* = 14
32 Partially correct 43 ms 3056 KB Output is partially correct - L* = 15
33 Partially correct 44 ms 3072 KB Output is partially correct - L* = 15
34 Partially correct 46 ms 3072 KB Output is partially correct - L* = 14
35 Partially correct 44 ms 3056 KB Output is partially correct - L* = 14
36 Partially correct 45 ms 3072 KB Output is partially correct - L* = 15
37 Partially correct 43 ms 3072 KB Output is partially correct - L* = 16
38 Partially correct 44 ms 3072 KB Output is partially correct - L* = 17
39 Partially correct 43 ms 3072 KB Output is partially correct - L* = 14
40 Partially correct 44 ms 3072 KB Output is partially correct - L* = 14