#include <bits/stdc++.h>
using namespace std;
#include "Annalib.h"
void Anna( int N, long long X, int K, int P[] ){
vector<int> bad(N);
for (int i = 0; i<K; i++) bad[P[i]] = 1;
vector<int> p = {110,51,11,69,119,142,17,109,26,101,115,39,108,2,75,56,59,18,32,116,143,86,57,133,14,42,27,136,104,58,30,96,13,68,130,114,71,102,9,139,66,80,103,79,89,81,106,0,134,41,88,28,52,43,16,60,49,105,149,132,29,112,141,45,53,76,8,33,37,15,25,55,70,31,82,47,111,107,90,117,23,122,77,19,126,44,120,131,97,1,38,95,4,21,137,5,121,65,135,144,7,138,64,148,140,100,73,10,83,113,92,48,61,127,87,67,40,124,63,129,93,78,74,54,34,123,85,36,6,24,3,125,72,145,94,50,62,146,98,22,118,128,35,91,46,12,99,84,20,147};
vector<int> pr(N);
for (int i = 0; i<N; i++) {
pr[p[i]] = i;
}
vector<int> ans (N);
for (int i = 0; i<N; i+=2) {
int a = p[i], b = p[i+1];
if (!bad[a] && !bad[b]) {
int x3 = X/3; X/=3;
if (x3 == 1 || x3 == 2) ans[a] = 1;
if (x3 == 0 || x3 == 2) ans[b] = 1;
}
}
for (int i = 0; i<N; i++){
Set(i,ans[i]);
}
}
#include <bits/stdc++.h>
#define ll long long
using namespace std;
#include "Brunolib.h"
long long Bruno( int N, int A[] ){
vector<int> p = {110,51,11,69,119,142,17,109,26,101,115,39,108,2,75,56,59,18,32,116,143,86,57,133,14,42,27,136,104,58,30,96,13,68,130,114,71,102,9,139,66,80,103,79,89,81,106,0,134,41,88,28,52,43,16,60,49,105,149,132,29,112,141,45,53,76,8,33,37,15,25,55,70,31,82,47,111,107,90,117,23,122,77,19,126,44,120,131,97,1,38,95,4,21,137,5,121,65,135,144,7,138,64,148,140,100,73,10,83,113,92,48,61,127,87,67,40,124,63,129,93,78,74,54,34,123,85,36,6,24,3,125,72,145,94,50,62,146,98,22,118,128,35,91,46,12,99,84,20,147};
vector<int> pr(N);
for (int i = 0; i<N; i++) {
pr[p[i]] = i;
}
ll X = 0;
ll p3 = 1;
for (int i = 0; i<N; i+=2) {
int a = p[i], b = p[i+1];
if (A[a] || A[b]) {
int x3 = 2*A[a] + A[b] -1;
X+=p3 * x3;
p3 *= 3;
}
}
return X;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
53 ms |
3056 KB |
Output isn't correct - L* = 0 |
2 |
Partially correct |
50 ms |
3056 KB |
Output isn't correct - L* = 0 |
3 |
Partially correct |
50 ms |
3120 KB |
Output isn't correct - L* = 0 |
4 |
Partially correct |
53 ms |
3064 KB |
Output isn't correct - L* = 0 |
5 |
Partially correct |
51 ms |
3056 KB |
Output isn't correct - L* = 0 |
6 |
Partially correct |
51 ms |
3056 KB |
Output isn't correct - L* = 0 |
7 |
Partially correct |
52 ms |
3056 KB |
Output isn't correct - L* = 0 |
8 |
Partially correct |
51 ms |
3056 KB |
Output isn't correct - L* = 0 |
9 |
Partially correct |
53 ms |
3056 KB |
Output isn't correct - L* = 0 |
10 |
Partially correct |
52 ms |
3056 KB |
Output isn't correct - L* = 0 |
11 |
Partially correct |
51 ms |
3056 KB |
Output isn't correct - L* = 0 |
12 |
Partially correct |
51 ms |
3056 KB |
Output isn't correct - L* = 0 |
13 |
Partially correct |
52 ms |
3056 KB |
Output isn't correct - L* = 0 |
14 |
Partially correct |
53 ms |
3056 KB |
Output isn't correct - L* = 0 |
15 |
Partially correct |
53 ms |
3056 KB |
Output isn't correct - L* = 0 |
16 |
Partially correct |
51 ms |
3056 KB |
Output isn't correct - L* = 0 |
17 |
Partially correct |
51 ms |
3312 KB |
Output isn't correct - L* = 0 |
18 |
Partially correct |
52 ms |
3056 KB |
Output isn't correct - L* = 0 |
19 |
Partially correct |
50 ms |
3056 KB |
Output isn't correct - L* = 0 |
20 |
Partially correct |
52 ms |
3056 KB |
Output isn't correct - L* = 0 |
21 |
Partially correct |
52 ms |
3056 KB |
Output isn't correct - L* = 0 |
22 |
Partially correct |
53 ms |
3056 KB |
Output isn't correct - L* = 0 |
23 |
Partially correct |
50 ms |
3056 KB |
Output isn't correct - L* = 0 |
24 |
Partially correct |
54 ms |
2896 KB |
Output isn't correct - L* = 0 |
25 |
Partially correct |
53 ms |
2944 KB |
Output isn't correct - L* = 0 |
26 |
Partially correct |
51 ms |
3056 KB |
Output isn't correct - L* = 0 |
27 |
Partially correct |
51 ms |
3056 KB |
Output isn't correct - L* = 0 |
28 |
Partially correct |
50 ms |
3056 KB |
Output isn't correct - L* = 0 |
29 |
Partially correct |
51 ms |
3056 KB |
Output isn't correct - L* = 0 |
30 |
Partially correct |
52 ms |
3312 KB |
Output isn't correct - L* = 0 |
31 |
Partially correct |
50 ms |
3056 KB |
Output isn't correct - L* = 0 |
32 |
Partially correct |
50 ms |
3056 KB |
Output isn't correct - L* = 0 |
33 |
Partially correct |
51 ms |
3056 KB |
Output isn't correct - L* = 0 |
34 |
Partially correct |
50 ms |
3064 KB |
Output isn't correct - L* = 0 |
35 |
Partially correct |
51 ms |
2888 KB |
Output isn't correct - L* = 0 |
36 |
Partially correct |
49 ms |
3056 KB |
Output isn't correct - L* = 0 |
37 |
Partially correct |
53 ms |
3056 KB |
Output isn't correct - L* = 0 |
38 |
Partially correct |
52 ms |
3056 KB |
Output isn't correct - L* = 0 |
39 |
Partially correct |
51 ms |
3072 KB |
Output isn't correct - L* = 0 |
40 |
Partially correct |
51 ms |
3016 KB |
Output isn't correct - L* = 0 |