#include "Annalib.h"
#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
static bool ch[210];
static LL thr[210];
static int len=38;
static pii INIT[75]={{83, 28}, {64, 123}, {67, 21}, {43, 74}, {107, 18}, {46, 33}, {56, 68}, {14, 27}, {96, 122}, {3, 10}, {131, 77}, {91, 149}, {136, 36}, {76, 120}, {139, 61}, {137, 6}, {105, 49}, {72, 63}, {98, 5}, {87, 54}, {71, 117}, {65, 66}, {44, 59}, {42, 116}, {134, 145}, {47, 2}, {141, 62}, {30, 51}, {97, 70}, {57, 88}, {142, 4}, {24, 80}, {53, 109}, {7, 20}, {127, 23}, {13, 110}, {148, 9}, {25, 95}, {26, 130}, {41, 31}, {45, 55}, {58, 29}, {135, 37}, {69, 86}, {15, 22}, {112, 111}, {104, 106}, {133, 114}, {93, 11}, {113, 101}, {85, 34}, {90, 150}, {39, 78}, {35, 16}, {140, 92}, {60, 118}, {8, 52}, {79, 108}, {125, 121}, {100, 103}, {132, 50}, {89, 102}, {126, 124}, {128, 146}, {75, 115}, {32, 119}, {147, 129}, {94, 38}, {73, 1}, {17, 99}, {81, 143}, {12, 48}, {144, 19}, {84, 40}, {138, 82}};
void Anna(int N, LL X, int K, int P[]){
memset(ch, 0, sizeof ch);
for(int i=0; i<K; i++)ch[P[i]]=true;
for(int i=1; i<=len; i++){
thr[i]=X%3;
X/=3;
}
int re=len;
for(int i=0; i<75; i++){
int l=INIT[i].F, r=INIT[i].S;
if(ch[l]||ch[r]||re<0)Set(l, 0), Set(r, 0);
else{
if(thr[re]==0)Set(l, 0), Set(r, 1);
if(thr[re]==1)Set(l, 1), Set(r, 0);
if(thr[re]==2)Set(l, 1), Set(r, 1);
re--;
}
}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
static int len=38;
static pii INIT[75]={{83, 28}, {64, 123}, {67, 21}, {43, 74}, {107, 18}, {46, 33}, {56, 68}, {14, 27}, {96, 122}, {3, 10}, {131, 77}, {91, 149}, {136, 36}, {76, 120}, {139, 61}, {137, 6}, {105, 49}, {72, 63}, {98, 5}, {87, 54}, {71, 117}, {65, 66}, {44, 59}, {42, 116}, {134, 145}, {47, 2}, {141, 62}, {30, 51}, {97, 70}, {57, 88}, {142, 4}, {24, 80}, {53, 109}, {7, 20}, {127, 23}, {13, 110}, {148, 9}, {25, 95}, {26, 130}, {41, 31}, {45, 55}, {58, 29}, {135, 37}, {69, 86}, {15, 22}, {112, 111}, {104, 106}, {133, 114}, {93, 11}, {113, 101}, {85, 34}, {90, 150}, {39, 78}, {35, 16}, {140, 92}, {60, 118}, {8, 52}, {79, 108}, {125, 121}, {100, 103}, {132, 50}, {89, 102}, {126, 124}, {128, 146}, {75, 115}, {32, 119}, {147, 129}, {94, 38}, {73, 1}, {17, 99}, {81, 143}, {12, 48}, {144, 19}, {84, 40}, {138, 82}};
LL Bruno(int N, int A[]){
LL ret=0;
int num=0;
for(int i=0; i<75; i++){
int l=INIT[i].F, r=INIT[i].S;
if(!A[l]&&!A[r])continue;
ret*=3;
if(A[l]&&!A[r])ret++;
if(A[l]&&A[r])ret+=2;
num++;
if(num>=len)return ret;
}
}
Compilation message
Bruno.cpp: In function 'LL Bruno(int, int*)':
Bruno.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
1156 KB |
Wrong Answer [1] |
2 |
Incorrect |
0 ms |
900 KB |
Wrong Answer [1] |
3 |
Incorrect |
0 ms |
772 KB |
Wrong Answer [1] |
4 |
Incorrect |
0 ms |
1024 KB |
Wrong Answer [1] |
5 |
Incorrect |
0 ms |
772 KB |
Wrong Answer [1] |
6 |
Incorrect |
0 ms |
776 KB |
Wrong Answer [1] |
7 |
Incorrect |
1 ms |
900 KB |
Wrong Answer [1] |
8 |
Incorrect |
1 ms |
1024 KB |
Wrong Answer [1] |
9 |
Incorrect |
0 ms |
772 KB |
Wrong Answer [1] |
10 |
Incorrect |
1 ms |
780 KB |
Wrong Answer [1] |
11 |
Incorrect |
1 ms |
1028 KB |
Wrong Answer [1] |
12 |
Incorrect |
0 ms |
1032 KB |
Wrong Answer [1] |
13 |
Incorrect |
0 ms |
1024 KB |
Wrong Answer [1] |
14 |
Incorrect |
0 ms |
900 KB |
Wrong Answer [1] |
15 |
Incorrect |
0 ms |
772 KB |
Wrong Answer [1] |
16 |
Incorrect |
0 ms |
772 KB |
Wrong Answer [1] |
17 |
Incorrect |
0 ms |
1032 KB |
Wrong Answer [1] |
18 |
Incorrect |
0 ms |
1024 KB |
Wrong Answer [1] |
19 |
Incorrect |
0 ms |
772 KB |
Wrong Answer [1] |
20 |
Incorrect |
0 ms |
1024 KB |
Wrong Answer [1] |
21 |
Incorrect |
0 ms |
772 KB |
Wrong Answer [1] |
22 |
Incorrect |
0 ms |
772 KB |
Wrong Answer [1] |
23 |
Incorrect |
2 ms |
896 KB |
Wrong Answer [1] |
24 |
Incorrect |
0 ms |
772 KB |
Wrong Answer [1] |
25 |
Incorrect |
0 ms |
900 KB |
Wrong Answer [1] |
26 |
Incorrect |
1 ms |
772 KB |
Wrong Answer [1] |
27 |
Incorrect |
0 ms |
900 KB |
Wrong Answer [1] |
28 |
Incorrect |
1 ms |
1016 KB |
Wrong Answer [1] |
29 |
Incorrect |
0 ms |
900 KB |
Wrong Answer [1] |
30 |
Incorrect |
0 ms |
900 KB |
Wrong Answer [1] |
31 |
Incorrect |
6 ms |
900 KB |
Wrong Answer [1] |
32 |
Incorrect |
1 ms |
780 KB |
Wrong Answer [1] |
33 |
Incorrect |
0 ms |
780 KB |
Wrong Answer [1] |
34 |
Incorrect |
0 ms |
772 KB |
Wrong Answer [1] |
35 |
Incorrect |
1 ms |
1028 KB |
Wrong Answer [1] |
36 |
Incorrect |
1 ms |
772 KB |
Wrong Answer [1] |
37 |
Incorrect |
1 ms |
1024 KB |
Wrong Answer [1] |
38 |
Incorrect |
1 ms |
772 KB |
Wrong Answer [1] |
39 |
Incorrect |
1 ms |
772 KB |
Wrong Answer [1] |
40 |
Incorrect |
2 ms |
772 KB |
Wrong Answer [1] |