UVA 10219 - Find the ways !

UVA Sep 1, 2020

Problem PDF

Solution:

#include 
#include 
int main()
{
    long long n, r,i;
    long double res;
    while(scanf("%lld %lld",&n,&r)==2)
    {
        res = 0;
        for(i=n;i>n-r;i--)
            res+=log10(i);
        for(i=1;i<=r;i++)
            res-=log10(i);
        printf("%d\n",(int)floor(res)+1);
    }
    return 0;
}
https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/10219/10219.cpp

Tags

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.