标签:
Time Limit: 1000MS | Memory Limit: 30000K | |
Total Submissions: 23227 | Accepted: 5726 |
Description
Input
Output
Sample Input
5 4 1 1 0 0
Sample Output
126 2
Source
#include <cstdio> #include <cstring> #include <iostream> using namespace std; __int64 n, m; void Deal(__int64 a, __int64 b) { if(b > a - b) b = a - b; __int64 Temp = b, ans = 1; while(Temp--) { ans *= a--; while(ans % b == 0 && b > 1) { ans /= b--; } } printf("%I64d\n", ans); } int main() { while(~scanf("%I64d%I64d", &n, &m), n+m) { Deal(n+m, n); } return 0; }
标签:
原文地址:http://www.cnblogs.com/fengshun/p/4840895.html