hiho week 168 register

Ended

Participants:818

Verdict:Accepted
Score:100 / 100
Submitted:2017-09-23 19:10:56

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include<iostream>
using namespace std;
int calc(int n) {
        if (n == 0) return 1;
        if (n % 2 == 0) return calc(n / 2) + calc(n / 2 - 1);
        return calc(n / 2);
}
int main() {
        int n;
        cin >> n;
        cout << calc(n) << endl;
        return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX