就是一个组合数而已
硬求就行。
#include <iostream>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <cmath>
#include <set>
#include <vector>
#define eps 1e-6
#define INF 1000000007
#define PI acos(-1.0)
using namespace std;
__int64 C(__int64 M, __int64 N)
{__int64 m = M - N;__int64 ans = 1;for(__int64 i = M; i >= m + 1; i--){__int64 tmp = __gcd(i, M - i + 1);ans /= (M - i + 1) / tmp;ans *= i / tmp;}return ans;
}int main()
{int sum = 0;for(int i = 1; i <= 100; i++)for(int j = 1; j <= i; j++){if(C(i, j) > 1000000){sum += i + 1 - 2 * j;break;}}cout << sum << endl;return 0;
}