#include <bits/stdc++.h>
#include "Annalib.h"
typedef long long ll;
using namespace std;
int mark[151];
ll power(ll x, ll y)
{
if(y == 0) return 1;
ll ret = 1;
while(y--) ret *= x;
return ret;
}
void Anna(int n, long long x, int k, int p[] )
{
srand(3214354);
vector<int> v;
for(int i=0; i<150; i++) v.push_back(i);
random_shuffle(v.begin(), v.end());
ll temp = x, cnt = 0;
memset(mark, 0, sizeof mark);
for(int i=0; i<k; i++) mark[p[i]] = 1;
ll a[38];
for(ll i=37; i>=0; i--)
{
if(temp >= power(3, i)*2) temp -= power(3, i)*2, a[i] = 2;
else if(temp >= power(3, i)) temp -= power(3, i), a[i] = 1;
else a[i] = 0;
}
for(int i=0; i<n; i+=2)
{
if((mark[v[i]] && mark[v[i+1]]) || cnt > 37) Set(v[i], 0), Set(v[i+1], 0);
else
{
if(a[cnt] == 2 && (!mark[v[i]] && !mark[v[i+1]])) Set(v[i], 1), Set(v[i+1], 1);
else if(a[cnt] == 2) Set(v[i], 0), Set(v[i+1], 0);
else if(a[cnt] == 1 && !mark[v[i]]) Set(v[i], 1), Set(v[i+1], 0);
else if(a[cnt] == 1) Set(v[i], 0), Set(v[i+1], 0);
else if(!mark[v[i+1]]) Set(v[i], 0), Set(v[i+1], 1);
else Set(v[i], 0), Set(v[i+1], 0);
cnt++;
}
}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
//~ #include "Anna.cpp"
//~ #include "grader.cpp"
typedef long long ll;
using namespace std;
ll power(ll x, ll y)
{
if(y == 0) return 1;
ll ret = 1;
while(y--) ret *= x;
return ret;
}
long long Bruno(int n, int a[] )
{
srand(3214354);
vector<int> v;
for(int i=0; i<150; i++) v.push_back(i);
random_shuffle(v.begin(), v.end());
ll cnt = 0;
ll x = 0;
for(int i=0; i<n; i+=2)
{
if(!a[v[i]] && !a[v[i+1]]) continue;
int b;
if(a[v[i]] == 1 && a[v[i+1]] == 1) b = 2;
else if(a[v[i]] == 1) b = 1;
else b = 0;
x += b*power(3, cnt++);
}
return x;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
60 ms |
3056 KB |
Output isn't correct - L* = 0 |
2 |
Incorrect |
59 ms |
3056 KB |
Output isn't correct - L* = 0 |
3 |
Incorrect |
56 ms |
3056 KB |
Output isn't correct - L* = 0 |
4 |
Incorrect |
62 ms |
3056 KB |
Output isn't correct - L* = 0 |
5 |
Incorrect |
57 ms |
3056 KB |
Output isn't correct - L* = 0 |
6 |
Incorrect |
56 ms |
3000 KB |
Output isn't correct - L* = 0 |
7 |
Incorrect |
57 ms |
3056 KB |
Output isn't correct - L* = 0 |
8 |
Incorrect |
57 ms |
3056 KB |
Output isn't correct - L* = 0 |
9 |
Incorrect |
56 ms |
3056 KB |
Output isn't correct - L* = 0 |
10 |
Incorrect |
56 ms |
3056 KB |
Output isn't correct - L* = 0 |
11 |
Incorrect |
56 ms |
3056 KB |
Output isn't correct - L* = 0 |
12 |
Incorrect |
56 ms |
3056 KB |
Output isn't correct - L* = 0 |
13 |
Incorrect |
56 ms |
3064 KB |
Output isn't correct - L* = 0 |
14 |
Incorrect |
57 ms |
2968 KB |
Output isn't correct - L* = 0 |
15 |
Incorrect |
57 ms |
3056 KB |
Output isn't correct - L* = 0 |
16 |
Incorrect |
60 ms |
3056 KB |
Output isn't correct - L* = 0 |
17 |
Incorrect |
56 ms |
3312 KB |
Output isn't correct - L* = 0 |
18 |
Incorrect |
56 ms |
3112 KB |
Output isn't correct - L* = 0 |
19 |
Incorrect |
56 ms |
3056 KB |
Output isn't correct - L* = 0 |
20 |
Incorrect |
56 ms |
3056 KB |
Output isn't correct - L* = 0 |
21 |
Incorrect |
57 ms |
3056 KB |
Output isn't correct - L* = 0 |
22 |
Incorrect |
56 ms |
3056 KB |
Output isn't correct - L* = 0 |
23 |
Incorrect |
57 ms |
3056 KB |
Output isn't correct - L* = 0 |
24 |
Incorrect |
57 ms |
2896 KB |
Output isn't correct - L* = 0 |
25 |
Incorrect |
56 ms |
3056 KB |
Output isn't correct - L* = 0 |
26 |
Incorrect |
56 ms |
3056 KB |
Output isn't correct - L* = 0 |
27 |
Incorrect |
57 ms |
3312 KB |
Output isn't correct - L* = 0 |
28 |
Incorrect |
56 ms |
3056 KB |
Output isn't correct - L* = 0 |
29 |
Incorrect |
56 ms |
3064 KB |
Output isn't correct - L* = 0 |
30 |
Incorrect |
57 ms |
3000 KB |
Output isn't correct - L* = 0 |
31 |
Incorrect |
57 ms |
3056 KB |
Output isn't correct - L* = 0 |
32 |
Incorrect |
56 ms |
3056 KB |
Output isn't correct - L* = 0 |
33 |
Incorrect |
56 ms |
3056 KB |
Output isn't correct - L* = 0 |
34 |
Incorrect |
57 ms |
3056 KB |
Output isn't correct - L* = 0 |
35 |
Incorrect |
56 ms |
3056 KB |
Output isn't correct - L* = 0 |
36 |
Incorrect |
57 ms |
3056 KB |
Output isn't correct - L* = 0 |
37 |
Incorrect |
57 ms |
3064 KB |
Output isn't correct - L* = 0 |
38 |
Incorrect |
56 ms |
3056 KB |
Output isn't correct - L* = 0 |
39 |
Incorrect |
57 ms |
3056 KB |
Output isn't correct - L* = 0 |
40 |
Incorrect |
59 ms |
3056 KB |
Output isn't correct - L* = 0 |