Submission #231334

# Submission time Handle Problem Language Result Execution time Memory
231334 2020-05-13T11:27:10 Z bensonlzl Broken Device (JOI17_broken_device) C++14
85 / 100
62 ms 3328 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[]){
	srand(10);
	vector<int> v;
	for (int i = 0; i < N; ++i){
		usable[i] = 1;
		ans[i] = 0;
		v.push_back(i);
	}
	random_shuffle(v.begin(),v.end());
	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[]){
	srand(10);
	ll ans = 0;
	vector<int> v;
	for (int i = 0; i < N; ++i){
		v.push_back(i);
	}
	random_shuffle(v.begin(),v.end());
	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;
}
# Verdict Execution time Memory Grader output
1 Partially correct 57 ms 3072 KB Output is partially correct - L* = 39
2 Partially correct 59 ms 3056 KB Output is partially correct - L* = 38
3 Partially correct 59 ms 3056 KB Output is partially correct - L* = 39
4 Correct 59 ms 3328 KB Output is correct - L* = 40
5 Partially correct 61 ms 3056 KB Output is partially correct - L* = 39
6 Partially correct 57 ms 3056 KB Output is partially correct - L* = 38
7 Partially correct 57 ms 3072 KB Output is partially correct - L* = 39
8 Correct 59 ms 3056 KB Output is correct - L* = 40
9 Partially correct 62 ms 3056 KB Output is partially correct - L* = 38
10 Partially correct 59 ms 3056 KB Output is partially correct - L* = 39
11 Partially correct 59 ms 3072 KB Output is partially correct - L* = 39
12 Partially correct 60 ms 3056 KB Output is partially correct - L* = 37
13 Partially correct 59 ms 3056 KB Output is partially correct - L* = 39
14 Partially correct 61 ms 3072 KB Output is partially correct - L* = 39
15 Partially correct 57 ms 3056 KB Output is partially correct - L* = 39
16 Partially correct 57 ms 3072 KB Output is partially correct - L* = 38
17 Partially correct 59 ms 3072 KB Output is partially correct - L* = 38
18 Partially correct 59 ms 3072 KB Output is partially correct - L* = 38
19 Partially correct 56 ms 3056 KB Output is partially correct - L* = 38
20 Partially correct 60 ms 3056 KB Output is partially correct - L* = 38
21 Partially correct 59 ms 3072 KB Output is partially correct - L* = 38
22 Correct 60 ms 3072 KB Output is correct - L* = 40
23 Partially correct 57 ms 3072 KB Output is partially correct - L* = 38
24 Correct 57 ms 3072 KB Output is correct - L* = 40
25 Partially correct 61 ms 3056 KB Output is partially correct - L* = 39
26 Partially correct 59 ms 3056 KB Output is partially correct - L* = 38
27 Partially correct 59 ms 3072 KB Output is partially correct - L* = 39
28 Partially correct 59 ms 3072 KB Output is partially correct - L* = 39
29 Partially correct 59 ms 3072 KB Output is partially correct - L* = 39
30 Partially correct 57 ms 3072 KB Output is partially correct - L* = 38
31 Partially correct 57 ms 3056 KB Output is partially correct - L* = 38
32 Partially correct 59 ms 3056 KB Output is partially correct - L* = 38
33 Correct 57 ms 3056 KB Output is correct - L* = 40
34 Partially correct 61 ms 3072 KB Output is partially correct - L* = 38
35 Partially correct 59 ms 3056 KB Output is partially correct - L* = 38
36 Partially correct 59 ms 3056 KB Output is partially correct - L* = 39
37 Correct 60 ms 3072 KB Output is correct - L* = 40
38 Partially correct 57 ms 3072 KB Output is partially correct - L* = 39
39 Partially correct 60 ms 3056 KB Output is partially correct - L* = 38
40 Partially correct 57 ms 3056 KB Output is partially correct - L* = 39