답안 #231269

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
231269 2020-05-13T09:18:17 Z bensonlzl Broken Device (JOI17_broken_device) C++14
85 / 100
67 ms 3312 KB
#include <bits/stdc++.h>
#include "Annalib.h"

using namespace std;

typedef long long ll;

int usable[155], ans[155];

void Anna(int N, long long X, int K, int P[]){
	mt19937 rng(8537292);
	vector<int> v;
	for (int i = 0; i < N; ++i){
		usable[i] = 1;
		ans[i] = 0;
		v.push_back(i);
	}
	shuffle(v.begin(),v.end(),rng);
	for (int i = 0; i < K; ++i){
		usable[P[i]] = 0;
	}
	for (int i = 0; i < N; i += 2){
		if (usable[v[i]] && usable[v[i+1]]){
			if (X%3 == 0){
				ans[v[i]] = 0;
				ans[v[i+1]] = 1;
			}
			else if (X%3 == 1){
				ans[v[i]] = 1;
				ans[v[i+1]] = 0;
			}
			else{
				ans[v[i]] = 1;
				ans[v[i+1]] = 1;
			} 
			X /= 3;
		}
		else{
			ans[v[i]] = ans[v[i+1]] = 0;
		}
	}
	for (int i = 0; i < N; ++i){
		Set(i,ans[i]);
	}
}
#include <bits/stdc++.h>
#include "Annalib.h"

using namespace std;

typedef long long ll;

long long Bruno(int N, int A[]){
	mt19937 rng(8537292); 
	ll ans = 0;
	vector<int> v;
	for (int i = 0; i < N; ++i){
		v.push_back(i);
	}
	shuffle(v.begin(),v.end(),rng);
	ll coeff = 1;
	for (int i = 0; i < N; i += 2){
		if (A[v[i]] || A[v[i+1]]){
			if (A[v[i]] && !A[v[i+1]]){
				ans += 1*coeff;
			}
			else if (A[v[i]] && A[v[i+1]]){
				ans += 2*coeff;
			}
			coeff *= 3;
			if (coeff > 1e18) break;
		}
	}
	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 64 ms 3056 KB Output is correct - L* = 40
2 Partially correct 64 ms 3056 KB Output is partially correct - L* = 38
3 Partially correct 64 ms 3072 KB Output is partially correct - L* = 39
4 Partially correct 63 ms 3056 KB Output is partially correct - L* = 39
5 Partially correct 64 ms 3072 KB Output is partially correct - L* = 39
6 Correct 65 ms 3056 KB Output is correct - L* = 40
7 Partially correct 64 ms 3056 KB Output is partially correct - L* = 38
8 Partially correct 63 ms 3056 KB Output is partially correct - L* = 38
9 Partially correct 62 ms 3056 KB Output is partially correct - L* = 38
10 Partially correct 63 ms 3008 KB Output is partially correct - L* = 38
11 Partially correct 64 ms 3056 KB Output is partially correct - L* = 38
12 Correct 63 ms 3056 KB Output is correct - L* = 40
13 Partially correct 65 ms 3056 KB Output is partially correct - L* = 38
14 Partially correct 64 ms 3056 KB Output is partially correct - L* = 38
15 Partially correct 62 ms 3056 KB Output is partially correct - L* = 37
16 Partially correct 67 ms 3072 KB Output is partially correct - L* = 38
17 Partially correct 65 ms 3312 KB Output is partially correct - L* = 38
18 Partially correct 64 ms 3056 KB Output is partially correct - L* = 39
19 Partially correct 64 ms 3056 KB Output is partially correct - L* = 38
20 Partially correct 63 ms 3056 KB Output is partially correct - L* = 37
21 Partially correct 64 ms 3056 KB Output is partially correct - L* = 39
22 Partially correct 63 ms 3056 KB Output is partially correct - L* = 38
23 Partially correct 64 ms 3056 KB Output is partially correct - L* = 38
24 Partially correct 64 ms 3072 KB Output is partially correct - L* = 39
25 Partially correct 64 ms 3056 KB Output is partially correct - L* = 38
26 Partially correct 64 ms 3056 KB Output is partially correct - L* = 39
27 Partially correct 63 ms 3056 KB Output is partially correct - L* = 39
28 Partially correct 62 ms 3072 KB Output is partially correct - L* = 38
29 Partially correct 64 ms 3056 KB Output is partially correct - L* = 38
30 Partially correct 63 ms 3072 KB Output is partially correct - L* = 38
31 Partially correct 63 ms 3064 KB Output is partially correct - L* = 39
32 Partially correct 64 ms 3120 KB Output is partially correct - L* = 39
33 Partially correct 64 ms 3056 KB Output is partially correct - L* = 39
34 Partially correct 64 ms 3056 KB Output is partially correct - L* = 39
35 Partially correct 65 ms 3056 KB Output is partially correct - L* = 38
36 Partially correct 63 ms 3072 KB Output is partially correct - L* = 38
37 Partially correct 62 ms 3056 KB Output is partially correct - L* = 38
38 Partially correct 65 ms 3056 KB Output is partially correct - L* = 39
39 Partially correct 64 ms 3056 KB Output is partially correct - L* = 37
40 Partially correct 62 ms 3056 KB Output is partially correct - L* = 38