We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Getting WA for the Test Case #3. Anyone has any clue?
unsignedlonglongintcombinations[1001],t,i,j,n;#define MOD 1000000007intmain(){combinations[1001]={0};combinations[0]=1;for(i=1;i<1000;i++)for(j=i;j<=1000;j++)combinations[j]+=(combinations[j-i]%MOD);scanf("%lld",&t);for(i=1;i<=t;i++){scanf("%lld",&n);printf("%lld\n",(combinations[n]%MOD)-1);}return0;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #76: Counting summations
You are viewing a single comment's thread. Return to all comments →
Getting WA for the Test Case #3. Anyone has any clue?