Codeforces 588B. Duff in Love Solution

  1. Solve in C++:
  2. ///**********ALLAH IS ALMIGHTY************///
  3. ///AH Tonmoy
  4. ///Department of CSE,23rd batch
  5. ///Islamic University,Bangladesh
  6. #include<iostream>
  7. #include<math.h>
  8. using namespace std;
  9. int main()
  10. {
  11.  
  12. long long int n,i;
  13. while(cin>>n)
  14. {
  15. for(i=2; i*i<=n; i++)
  16. {
  17. while(n%(i*i)==0)
  18. {
  19. n=n/i;
  20. }
  21. }
  22. cout<<n<<endl;
  23. }
  24.  
  25.  
  26. }

No comments

Most View Post

Recent post

Codeforces Round 925 (Div. 3) 1931D. Divisible Pairs Solution

    Problem Link  :   https://codeforces.com/contest/1931/problem/D S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. ...

Powered by Blogger.