_takumi

weird17

Apr 6th, 2021
932
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int F(int n) {
  5.     set<int> ans;
  6.     for (int i = 2; i <= sqrt(n); i++) {
  7.         if (n % i == 0) {
  8.             ans.insert(i);
  9.             n /= i;
  10.             i = 2;
  11.         }
  12.     }
  13.     return ans.size();
  14. }
  15.  
  16. int main()
  17. {
  18.     int min = 0, cnt = 0;
  19.     for (int i = 10001; i <= 50000; i++) {
  20.         if (F(i) == 3) {
  21.             if (min == 0) min = i;
  22.             cnt++;
  23.         }
  24.     }
  25.     cout << cnt << " " << min;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment