Submission #61115

# Submission time Handle Problem Language Result Execution time Memory
61115 2018-07-25T08:18:01 Z 정원준(#1763) Broken Device (JOI17_broken_device) C++11
41 / 100
86 ms 3744 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<N;i++)
	{
		a[i]=0;
	}
	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

using namespace std;

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;
}
# Verdict Execution time Memory Grader output
1 Partially correct 64 ms 3312 KB Output is partially correct - L* = 15
2 Partially correct 67 ms 3312 KB Output is partially correct - L* = 15
3 Partially correct 77 ms 3504 KB Output is partially correct - L* = 15
4 Partially correct 74 ms 3552 KB Output is partially correct - L* = 15
5 Partially correct 49 ms 3552 KB Output is partially correct - L* = 15
6 Partially correct 66 ms 3552 KB Output is partially correct - L* = 15
7 Partially correct 49 ms 3712 KB Output is partially correct - L* = 15
8 Partially correct 55 ms 3712 KB Output is partially correct - L* = 15
9 Partially correct 48 ms 3712 KB Output is partially correct - L* = 15
10 Partially correct 75 ms 3720 KB Output is partially correct - L* = 15
11 Partially correct 50 ms 3720 KB Output is partially correct - L* = 15
12 Partially correct 59 ms 3720 KB Output is partially correct - L* = 15
13 Partially correct 48 ms 3736 KB Output is partially correct - L* = 15
14 Partially correct 56 ms 3736 KB Output is partially correct - L* = 15
15 Partially correct 86 ms 3736 KB Output is partially correct - L* = 15
16 Partially correct 75 ms 3736 KB Output is partially correct - L* = 15
17 Partially correct 59 ms 3744 KB Output is partially correct - L* = 15
18 Partially correct 53 ms 3744 KB Output is partially correct - L* = 15
19 Partially correct 54 ms 3744 KB Output is partially correct - L* = 15
20 Partially correct 49 ms 3744 KB Output is partially correct - L* = 15
21 Partially correct 53 ms 3744 KB Output is partially correct - L* = 15
22 Partially correct 73 ms 3744 KB Output is partially correct - L* = 15
23 Partially correct 59 ms 3744 KB Output is partially correct - L* = 15
24 Partially correct 51 ms 3744 KB Output is partially correct - L* = 15
25 Partially correct 60 ms 3744 KB Output is partially correct - L* = 15
26 Partially correct 49 ms 3744 KB Output is partially correct - L* = 15
27 Partially correct 54 ms 3744 KB Output is partially correct - L* = 15
28 Partially correct 71 ms 3744 KB Output is partially correct - L* = 15
29 Partially correct 50 ms 3744 KB Output is partially correct - L* = 15
30 Partially correct 48 ms 3744 KB Output is partially correct - L* = 15
31 Partially correct 46 ms 3744 KB Output is partially correct - L* = 15
32 Partially correct 60 ms 3744 KB Output is partially correct - L* = 15
33 Partially correct 78 ms 3744 KB Output is partially correct - L* = 15
34 Partially correct 74 ms 3744 KB Output is partially correct - L* = 15
35 Partially correct 48 ms 3744 KB Output is partially correct - L* = 15
36 Partially correct 55 ms 3744 KB Output is partially correct - L* = 15
37 Partially correct 48 ms 3744 KB Output is partially correct - L* = 15
38 Partially correct 47 ms 3744 KB Output is partially correct - L* = 15
39 Partially correct 61 ms 3744 KB Output is partially correct - L* = 15
40 Partially correct 51 ms 3744 KB Output is partially correct - L* = 15