top of page

소스 코드 제출

공개·회원 71명

20250418

#include <stdio.h>

int memo[10001] = {0,1,2, };

int cou(int n,int m)

{

if(memo[n]!=0)

{

return memo[n];

}

m++;

return memo[m]=cou(n-1,m)%10000007+cou(n-2,m)%100000007;

}

int main()

{

int n,m = 2,k;

scanf("%d",&n);

if(n==1)

{

printf("1");

return 0;

}

if(n==2)

{

printf("2");

return 0;

}

k=cou(n,m);

k=k%100000007;

printf("%d",k);

return 0;

}

3회 조회
주소 : 경기도 용인시 광교중앙로 302 블루 스퀘어 602호
연락처 : 031) 216 - 1546 ,     031) 215 - 1546
사업자등록번호 : 465-92-00916
​학원 등록 제 4603호
bottom of page