update
This commit is contained in:
parent
84d0f094d8
commit
3ec610d927
@ -11,7 +11,7 @@ static void init(){
|
||||
c[0][0] = c[1][0] = c[1][1] = 1;
|
||||
for(ull i {2};i<max_n;i++){
|
||||
c[i][0]=1;
|
||||
for(ull j{1};j<max_n;j++){
|
||||
for(ull j{1};j<=i;j++){
|
||||
c[i][j] = (c[i-1][j-1] + c[i-1][j])%k;
|
||||
}
|
||||
}
|
||||
@ -21,13 +21,18 @@ static void init(){
|
||||
}
|
||||
prefix[i][i+1] = prefix[i][i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define NV(v)#v<<" : "<<(v)
|
||||
|
||||
int main(){
|
||||
std::cin>>t>>k;
|
||||
std::cout<<NV(t)<<'\n'<<NV(k)<<'\n';
|
||||
init();
|
||||
for(ull i {0};i<t;i++){
|
||||
std::cout<<NV(t)<<'\n'<<NV(k)<<'\n';
|
||||
std::cin>>n>>m;
|
||||
std::cout<<"test\n";
|
||||
m = std::min(m,n);
|
||||
std::cout<<(prefix[n][m])<<'\n';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user