#include <bits/stdc++.h>
//~ #include "grader.cpp"
//~ #include "Bruno.cpp"
#include "Annalib.h"
using namespace std;
void Anna( int N, long long X, int K, int P[] ){
srand(123321);
vector <int> all;
for(int i = 0 ; i < N ; i++){
all.push_back(i);
}
random_shuffle(all.begin(), all.end());
vector <int> broken(N);
for(int i = 0 ; i < K ; i++){
broken[P[i]] = 1;
}
for(int i = 0 ; i < N ; i += 2){
int cur = X % 3;
if(broken[all[i]] && broken[all[i + 1]]) continue;
if(broken[all[i]] && (cur == 1 || cur == 2)) continue;
if(broken[all[i + 1]] && (cur == 0 || cur == 2)) continue;
X /= 3;
if(cur == 0){
Set(all[i], 0);
Set(all[i + 1], 1);
}
else if(cur == 1){
Set(all[i], 1);
Set(all[i + 1], 0);
}
else{
Set(all[i], 1);
Set(all[i + 1], 1);
}
}
}
#include <bits/stdc++.h>
#include "Brunolib.h"
using namespace std;
#define ll long long
long long Bruno( int N, int A[] ){
srand(123321);
vector <int> all;
for(int i = 0 ; i < N ; i++){
all.push_back(i);
}
random_shuffle(all.begin(), all.end());
vector <int> r;
for(int i = 0 ; i < N ; i += 2){
if(A[all[i]] == 0 && A[all[i + 1]] == 1) r.push_back(0);
else if(A[all[i]] == 1 && A[all[i + 1]] == 0) r.push_back(1);
else if(A[all[i]] == 1 && A[all[i + 1]] == 1) r.push_back(2);
}
reverse(r.begin(), r.end());
ll ret = 0;
for(auto &i : r) ret = ret * 3 + i;
return ret;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
760 KB |
Wrong Answer [4] |
2 |
Incorrect |
4 ms |
768 KB |
Wrong Answer [4] |
3 |
Incorrect |
11 ms |
888 KB |
Wrong Answer [4] |
4 |
Incorrect |
4 ms |
768 KB |
Wrong Answer [4] |
5 |
Incorrect |
4 ms |
648 KB |
Wrong Answer [4] |
6 |
Incorrect |
4 ms |
860 KB |
Wrong Answer [4] |
7 |
Incorrect |
4 ms |
860 KB |
Wrong Answer [4] |
8 |
Incorrect |
5 ms |
872 KB |
Wrong Answer [4] |
9 |
Incorrect |
4 ms |
860 KB |
Wrong Answer [4] |
10 |
Incorrect |
4 ms |
768 KB |
Wrong Answer [4] |
11 |
Incorrect |
4 ms |
856 KB |
Wrong Answer [4] |
12 |
Incorrect |
4 ms |
860 KB |
Wrong Answer [4] |
13 |
Incorrect |
4 ms |
764 KB |
Wrong Answer [4] |
14 |
Incorrect |
4 ms |
760 KB |
Wrong Answer [4] |
15 |
Incorrect |
4 ms |
888 KB |
Wrong Answer [4] |
16 |
Incorrect |
4 ms |
632 KB |
Wrong Answer [4] |
17 |
Incorrect |
4 ms |
632 KB |
Wrong Answer [4] |
18 |
Incorrect |
4 ms |
632 KB |
Wrong Answer [4] |
19 |
Incorrect |
4 ms |
760 KB |
Wrong Answer [4] |
20 |
Incorrect |
4 ms |
760 KB |
Wrong Answer [4] |
21 |
Incorrect |
4 ms |
632 KB |
Wrong Answer [4] |
22 |
Incorrect |
4 ms |
760 KB |
Wrong Answer [4] |
23 |
Incorrect |
4 ms |
864 KB |
Wrong Answer [4] |
24 |
Incorrect |
4 ms |
760 KB |
Wrong Answer [4] |
25 |
Incorrect |
4 ms |
768 KB |
Wrong Answer [4] |
26 |
Incorrect |
4 ms |
776 KB |
Wrong Answer [4] |
27 |
Incorrect |
4 ms |
760 KB |
Wrong Answer [4] |
28 |
Incorrect |
4 ms |
768 KB |
Wrong Answer [4] |
29 |
Incorrect |
4 ms |
764 KB |
Wrong Answer [4] |
30 |
Incorrect |
4 ms |
760 KB |
Wrong Answer [4] |
31 |
Incorrect |
4 ms |
756 KB |
Wrong Answer [4] |
32 |
Incorrect |
4 ms |
760 KB |
Wrong Answer [4] |
33 |
Incorrect |
4 ms |
760 KB |
Wrong Answer [4] |
34 |
Incorrect |
4 ms |
760 KB |
Wrong Answer [4] |
35 |
Incorrect |
5 ms |
888 KB |
Wrong Answer [4] |
36 |
Incorrect |
4 ms |
652 KB |
Wrong Answer [4] |
37 |
Incorrect |
4 ms |
996 KB |
Wrong Answer [4] |
38 |
Incorrect |
4 ms |
888 KB |
Wrong Answer [4] |
39 |
Incorrect |
4 ms |
888 KB |
Wrong Answer [4] |
40 |
Incorrect |
4 ms |
864 KB |
Wrong Answer [4] |