Submission #231256

# Submission time Handle Problem Language Result Execution time Memory
231256 2020-05-13T08:46:06 Z bensonlzl Broken Device (JOI17_broken_device) C++14
0 / 100
68 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(8537295);
	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 == 0){
				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(8537295); 
	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;
}
# Verdict Execution time Memory Grader output
1 Partially correct 63 ms 3072 KB Output isn't correct - L* = 0
2 Partially correct 62 ms 3056 KB Output isn't correct - L* = 0
3 Partially correct 63 ms 3072 KB Output isn't correct - L* = 0
4 Partially correct 63 ms 3056 KB Output isn't correct - L* = 0
5 Partially correct 65 ms 3064 KB Output isn't correct - L* = 0
6 Partially correct 63 ms 3056 KB Output isn't correct - L* = 0
7 Partially correct 66 ms 3056 KB Output isn't correct - L* = 0
8 Partially correct 66 ms 3056 KB Output isn't correct - L* = 0
9 Partially correct 65 ms 3056 KB Output isn't correct - L* = 0
10 Partially correct 62 ms 3056 KB Output isn't correct - L* = 0
11 Partially correct 63 ms 3056 KB Output isn't correct - L* = 0
12 Partially correct 63 ms 3056 KB Output isn't correct - L* = 0
13 Partially correct 62 ms 3016 KB Output isn't correct - L* = 0
14 Partially correct 63 ms 3056 KB Output isn't correct - L* = 0
15 Partially correct 62 ms 3056 KB Output isn't correct - L* = 0
16 Partially correct 63 ms 3056 KB Output isn't correct - L* = 0
17 Partially correct 63 ms 3056 KB Output isn't correct - L* = 0
18 Partially correct 64 ms 3056 KB Output isn't correct - L* = 0
19 Partially correct 65 ms 3056 KB Output isn't correct - L* = 0
20 Partially correct 63 ms 3072 KB Output isn't correct - L* = 0
21 Partially correct 64 ms 3056 KB Output isn't correct - L* = 0
22 Partially correct 63 ms 3056 KB Output isn't correct - L* = 0
23 Partially correct 63 ms 3056 KB Output isn't correct - L* = 0
24 Partially correct 64 ms 3072 KB Output isn't correct - L* = 0
25 Partially correct 68 ms 3056 KB Output isn't correct - L* = 0
26 Partially correct 65 ms 3064 KB Output isn't correct - L* = 0
27 Partially correct 63 ms 3056 KB Output isn't correct - L* = 0
28 Partially correct 63 ms 3056 KB Output isn't correct - L* = 0
29 Partially correct 63 ms 3056 KB Output isn't correct - L* = 0
30 Partially correct 63 ms 3056 KB Output isn't correct - L* = 0
31 Partially correct 63 ms 3056 KB Output isn't correct - L* = 0
32 Partially correct 63 ms 3072 KB Output isn't correct - L* = 0
33 Partially correct 63 ms 3056 KB Output isn't correct - L* = 0
34 Partially correct 64 ms 3312 KB Output isn't correct - L* = 0
35 Partially correct 62 ms 3056 KB Output isn't correct - L* = 0
36 Partially correct 63 ms 3072 KB Output isn't correct - L* = 0
37 Partially correct 64 ms 3072 KB Output isn't correct - L* = 0
38 Partially correct 62 ms 3056 KB Output isn't correct - L* = 0
39 Partially correct 63 ms 3072 KB Output isn't correct - L* = 0
40 Partially correct 61 ms 3072 KB Output isn't correct - L* = 0