# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
381899 | topovik | Vepar (COCI21_vepar) | C++14 | 199 ms | 43912 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include <chrono>
#define f first
#define s second
#define pb push_back
using namespace std;
typedef long long ll;
typedef long double ld;
const int N = 1e7 + 10;
int l[N];
vector <int> pr;
ll Time()
{
return chrono::system_clock().now().time_since_epoch().count();
}
mt19937 rnd(Time());
int sum(int x, int y)
{
if (x < y) return 0;
else return (x / y) + sum(x / y, y);
}
int main()
{
for (register int i = 2; i < N; i++)
{
if (l[i] == 0)
{
l[i] = i;
pr.pb(i);
}
for (register int j = 0; pr[j] <= l[i] && pr[j] * i < N; j++) l[pr[j] * i] = pr[j];
}
int t;
cin >> t;
while (t--)
{
int l, r, l1, r1;
cin >> l >> r >> l1 >> r1;
bool g = 1;
for (int i = 0; i < pr.size(); i++) g = g && (sum(r1, pr[i]) - sum(l1 - 1, pr[i])) >= (sum(r, pr[i]) - sum(l - 1, pr[i]));
cout << (g ? "DA" : "NE") << endl;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |