hiho week 168 register

Ended

Participants:818

Verdict:Accepted
Score:100 / 100
Submitted:2017-09-17 10:42:10

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include<cstdio>
int cnt(int n)
{
    if(n==0 || n==1) return 1;
    
    if(n%2) return cnt((n-1)/2);
    else return cnt(n/2)+cnt(n/2-1);
}
int main()
{
    int n;
    scanf("%d",&n);
    printf("%d\n",cnt(n));
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX