D - Staircase Sequences
思路:
代码如下
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll n, ans = 0;
cin >> n;
while (n % 2 == 0)
n /= 2;
for (ll i = 1; i * i <= n; i ++)
{
if (n % i == 0)
{
if (i % 2 == 1)
ans++;
if (i * i != n && (n / i) % 2 == 1)
ans++;
}
}
ans *= 2;
cout << ans << endl;
}