#include <bits/stdc++.h>
using namespace std;
#define ANNACPP ANNACPP
// #define BRUNOCPP BRUNOCPP
#ifdef ANNACPP
#include "Annalib.h"
void Anna(int n, long long x, int k, int* p) {
vector<int> v, g;
g.resize(n, 0);
for(int i = 0; i < k; ++i) {
g[p[i]] = 1;
}
int bt = 0;
for(int i = 0; i < n; i += 3) {
int jg = g[i] + g[i + 1] + g[i + 2];
if(jg == 0) {
int tx = ((x & (1ll << bt)) | (x & (1ll << (bt + 1)))) >> bt;
bt += 2;
if(tx == 0) {
v.push_back(0);
v.push_back(1);
v.push_back(1);
} else if(tx == 1) {
v.push_back(1);
v.push_back(0);
v.push_back(1);
} else if(tx == 2) {
v.push_back(1);
v.push_back(1);
v.push_back(0);
} else if(tx == 3) {
v.push_back(1);
v.push_back(1);
v.push_back(1);
} else {
exit(1);
}
} else if(jg == 1) {
int tx = (x & (1ll << bt)) >> bt;
++bt;
if(tx == 0) {
if(g[i + 1]) {
tx = (x & (1ll << bt)) >> bt;
++bt;
if(tx == 0) {
v.push_back(0);
v.push_back(1);
v.push_back(1);
} else if(tx == 1) {
v.push_back(1);
v.push_back(0);
v.push_back(1);
} else {
exit(1);
}
} else {
v.push_back(0);
v.push_back(1);
v.push_back(0);
}
} else if(tx == 1) {
if(g[i]) {
v.push_back(0);
v.push_back(0);
v.push_back(1);
} else {
v.push_back(1);
v.push_back(0);
v.push_back(0);
}
} else {
exit(1);
}
} else {
v.push_back(0);
v.push_back(0);
v.push_back(0);
}
}
for(int i = 0; i < n; ++i) {
Set(i, v[i]);
}
}
#endif
#ifdef BRUNOCPP
#include "Brunolib.h"
long long Bruno(int n, int* a) {
long long x = 0;
int bt = 0;
for(int i = 0; i < n; i += 3) {
int m = a[i] * 4 + a[i + 1] * 2 + a[i + 2];
if(m == 0);
else if(m == 1) x |= (1ll << bt), ++bt;
else if(m == 2) ++bt;
else if(m == 3) bt += 2;
else if(m == 4) x |= (1ll << bt), ++bt;
else if(m == 5) ++bt, x |= (1ll << bt), ++bt;
else if(m == 6) x |= (1ll << bt), bt += 2;
else if(m == 7) x |= (1ll << bt), ++bt, x |= (1ll << bt), ++bt;
}
return x;
}
#endif
#ifdef WEEE
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
return 0;
}
#endif
#include <bits/stdc++.h>
using namespace std;
// #define ANNACPP ANNACPP
#define BRUNOCPP BRUNOCPP
#ifdef ANNACPP
#include "Annalib.h"
void Anna(int n, long long x, int k, int* p) {
vector<int> v, g;
g.resize(n, 0);
for(int i = 0; i < k; ++i) {
g[p[i]] = 1;
}
int bt = 0;
for(int i = 0; i < n; i += 3) {
int jg = g[i] + g[i + 1] + g[i + 2];
if(jg == 0) {
int tx = ((x & (1ll << bt)) | (x & (1ll << (bt + 1)))) >> bt;
bt += 2;
if(tx == 0) {
v.push_back(0);
v.push_back(1);
v.push_back(1);
} else if(tx == 1) {
v.push_back(1);
v.push_back(0);
v.push_back(1);
} else if(tx == 2) {
v.push_back(1);
v.push_back(1);
v.push_back(0);
} else if(tx == 3) {
v.push_back(1);
v.push_back(1);
v.push_back(1);
} else {
exit(1);
}
} else if(jg == 1) {
int tx = (x & (1ll << bt)) >> bt;
++bt;
if(tx == 0) {
if(g[i + 1]) {
tx = (x & (1ll << bt)) >> bt;
++bt;
if(tx == 0) {
v.push_back(0);
v.push_back(1);
v.push_back(1);
} else if(tx == 1) {
v.push_back(1);
v.push_back(0);
v.push_back(1);
} else {
exit(1);
}
} else {
v.push_back(0);
v.push_back(1);
v.push_back(0);
}
} else if(tx == 1) {
if(g[i]) {
v.push_back(0);
v.push_back(0);
v.push_back(1);
} else {
v.push_back(1);
v.push_back(0);
v.push_back(0);
}
} else {
exit(1);
}
} else {
v.push_back(0);
v.push_back(0);
v.push_back(0);
}
}
for(int i = 0; i < n; ++i) {
Set(i, v[i]);
}
}
#endif
#ifdef BRUNOCPP
#include "Brunolib.h"
long long Bruno(int n, int* a) {
long long x = 0;
int bt = 0;
for(int i = 0; i < n; i += 3) {
int m = a[i] * 4 + a[i + 1] * 2 + a[i + 2];
if(m == 0);
else if(m == 1) x |= (1ll << bt), ++bt;
else if(m == 2) ++bt;
else if(m == 3) bt += 2;
else if(m == 4) x |= (1ll << bt), ++bt;
else if(m == 5) ++bt, x |= (1ll << bt), ++bt;
else if(m == 6) x |= (1ll << bt), bt += 2;
else if(m == 7) x |= (1ll << bt), ++bt, x |= (1ll << bt), ++bt;
}
return x;
}
#endif
#ifdef WEEE
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
return 0;
}
#endif
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
46 ms |
2944 KB |
Output isn't correct - L* = 0 |
2 |
Partially correct |
47 ms |
2952 KB |
Output isn't correct - L* = 0 |
3 |
Partially correct |
40 ms |
2740 KB |
Output isn't correct - L* = 0 |
4 |
Partially correct |
41 ms |
2772 KB |
Output isn't correct - L* = 0 |
5 |
Partially correct |
44 ms |
2872 KB |
Output isn't correct - L* = 0 |
6 |
Partially correct |
44 ms |
2944 KB |
Output isn't correct - L* = 0 |
7 |
Partially correct |
40 ms |
2944 KB |
Output isn't correct - L* = 0 |
8 |
Partially correct |
41 ms |
2836 KB |
Output isn't correct - L* = 0 |
9 |
Partially correct |
40 ms |
2824 KB |
Output isn't correct - L* = 0 |
10 |
Partially correct |
40 ms |
2952 KB |
Output isn't correct - L* = 0 |
11 |
Partially correct |
41 ms |
2952 KB |
Output isn't correct - L* = 0 |
12 |
Partially correct |
40 ms |
2744 KB |
Output isn't correct - L* = 0 |
13 |
Partially correct |
41 ms |
3080 KB |
Output isn't correct - L* = 0 |
14 |
Partially correct |
43 ms |
2868 KB |
Output isn't correct - L* = 0 |
15 |
Partially correct |
41 ms |
2868 KB |
Output isn't correct - L* = 0 |
16 |
Partially correct |
50 ms |
2944 KB |
Output isn't correct - L* = 0 |
17 |
Partially correct |
53 ms |
2740 KB |
Output isn't correct - L* = 0 |
18 |
Partially correct |
40 ms |
3200 KB |
Output isn't correct - L* = 0 |
19 |
Partially correct |
43 ms |
2872 KB |
Output isn't correct - L* = 0 |
20 |
Partially correct |
48 ms |
2872 KB |
Output isn't correct - L* = 0 |
21 |
Partially correct |
40 ms |
2740 KB |
Output isn't correct - L* = 0 |
22 |
Partially correct |
42 ms |
2868 KB |
Output isn't correct - L* = 0 |
23 |
Partially correct |
40 ms |
2740 KB |
Output isn't correct - L* = 0 |
24 |
Partially correct |
43 ms |
2944 KB |
Output isn't correct - L* = 0 |
25 |
Partially correct |
42 ms |
2872 KB |
Output isn't correct - L* = 0 |
26 |
Partially correct |
46 ms |
2744 KB |
Output isn't correct - L* = 0 |
27 |
Partially correct |
40 ms |
2944 KB |
Output isn't correct - L* = 0 |
28 |
Partially correct |
40 ms |
2740 KB |
Output isn't correct - L* = 0 |
29 |
Partially correct |
40 ms |
2868 KB |
Output isn't correct - L* = 0 |
30 |
Partially correct |
40 ms |
2884 KB |
Output isn't correct - L* = 0 |
31 |
Partially correct |
40 ms |
2868 KB |
Output isn't correct - L* = 0 |
32 |
Partially correct |
40 ms |
2992 KB |
Output isn't correct - L* = 0 |
33 |
Partially correct |
40 ms |
2944 KB |
Output isn't correct - L* = 0 |
34 |
Partially correct |
41 ms |
2740 KB |
Output isn't correct - L* = 0 |
35 |
Partially correct |
48 ms |
2744 KB |
Output isn't correct - L* = 0 |
36 |
Partially correct |
40 ms |
2836 KB |
Output isn't correct - L* = 0 |
37 |
Partially correct |
41 ms |
2844 KB |
Output isn't correct - L* = 0 |
38 |
Partially correct |
41 ms |
2944 KB |
Output isn't correct - L* = 0 |
39 |
Partially correct |
45 ms |
2944 KB |
Output isn't correct - L* = 0 |
40 |
Partially correct |
43 ms |
2872 KB |
Output isn't correct - L* = 0 |