#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
void Anna( int N, long long X, int K, int P[] ){
vector<int> arr1={ 90, 36, 93, 2, 4, 76, 88, 104, 131, 144, 110, 71, 134, 135, 3, 11, 19, 49, 75, 67, 55, 20, 30, 117, 23, 107, 83, 100, 119, 21, 102, 92, 106, 111, 48, 89, 128, 84, 15, 147, 99, 42, 29, 44, 130, 94, 86, 77, 74, 139, 57, 28, 125, 46, 129, 142, 138, 34, 31, 85, 13, 103, 115, 63, 81, 14, 149, 47, 26, 116, 87, 6, 95, 140, 24 } ;
vector<int> arr2={ 148, 126, 62, 58, 17, 121, 65, 91, 41, 66, 80, 133, 56, 25, 43, 145, 136, 79, 141, 12, 16, 64, 38, 10, 143, 97, 1, 8, 51, 39, 146, 118, 109, 33, 112, 54, 18, 132, 69, 5, 113, 45, 98, 68, 40, 50, 32, 9, 122, 61, 72, 60, 124, 27, 96, 114, 78, 37, 70, 127, 52, 59, 7, 123, 101, 137, 108, 22, 73, 105, 82, 53, 35, 120, 0 } ;
int tab[N];
memset(tab,0,sizeof tab);
for (int i = 0; i < K; ++i)
{
tab[P[i]]=-1;
}
int convert[60];
long long a[60];
a[0]=1;
for (int i = 1; i < 60; ++i)
{
a[i]=a[i-1]*2;
}
long long y=59;
//cout << a[59]<<endl;
while(y>=0){
//cout <<X<<" "<<a[y]<<endl;
if(X>=a[y]){
X-=a[y];
convert[y]=1;
}else convert[y]=0;
y--;
}//cout <<endl;
int lst=0;
for (int i = 0; i < 75; i++)
{
if(lst>59) break;
if(convert[lst]==1){
if (tab[arr1[i]]!=-1&&tab[arr2[i]]!=-1)
{
tab[arr1[i]]=1;
tab[arr2[i]]=1;
lst++;
}
}else{
if (tab[arr1[i]]!=-1&&tab[arr2[i]]!=-1)
{
tab[arr1[i]]=0;
tab[arr2[i]]=1;
lst++;
}else if (tab[arr1[i]]!=-1)
{
tab[arr1[i]]=1;
tab[arr2[i]]=0;
lst++;
}else if(tab[arr2[i]]!=-1){
tab[arr2[i]]=1;
tab[arr1[i]]=0;
lst++;
}
}
}
for (int i = 0; i < N; ++i)
{
if(tab[i]==1) Set(i,1);
else Set(i,0);
}
}
#include "Brunolib.h"
#include<bits/stdc++.h>
using namespace std;
long long Bruno( int N, int A[] ){
vector<int> arr1={ 90, 36, 93, 2, 4, 76, 88, 104, 131, 144, 110, 71, 134, 135, 3, 11, 19, 49, 75, 67, 55, 20, 30, 117, 23, 107, 83, 100, 119, 21, 102, 92, 106, 111, 48, 89, 128, 84, 15, 147, 99, 42, 29, 44, 130, 94, 86, 77, 74, 139, 57, 28, 125, 46, 129, 142, 138, 34, 31, 85, 13, 103, 115, 63, 81, 14, 149, 47, 26, 116, 87, 6, 95, 140, 24 } ;
vector<int> arr2={ 148, 126, 62, 58, 17, 121, 65, 91, 41, 66, 80, 133, 56, 25, 43, 145, 136, 79, 141, 12, 16, 64, 38, 10, 143, 97, 1, 8, 51, 39, 146, 118, 109, 33, 112, 54, 18, 132, 69, 5, 113, 45, 98, 68, 40, 50, 32, 9, 122, 61, 72, 60, 124, 27, 96, 114, 78, 37, 70, 127, 52, 59, 7, 123, 101, 137, 108, 22, 73, 105, 82, 53, 35, 120, 0 } ;
int lst=0;
long long x=0;
long long a[60];
a[0]=1;
for (int i = 1; i < 60; ++i)
{
a[i]=a[i-1]*2;
//cout <<a[i]<<endl;
}
for (int i = 0; i < 75; i++)
{
if(lst>59) break;
if(A[arr1[i]]==1&&A[arr2[i]]==1){
x+=a[lst];
lst++;
}else if(A[arr1[i]]==1||A[arr2[i]]==1){
lst++;
}
}
//cout <<x<<endl;
return x;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
22 ms |
2404 KB |
Output is partially correct - L* = 17 |
2 |
Partially correct |
22 ms |
2392 KB |
Output is partially correct - L* = 17 |
3 |
Partially correct |
22 ms |
2396 KB |
Output is partially correct - L* = 18 |
4 |
Partially correct |
23 ms |
2476 KB |
Output is partially correct - L* = 18 |
5 |
Partially correct |
24 ms |
2372 KB |
Output is partially correct - L* = 18 |
6 |
Partially correct |
23 ms |
2396 KB |
Output is partially correct - L* = 17 |
7 |
Partially correct |
20 ms |
2396 KB |
Output is partially correct - L* = 18 |
8 |
Partially correct |
20 ms |
2404 KB |
Output is partially correct - L* = 17 |
9 |
Partially correct |
25 ms |
2396 KB |
Output is partially correct - L* = 19 |
10 |
Partially correct |
20 ms |
2396 KB |
Output is partially correct - L* = 18 |
11 |
Partially correct |
24 ms |
2396 KB |
Output is partially correct - L* = 17 |
12 |
Partially correct |
20 ms |
2392 KB |
Output is partially correct - L* = 17 |
13 |
Partially correct |
20 ms |
2400 KB |
Output is partially correct - L* = 17 |
14 |
Partially correct |
20 ms |
2404 KB |
Output is partially correct - L* = 17 |
15 |
Partially correct |
20 ms |
2396 KB |
Output is partially correct - L* = 18 |
16 |
Partially correct |
22 ms |
2396 KB |
Output is partially correct - L* = 17 |
17 |
Partially correct |
24 ms |
2368 KB |
Output is partially correct - L* = 17 |
18 |
Partially correct |
22 ms |
2400 KB |
Output is partially correct - L* = 18 |
19 |
Partially correct |
23 ms |
2392 KB |
Output is partially correct - L* = 17 |
20 |
Partially correct |
23 ms |
2392 KB |
Output is partially correct - L* = 18 |
21 |
Partially correct |
20 ms |
2396 KB |
Output is partially correct - L* = 17 |
22 |
Partially correct |
22 ms |
2396 KB |
Output is partially correct - L* = 18 |
23 |
Partially correct |
20 ms |
2372 KB |
Output is partially correct - L* = 19 |
24 |
Partially correct |
22 ms |
2404 KB |
Output is partially correct - L* = 18 |
25 |
Partially correct |
23 ms |
2468 KB |
Output is partially correct - L* = 18 |
26 |
Partially correct |
22 ms |
2408 KB |
Output is partially correct - L* = 19 |
27 |
Partially correct |
23 ms |
2396 KB |
Output is partially correct - L* = 19 |
28 |
Partially correct |
25 ms |
2656 KB |
Output is partially correct - L* = 18 |
29 |
Partially correct |
20 ms |
2396 KB |
Output is partially correct - L* = 18 |
30 |
Partially correct |
20 ms |
2396 KB |
Output is partially correct - L* = 19 |
31 |
Partially correct |
20 ms |
2396 KB |
Output is partially correct - L* = 21 |
32 |
Partially correct |
20 ms |
2396 KB |
Output is partially correct - L* = 18 |
33 |
Partially correct |
20 ms |
2396 KB |
Output is partially correct - L* = 17 |
34 |
Partially correct |
20 ms |
2396 KB |
Output is partially correct - L* = 18 |
35 |
Partially correct |
22 ms |
2392 KB |
Output is partially correct - L* = 18 |
36 |
Partially correct |
22 ms |
2408 KB |
Output is partially correct - L* = 18 |
37 |
Partially correct |
22 ms |
2480 KB |
Output is partially correct - L* = 17 |
38 |
Partially correct |
24 ms |
2392 KB |
Output is partially correct - L* = 19 |
39 |
Partially correct |
23 ms |
2396 KB |
Output is partially correct - L* = 17 |
40 |
Partially correct |
22 ms |
2400 KB |
Output is partially correct - L* = 20 |