同余与模运算

root 站长 2019-08-18 18:47:02 3

{{ vote && vote.total.up }}

共 4 条回复

yehongchen

#include <bits/stdc++.h> using namespace std; long long int a[2001][2001]; const int N = 100003; int main() { freopen("A.in", "r", stdin); freopen("A.out", "w", stdout); int n, m, x, k; cin >> n >> m >> k >> x; for (int i = 0; i <= 1000; i++) { for (int j = 0; j <= i; j++) { if (j == 0 || i == j) { a[i][j] = 1; } else { a[i][j] = (a[i - 1][j] + a[i - 1][j - 1]) % N; } } } // for(int i=0;i<=5;i++){ // for(int j=0;j<=i;j++){ // cout<<a[i][j]<<" "; // } // cout<<'\n'; // } // cout<<a[m][x]<<endl; // cout<<a[n][k-x]<<endl; cout << (a[m][x] * a[n][k - x]) % N; return 0; }

guanyuxun

yyds

guanyuxun

hhhhhh

guanyuxun