Dang_Quan_10_Tin

CBH TS10 Da Nang 2017-2018

Jan 7th, 2022
843
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #define task "CBH"
  2.  
  3. #include <iostream>
  4. #include <cstdio>
  5.  
  6. using namespace std;
  7.  
  8. using ll = long long;
  9. using ld = long double;
  10.  
  11. constexpr int N = 1e5 + 5;
  12. ll x;
  13.  
  14. void Read()
  15. {
  16.     cin >> x;
  17. }
  18.  
  19. void Solve()
  20. {
  21.     ll ans = 1;
  22.  
  23.     for (ll i = 1; i * i <= x; ++i)
  24.         if (x % (i * i) == 0)
  25.             ans = i;
  26.  
  27.     cout << ans;
  28. }
  29.  
  30. int32_t main()
  31. {
  32.     ios::sync_with_stdio(0);
  33.     cin.tie(0);
  34.     cout.tie(0);
  35.     if (fopen(task ".INP", "r"))
  36.     {
  37.         freopen(task ".INP", "r", stdin);
  38.         freopen(task ".OUT", "w", stdout);
  39.     }
  40.  
  41.     Read();
  42.     Solve();
  43. }
  44.  
Advertisement
Add Comment
Please, Sign In to add comment