This commit is contained in:
Zengtudor 2024-10-08 17:19:40 +08:00
parent 07fbff672e
commit 09afebc7df

View File

@ -2,8 +2,7 @@
#include <algorithm> #include <algorithm>
using ull = unsigned long long; using ull = unsigned long long;
#define NV(v)#v<<" : "<<(v)
static ull t, k, n, m, ans;
static constexpr ull fact(const ull n)noexcept{ static constexpr ull fact(const ull n)noexcept{
if(n==0)return 1; if(n==0)return 1;
@ -18,7 +17,7 @@ static constexpr ull C(const ull n, const ull m)noexcept{
return fact(n)/(fact(m)*fact(n-m)); return fact(n)/(fact(m)*fact(n-m));
} }
#define NV(v)#v<<" : "<<(v) static ull t, k, n, m, ans;
int main(){ int main(){
// std::cout<<NV(fact(0))<<'\n'<<NV(fact(3))<<'\n'; // std::cout<<NV(fact(0))<<'\n'<<NV(fact(3))<<'\n';
@ -27,6 +26,7 @@ int main(){
for(ull i {0};i<t;i++){ for(ull i {0};i<t;i++){
std::cin>>n>>m; std::cin>>n>>m;
ans = 0;
for(ull i {0};i<=n;i++){ for(ull i {0};i<=n;i++){
for(ull j{0};j<=std::min(i,m);j++){ for(ull j{0};j<=std::min(i,m);j++){
if(C(i,j)%k==0)ans++; if(C(i,j)%k==0)ans++;