注意到答案为 喵~
#include <cmath>
#include <iostream>
using namespace std;
using ll = long long;
const int MOD = 1e9 + 7;
ll Pow(ll a, int b) {
ll res = 1;
while (b) {
if (b & 1) {
res = res * a % MOD;
}
a = a * a % MOD;
b >>= 1;
}
return res;
}
ll Inv(ll a) {
return Pow(a, MOD - 2);
}
int n;
int x;
int cs;
void Solve() {
cin >> n >> x;
cs = sqrt(x + 0.5);
if (n > cs) {
cout << '0';
return;
}
ll zi = 1;
ll mu = 1;
for (int i = cs; i > cs - n; i--) {
zi = zi * i % MOD;
}
for (int i = n; i > 1; i--) {
mu = mu * i % MOD;
}
cout << zi* Inv(mu) % MOD;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
Solve();
}
// 64 位输出请用 printf("%lld")

京公网安备 11010502036488号