标签:hdu2519 新生晚会
5 3 2 5 3 4 4 3 6 8 0
3 10 1 0 1
#include<stdio.h> main() { __int64 n, m, i, s, t; while ( scanf ( "%I64d", &t ) != EOF ) { while ( t-- ) { scanf ( "%I64d%I64d", &n, &m ); s = 1; if ( n < m ) s = 0; else if ( m == 0 ) s = 1; else { if ( m > n / 2 ) m = n - m; for ( i = 1; i <= m; i++ ) { s *= ( n - i + 1 ); s /= i; } } printf ( "%I64d\n", s ); } } }
标签:hdu2519 新生晚会
原文地址:http://blog.csdn.net/acm_baihuzi/article/details/41791275