The second ACM College Student Program Design competition in Shandong province D

Source: Internet
Author: User

Number of combinations:

AC Code:

#include <iostream>#include<cstdio>#include<cstring>using namespacestd;intc[1010][1010];intMain () {intT, N, K;  for(inti =0; I <1001; i++) c[i][0] =1;  for(inti =1; I <1001; i++)    {         for(intj =1; J <1001; J + +) {C[i][j]= (C[i-1][j-1] + c[i-1][J])%10000003; }} scanf ("%d", &t);  while(t--) {scanf ("%d%d", &n, &k); printf ("%d\n", C[n][k]); }    return 0;}/************************************** problem id:sdut OJ D User name:xam140325 Choru Result: Accepted take memory:4464k take time:20ms Submit time:2016-05-02 15:01:57 ******************* *******************/

The second ACM College Student Program Design competition in Shandong province D

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.