#include "Annalib.h"
#include <bits/stdc++.h>
#define L long long
using namespace std;
void Set(int,int);
int a[150];
void Anna(int N,L X,int K,int P[]){
int i;
for(i=0;i<K;i++)
{
a[P[i]]=-1;
}
for(i=0;i<N/2;i++)
{
if(a[i]!=-1&&a[N-i-1]!=-1)
{
a[i]=a[N-i-1]=1;
}
}
for(i=0;i<N/2;i++)
{
if(a[i]==1)
{
if(X%2) a[i]=0;
X/=2;
}
}
for(i=0;i<N;i++)
{
if(a[i]==1) Set(i,1);
else Set(i,0);
}
}
/*
int p[100010];
int aa[100010];
void Set(int loc,int val){
aa[loc]=val;
}
L Bruno(int N,int A[]){
L ret=0,i,bit=1;
for(i=0;i<N/2;i++)
{
if(A[N-i-1])
{
ret+=bit*(1-A[i]);
bit<<=1;
}
}
return ret;
}
int main()
{
L n,k,x;
scanf("%lld %lld %lld",&n,&k,&x);
for(int i=0;i<k;i++)
{
scanf("%lld",&p[i]);
}
Anna(n,x,k,p);
for(int i=0;i<n;i++)
{
printf("%d ",aa[i]);
}
puts("");
printf("%lld ",Bruno(n,aa));
}
//*/
#include "Brunolib.h"
#include <bits/stdc++.h>
#define L long long
L Bruno(int N,int A[]){
L ret=0,i,bit=1;
for(i=0;i<N/2;i++)
{
if(A[N-i-1])
{
ret+=bit*(1-A[i]);
bit<<=1;
}
}
return ret;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
58 ms |
2800 KB |
Output isn't correct - L* = 0 |
2 |
Incorrect |
44 ms |
3208 KB |
Output isn't correct - L* = 0 |
3 |
Incorrect |
45 ms |
3208 KB |
Output isn't correct - L* = 0 |
4 |
Incorrect |
54 ms |
3256 KB |
Output isn't correct - L* = 0 |
5 |
Incorrect |
76 ms |
3416 KB |
Output isn't correct - L* = 0 |
6 |
Incorrect |
44 ms |
3416 KB |
Output isn't correct - L* = 0 |
7 |
Incorrect |
63 ms |
3416 KB |
Output isn't correct - L* = 0 |
8 |
Incorrect |
66 ms |
3424 KB |
Output isn't correct - L* = 0 |
9 |
Incorrect |
50 ms |
3424 KB |
Output isn't correct - L* = 0 |
10 |
Incorrect |
52 ms |
3456 KB |
Output isn't correct - L* = 0 |
11 |
Incorrect |
67 ms |
3456 KB |
Output isn't correct - L* = 0 |
12 |
Incorrect |
50 ms |
3520 KB |
Output isn't correct - L* = 0 |
13 |
Incorrect |
50 ms |
3520 KB |
Output isn't correct - L* = 0 |
14 |
Incorrect |
69 ms |
3520 KB |
Output isn't correct - L* = 0 |
15 |
Incorrect |
58 ms |
3520 KB |
Output isn't correct - L* = 0 |
16 |
Incorrect |
77 ms |
3520 KB |
Output isn't correct - L* = 0 |
17 |
Incorrect |
61 ms |
3520 KB |
Output isn't correct - L* = 0 |
18 |
Incorrect |
75 ms |
3648 KB |
Output isn't correct - L* = 0 |
19 |
Incorrect |
55 ms |
3648 KB |
Output isn't correct - L* = 0 |
20 |
Incorrect |
64 ms |
3648 KB |
Output isn't correct - L* = 0 |
21 |
Incorrect |
51 ms |
3712 KB |
Output isn't correct - L* = 0 |
22 |
Incorrect |
50 ms |
3712 KB |
Output isn't correct - L* = 0 |
23 |
Incorrect |
69 ms |
3712 KB |
Output isn't correct - L* = 0 |
24 |
Incorrect |
66 ms |
3712 KB |
Output isn't correct - L* = 0 |
25 |
Incorrect |
52 ms |
3712 KB |
Output isn't correct - L* = 0 |
26 |
Incorrect |
56 ms |
3712 KB |
Output isn't correct - L* = 0 |
27 |
Incorrect |
44 ms |
3712 KB |
Output isn't correct - L* = 0 |
28 |
Incorrect |
60 ms |
3712 KB |
Output isn't correct - L* = 0 |
29 |
Incorrect |
45 ms |
3712 KB |
Output isn't correct - L* = 0 |
30 |
Incorrect |
63 ms |
3720 KB |
Output isn't correct - L* = 0 |
31 |
Incorrect |
62 ms |
3720 KB |
Output isn't correct - L* = 0 |
32 |
Incorrect |
75 ms |
3720 KB |
Output isn't correct - L* = 0 |
33 |
Incorrect |
68 ms |
3720 KB |
Output isn't correct - L* = 0 |
34 |
Incorrect |
73 ms |
3720 KB |
Output isn't correct - L* = 0 |
35 |
Incorrect |
62 ms |
3720 KB |
Output isn't correct - L* = 0 |
36 |
Incorrect |
41 ms |
3720 KB |
Output isn't correct - L* = 0 |
37 |
Incorrect |
51 ms |
3720 KB |
Output isn't correct - L* = 0 |
38 |
Incorrect |
47 ms |
3720 KB |
Output isn't correct - L* = 0 |
39 |
Incorrect |
59 ms |
3720 KB |
Output isn't correct - L* = 0 |
40 |
Incorrect |
47 ms |
3720 KB |
Output isn't correct - L* = 0 |