Dang_Quan_10_Tin

BAI1 HSGHN L12 V1 2019-2020

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