Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #include "neutrino.h"
- using namespace std;
- vector<int> v = {2, 3, 5, 7, 11, 13, 17, 19, 23};
- bool isprime(long long x)
- {
- long long sqrtx = trunc(sqrt(x));
- for (int i = 2; i <= sqrtx; i++)
- if (x % i == 0)
- return false;
- return true;
- }
- int main()
- {
- vector<bool> prime(100005, true);
- prime[0] = prime[1] = false;
- for (int i = 2; i < 100005; i++)
- if (prime[i] && i * 1ll * i < 100005)
- for (int j = i * i; j < 100005; j += i)
- prime[j] = false;
- vector<int> primes, divs;
- queue<int> q;
- for (int i = 2; i < prime.size(); i++)
- if (prime[i])
- primes.push_back(i);
- long long x = 1, y = 0, res, ans = 1;
- int n = Init();
- for (int i = 0; i < primes.size() && primes[i] <= n; i++)
- {
- if (x * primes[i] > 1e9)
- {
- res = NeutrinoFlow(x, 0);
- x = 1;
- while (!q.empty())
- {
- if (res % q.front() == 0)
- divs.push_back(q.front());
- q.pop();
- }
- }
- x *= primes[i];
- q.push(primes[i]);
- }
- if (x > 1)
- {
- res = NeutrinoFlow(x, 0);
- while (!q.empty())
- {
- if (res % q.front() == 0)
- divs.push_back(q.front());
- q.pop();
- }
- }
- for (int i = 0; i < divs.size(); i++)
- {
- x = 1;
- while (x * divs[i] <= 1e9)
- x *= divs[i];
- ans *= NeutrinoFlow(x, 0);
- }
- Locate(ans);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement