#include "Annalib.h"
void send(int x, int y){
for(int t = 0; t < 3; t++, y /= 2) Set(x + 2 - t, y & 1);
}
void Anna(int N, long long X, int K, int P[]){
int c[150] = {};
for(int i = 0; i < K; i++) c[P[i]] = 1;
int x[65] = {}, cnt = 0;
for(int i = 0; i < 60; i++) x[i] = !!(X & (1LL << i));
auto b = [](const int &x){ return __builtin_popcount(x); };
for(int i = 0; i < 150; i += 3){
int q = c[i] * 4 + c[i + 1] * 2 + c[i + 2];
if(b(q) == 0){
if(x[cnt]) send(i, 3 + 4 * x[cnt + 1]);
else send(i, 4 + x[cnt + 1]);
cnt += 2;
}
else if(b(q) == 1){
if(q == 2){
if(x[cnt]){
send(i, 1);
cnt++;
}
else{
if(x[cnt + 1]) send(i, 5);
else send(i, 4);
cnt += 2;
}
}
else{
if(x[cnt]) send(i, q == 1 ? 6 : 1);
else send(i, 2);
cnt++;
}
}
else send(i, 0);
if(cnt >= 60) cnt = 60;
}
}
#include "Brunolib.h"
#include <cstdio>
static int v[8][2] = {{0, 0}, {1, 0}, {0, 0}, {1, 0}, {0, 0}, {0, 1}, {1, 0}, {1, 1}};
static int c[8] = {0, 1, 1, 2, 2, 2, 1, 2}, cnt;
long long Bruno( int N, int A[] ){
long long X = 0;
for(int i = 0; i < 150; i += 3){
int t = A[i] * 4 + A[i + 1] * 2 + A[i + 2];
for(int j = 0; j < c[t]; j++){
X += (long long)v[t][j] << (cnt + j);
}
cnt += c[t];
}
return X;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
35 ms |
2836 KB |
Output isn't correct - L* = 0 |
2 |
Incorrect |
41 ms |
2836 KB |
Output isn't correct - L* = 0 |
3 |
Incorrect |
35 ms |
2836 KB |
Output isn't correct - L* = 0 |
4 |
Incorrect |
35 ms |
2836 KB |
Output isn't correct - L* = 0 |
5 |
Incorrect |
35 ms |
2836 KB |
Output isn't correct - L* = 0 |
6 |
Incorrect |
34 ms |
2836 KB |
Output isn't correct - L* = 0 |
7 |
Incorrect |
39 ms |
2836 KB |
Output isn't correct - L* = 0 |
8 |
Incorrect |
41 ms |
2836 KB |
Output isn't correct - L* = 0 |
9 |
Incorrect |
39 ms |
2836 KB |
Output isn't correct - L* = 0 |
10 |
Incorrect |
35 ms |
2836 KB |
Output isn't correct - L* = 0 |
11 |
Incorrect |
56 ms |
2836 KB |
Output isn't correct - L* = 0 |
12 |
Incorrect |
39 ms |
2836 KB |
Output isn't correct - L* = 0 |
13 |
Incorrect |
41 ms |
2836 KB |
Output isn't correct - L* = 0 |
14 |
Incorrect |
41 ms |
2836 KB |
Output isn't correct - L* = 0 |
15 |
Incorrect |
35 ms |
2836 KB |
Output isn't correct - L* = 0 |
16 |
Incorrect |
28 ms |
2836 KB |
Output isn't correct - L* = 0 |
17 |
Incorrect |
41 ms |
2836 KB |
Output isn't correct - L* = 0 |
18 |
Incorrect |
36 ms |
2836 KB |
Output isn't correct - L* = 0 |
19 |
Incorrect |
46 ms |
2836 KB |
Output isn't correct - L* = 0 |
20 |
Incorrect |
35 ms |
2836 KB |
Output isn't correct - L* = 0 |
21 |
Incorrect |
39 ms |
2836 KB |
Output isn't correct - L* = 0 |
22 |
Incorrect |
35 ms |
2836 KB |
Output isn't correct - L* = 0 |
23 |
Incorrect |
35 ms |
2836 KB |
Output isn't correct - L* = 0 |
24 |
Incorrect |
35 ms |
2836 KB |
Output isn't correct - L* = 0 |
25 |
Incorrect |
45 ms |
2836 KB |
Output isn't correct - L* = 0 |
26 |
Incorrect |
55 ms |
2836 KB |
Output isn't correct - L* = 0 |
27 |
Incorrect |
38 ms |
2836 KB |
Output isn't correct - L* = 0 |
28 |
Incorrect |
35 ms |
2836 KB |
Output isn't correct - L* = 0 |
29 |
Incorrect |
45 ms |
2836 KB |
Output isn't correct - L* = 0 |
30 |
Incorrect |
39 ms |
2836 KB |
Output isn't correct - L* = 0 |
31 |
Incorrect |
35 ms |
2836 KB |
Output isn't correct - L* = 0 |
32 |
Incorrect |
38 ms |
2836 KB |
Output isn't correct - L* = 0 |
33 |
Incorrect |
41 ms |
2836 KB |
Output isn't correct - L* = 0 |
34 |
Incorrect |
25 ms |
2836 KB |
Output isn't correct - L* = 0 |
35 |
Incorrect |
35 ms |
2836 KB |
Output isn't correct - L* = 0 |
36 |
Incorrect |
52 ms |
2836 KB |
Output isn't correct - L* = 0 |
37 |
Incorrect |
32 ms |
2836 KB |
Output isn't correct - L* = 0 |
38 |
Incorrect |
56 ms |
2836 KB |
Output isn't correct - L* = 0 |
39 |
Incorrect |
39 ms |
2836 KB |
Output isn't correct - L* = 0 |
40 |
Incorrect |
46 ms |
2836 KB |
Output isn't correct - L* = 0 |