답안 #231583

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
231583 2020-05-14T05:06:51 Z bensonlzl Broken Device (JOI17_broken_device) C++14
85 / 100
54 ms 3072 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[]){
	vector<int> v;
	for (int i = 0; i < N; ++i){
		usable[i] = 1;
		ans[i] = 0;
		v.push_back(i);
	}
	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 if (usable[v[i]] && !usable[v[i+1]] && (X%3 == 1)){
			ans[v[i]] = 1;
			ans[v[i+1]] = 0;
			X /= 3;
		}
		else if (!usable[v[i]] && usable[v[i+1]] && (X%3 == 0)){
			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 "Brunolib.h"

using namespace std;

typedef long long ll;

long long Bruno(int N, int A[]){
	ll ans = 0;
	vector<int> v;
	for (int i = 0; i < N; ++i){
		v.push_back(i);
	}
	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 Partially correct 51 ms 3056 KB Output is partially correct - L* = 37
2 Partially correct 51 ms 3072 KB Output is partially correct - L* = 37
3 Partially correct 53 ms 3072 KB Output is partially correct - L* = 37
4 Partially correct 51 ms 3056 KB Output is partially correct - L* = 37
5 Partially correct 51 ms 3072 KB Output is partially correct - L* = 37
6 Partially correct 50 ms 3072 KB Output is partially correct - L* = 37
7 Partially correct 52 ms 3056 KB Output is partially correct - L* = 37
8 Partially correct 51 ms 3072 KB Output is partially correct - L* = 37
9 Partially correct 51 ms 3072 KB Output is partially correct - L* = 37
10 Partially correct 52 ms 3056 KB Output is partially correct - L* = 37
11 Partially correct 50 ms 3072 KB Output is partially correct - L* = 37
12 Partially correct 51 ms 3056 KB Output is partially correct - L* = 37
13 Partially correct 51 ms 3072 KB Output is partially correct - L* = 37
14 Partially correct 51 ms 3072 KB Output is partially correct - L* = 37
15 Partially correct 51 ms 3072 KB Output is partially correct - L* = 37
16 Partially correct 51 ms 3056 KB Output is partially correct - L* = 37
17 Partially correct 51 ms 3072 KB Output is partially correct - L* = 37
18 Partially correct 51 ms 3072 KB Output is partially correct - L* = 37
19 Partially correct 51 ms 3072 KB Output is partially correct - L* = 37
20 Partially correct 53 ms 3056 KB Output is partially correct - L* = 37
21 Partially correct 51 ms 3056 KB Output is partially correct - L* = 37
22 Partially correct 50 ms 3064 KB Output is partially correct - L* = 38
23 Partially correct 54 ms 3072 KB Output is partially correct - L* = 37
24 Partially correct 50 ms 3072 KB Output is partially correct - L* = 37
25 Partially correct 50 ms 3056 KB Output is partially correct - L* = 37
26 Partially correct 51 ms 3072 KB Output is partially correct - L* = 37
27 Partially correct 51 ms 3072 KB Output is partially correct - L* = 37
28 Partially correct 52 ms 3072 KB Output is partially correct - L* = 37
29 Partially correct 51 ms 3056 KB Output is partially correct - L* = 37
30 Partially correct 51 ms 3072 KB Output is partially correct - L* = 37
31 Partially correct 50 ms 3072 KB Output is partially correct - L* = 38
32 Partially correct 51 ms 3056 KB Output is partially correct - L* = 37
33 Partially correct 51 ms 3072 KB Output is partially correct - L* = 37
34 Partially correct 51 ms 3064 KB Output is partially correct - L* = 37
35 Partially correct 50 ms 3072 KB Output is partially correct - L* = 37
36 Partially correct 51 ms 3072 KB Output is partially correct - L* = 37
37 Partially correct 51 ms 3056 KB Output is partially correct - L* = 37
38 Partially correct 50 ms 3072 KB Output is partially correct - L* = 37
39 Partially correct 51 ms 3072 KB Output is partially correct - L* = 37
40 Partially correct 50 ms 3056 KB Output is partially correct - L* = 37