Advertisement
tuki2501

equation.cpp

Feb 23rd, 2022
660
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. typedef long long ll;
  5.  
  6. signed main() {
  7.   cin.tie(0)->sync_with_stdio(0);
  8.   int n; cin >> n;
  9.   int ans = 0;
  10.   for (int i = 1; i * i <= n + 1; i++) {
  11.     if ((n + 1) % i == 0) {
  12.       ans++;
  13.       if ((n + 1) / i != i) ans++;
  14.     }
  15.   }
  16.   cout << ans << '\n';
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement