Advertisement
rotti321

jucarii

Oct 20th, 2017
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. typedef unsigned long long ull;
  5. ull n,m;
  6.  
  7. ull produs(ull a,ull b){
  8. ull p=1;
  9. for(ull i=a;i<=b;i++){
  10. p=(p*i)%224737;
  11. }
  12. return p;
  13. }
  14.  
  15. int main()
  16. {
  17. ull f1,f2,dif,k; ///k - copii, n - jucarii
  18. cin>>k>>n; ///A(n,k)
  19. dif=n-k+1;
  20. if(k>n) {
  21. cout<<0;
  22. return 0;
  23. }
  24. ///f1=produs(dif,n);
  25. ///f2=fact(n-m);
  26. ///cout<<f1<<endl<<f2;
  27. cout<<produs(dif,n);;
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement