답안 #61107

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
61107 2018-07-25T08:10:42 Z 정원준(#1763) Broken Device (JOI17_broken_device) C++11
0 / 100
86 ms 3880 KB
#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*=2;
		}
	}
	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 53 ms 3056 KB Output isn't correct - L* = 0
2 Incorrect 45 ms 3200 KB Output isn't correct - L* = 0
3 Incorrect 47 ms 3504 KB Output isn't correct - L* = 0
4 Incorrect 53 ms 3504 KB Output isn't correct - L* = 0
5 Incorrect 64 ms 3584 KB Output isn't correct - L* = 0
6 Incorrect 45 ms 3584 KB Output isn't correct - L* = 0
7 Incorrect 63 ms 3584 KB Output isn't correct - L* = 0
8 Incorrect 53 ms 3584 KB Output isn't correct - L* = 0
9 Incorrect 52 ms 3584 KB Output isn't correct - L* = 0
10 Incorrect 71 ms 3584 KB Output isn't correct - L* = 0
11 Incorrect 56 ms 3584 KB Output isn't correct - L* = 0
12 Incorrect 54 ms 3584 KB Output isn't correct - L* = 0
13 Incorrect 47 ms 3584 KB Output isn't correct - L* = 0
14 Incorrect 53 ms 3712 KB Output isn't correct - L* = 0
15 Incorrect 59 ms 3712 KB Output isn't correct - L* = 0
16 Incorrect 48 ms 3712 KB Output isn't correct - L* = 0
17 Incorrect 52 ms 3712 KB Output isn't correct - L* = 0
18 Incorrect 60 ms 3712 KB Output isn't correct - L* = 0
19 Incorrect 61 ms 3712 KB Output isn't correct - L* = 0
20 Incorrect 63 ms 3712 KB Output isn't correct - L* = 0
21 Incorrect 50 ms 3712 KB Output isn't correct - L* = 0
22 Incorrect 59 ms 3712 KB Output isn't correct - L* = 0
23 Incorrect 69 ms 3712 KB Output isn't correct - L* = 0
24 Incorrect 71 ms 3712 KB Output isn't correct - L* = 0
25 Incorrect 61 ms 3712 KB Output isn't correct - L* = 0
26 Incorrect 51 ms 3880 KB Output isn't correct - L* = 0
27 Incorrect 48 ms 3880 KB Output isn't correct - L* = 0
28 Incorrect 86 ms 3880 KB Output isn't correct - L* = 0
29 Incorrect 50 ms 3880 KB Output isn't correct - L* = 0
30 Incorrect 48 ms 3880 KB Output isn't correct - L* = 0
31 Incorrect 50 ms 3880 KB Output isn't correct - L* = 0
32 Incorrect 61 ms 3880 KB Output isn't correct - L* = 0
33 Incorrect 82 ms 3880 KB Output isn't correct - L* = 0
34 Incorrect 65 ms 3880 KB Output isn't correct - L* = 0
35 Incorrect 48 ms 3880 KB Output isn't correct - L* = 0
36 Incorrect 46 ms 3880 KB Output isn't correct - L* = 0
37 Incorrect 51 ms 3880 KB Output isn't correct - L* = 0
38 Incorrect 47 ms 3880 KB Output isn't correct - L* = 0
39 Incorrect 51 ms 3880 KB Output isn't correct - L* = 0
40 Incorrect 54 ms 3880 KB Output isn't correct - L* = 0