Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- long long int n,r,k,i,j,a,b,c;
- double ans=0.0;
- while(cin>>n>>r)
- {
- a=min(r,n-r);
- ans=0.0;
- b=n-a+1;
- for(i=b;i<=n;i++)
- ans+=log10(i);
- for(i=1;i<=a;i++)
- ans-=log10(i);
- ans=floor(ans)+1;
- cout<<ans<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement