답안 #627687

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
627687 2022-08-12T18:45:35 Z MilosMilutinovic Broken Device (JOI17_broken_device) C++14
41 / 100
40 ms 2440 KB
#include "Annalib.h"
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i ++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i ++)
#define MP make_pair

using namespace std;
typedef long long LL;
typedef pair<int, int> PII;

bool broken[150];

void Anna(int N, long long X, int K, int P[])
{
	rep(i, 150) broken[i] = false;
	rep(i, K) broken[P[i]] = true;
 	int bit = 0;
 	for(int i = 0; i < N - 1; i += 2) {
		if(bit <= 60 && (X >> bit & 1)) {
			if(!broken[i] && !broken[i + 1]) {
				Set(i, 1);
				Set(i + 1, 1);
				bit ++;
			} else {
				Set(i, 0);
				Set(i + 1, 0);
			}
		} else {
			if(!broken[i]) {
				Set(i, 1);
				Set(i + 1, 0);
				bit ++;
			} else if(!broken[i + 1]) {
				Set(i, 0);
				Set(i + 1, 1);
				bit ++;
			} else {
				Set(i, 0);
				Set(i + 1, 0);
			}
		}
	}
}
#include "Brunolib.h"
#include <bits/stdc++.h>

using namespace std;

long long Bruno(int N, int A[])
{
	long long X = 0;
	int bit = 0;
	for(int i = 0; i < N - 1; i += 2) {
		if(A[i] == 1 && A[i + 1] == 1) {
			X += (1LL << bit);
			bit ++;
		} else if(A[i] + A[i + 1] > 0) {
			bit ++;
		}
	}
	return X;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 33 ms 2216 KB Output is partially correct - L* = 17
2 Partially correct 30 ms 2248 KB Output is partially correct - L* = 16
3 Partially correct 40 ms 2244 KB Output is partially correct - L* = 18
4 Partially correct 36 ms 2236 KB Output is partially correct - L* = 17
5 Partially correct 28 ms 2248 KB Output is partially correct - L* = 17
6 Partially correct 31 ms 2324 KB Output is partially correct - L* = 17
7 Partially correct 35 ms 2200 KB Output is partially correct - L* = 18
8 Partially correct 30 ms 2248 KB Output is partially correct - L* = 18
9 Partially correct 28 ms 2248 KB Output is partially correct - L* = 18
10 Partially correct 31 ms 2404 KB Output is partially correct - L* = 16
11 Partially correct 32 ms 2240 KB Output is partially correct - L* = 17
12 Partially correct 28 ms 2256 KB Output is partially correct - L* = 17
13 Partially correct 28 ms 2300 KB Output is partially correct - L* = 18
14 Partially correct 30 ms 2356 KB Output is partially correct - L* = 18
15 Partially correct 30 ms 2256 KB Output is partially correct - L* = 16
16 Partially correct 30 ms 2248 KB Output is partially correct - L* = 17
17 Partially correct 30 ms 2172 KB Output is partially correct - L* = 17
18 Partially correct 30 ms 2384 KB Output is partially correct - L* = 16
19 Partially correct 35 ms 2272 KB Output is partially correct - L* = 18
20 Partially correct 28 ms 2248 KB Output is partially correct - L* = 15
21 Partially correct 28 ms 2364 KB Output is partially correct - L* = 17
22 Partially correct 37 ms 2356 KB Output is partially correct - L* = 16
23 Partially correct 31 ms 2440 KB Output is partially correct - L* = 15
24 Partially correct 32 ms 2260 KB Output is partially correct - L* = 17
25 Partially correct 36 ms 2208 KB Output is partially correct - L* = 17
26 Partially correct 31 ms 2292 KB Output is partially correct - L* = 16
27 Partially correct 28 ms 2364 KB Output is partially correct - L* = 18
28 Partially correct 28 ms 2300 KB Output is partially correct - L* = 17
29 Partially correct 28 ms 2248 KB Output is partially correct - L* = 16
30 Partially correct 32 ms 2332 KB Output is partially correct - L* = 20
31 Partially correct 34 ms 2380 KB Output is partially correct - L* = 17
32 Partially correct 32 ms 2320 KB Output is partially correct - L* = 18
33 Partially correct 28 ms 2248 KB Output is partially correct - L* = 17
34 Partially correct 31 ms 2316 KB Output is partially correct - L* = 18
35 Partially correct 28 ms 2316 KB Output is partially correct - L* = 16
36 Partially correct 40 ms 2276 KB Output is partially correct - L* = 15
37 Partially correct 33 ms 2264 KB Output is partially correct - L* = 16
38 Partially correct 30 ms 2348 KB Output is partially correct - L* = 18
39 Partially correct 30 ms 2336 KB Output is partially correct - L* = 17
40 Partially correct 40 ms 2220 KB Output is partially correct - L* = 15