ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1055. Combinations

help me!!!!!!
Posted by ooo 14 Dec 2008 16:08
#include <iostream.h>
int main()
{int N,M,C=1,a[50000],b[50000],c[50000],d[50000],j=0,k,s=0,i;
cin>>N>>M;
for(i=1; i<=N; i++) a[i]=i;
for(i=1; i<=M; i++) b[i]=i;
for(i=1; i<=(N-M); i++) c[i]=i;
for(i=M+1; i<=N; i++) b[i]=1;
for(i=N-M+1; i<=N; i++) c[i]=1;
for(i=1; i<=N; i++) C*=a[i]/(b[i]*c[i]);
for(i=2; i<=C/2; i++)
if(C%i==0) d[j++]=i;
for(i=0; i<=j; i++)
for(k=2; k<=d[i]/2; k++)
if(d[i]%k==0) continue;
else s++;
cout<<s; return 0; }