Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int F(int n) {
- set<int> ans;
- for (int i = 2; i <= sqrt(n); i++) {
- if (n % i == 0) {
- ans.insert(i);
- n /= i;
- i = 2;
- }
- }
- return ans.size();
- }
- int main()
- {
- int min = 0, cnt = 0;
- for (int i = 10001; i <= 50000; i++) {
- if (F(i) == 3) {
- if (min == 0) min = i;
- cnt++;
- }
- }
- cout << cnt << " " << min;
- }
Advertisement
Add Comment
Please, Sign In to add comment