Submission #20051

# Submission time Handle Problem Language Result Execution time Memory
20051 2016-02-25T08:53:43 Z ilbbke 동전 (kriii4_E) C++
0 / 100
0 ms 1084 KB
#include<stdio.h>

int n,arr[255];
long long ans=1;

void back(int x,int c,int w)
{
	int i,j;
	if(c>0 && c%2==0) ans++;
	for(i=w;i<=n;i++){
		if(i+x-1>n) break;
		if(arr[i-1]) continue;
		for(j=i;j<i+x;j++){
			if(arr[j]) break;
		}
		if(j!=i+x) continue;
		for(j=i;j<i+x;j++) arr[j]=1;
		back(x,c+1,i+x);
		for(j=i;j<i+x;j++) arr[j]=0;
	}
}

int main()
{
	scanf("%d",&n);
	int i;
	for(i=1;i<=n/2;i++){
		back(i,0,1);
	}
	printf("%lld",ans);
	return 0;
}
/*
#include<stdio.h>
#define M 1000000007

long long dy[1000005];

int main()
{
  int i,n,k;
  scanf("%d %d",&n,&k);
  dy[1]=1; dy[2]=2;
  for(i=3;i<=n;i++)
  {
    dy[i]=(dy[i-1]+dy[i-2])%M;
  }
  printf("%lld",dy[n]);
  return 0;
}
*/
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1084 KB Output is correct
2 Correct 0 ms 1084 KB Output is correct
3 Correct 0 ms 1084 KB Output is correct
4 Correct 0 ms 1084 KB Output is correct
5 Correct 0 ms 1084 KB Output is correct
6 Correct 0 ms 1084 KB Output is correct
7 Correct 0 ms 1084 KB Output is correct
8 Incorrect 0 ms 1084 KB Output isn't correct
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -