# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
483428 | rainboy | Vepar (COCI21_vepar) | C11 | 150 ms | 12744 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 <stdio.h>
#define A 10000000
int pp[A], n;
void init() {
static char composite[A + 1];
int a, b;
for (a = 2; a <= A; a++) {
if (composite[a])
continue;
pp[n++] = a;
for (b = a + a; b <= A; b += a)
composite[b] = 1;
}
}
int count(int a, int p) {
return a < p ? 0 : count(a / p, p) + a / p;
}
int main() {
int t;
init();
scanf("%d", &t);
while (t--) {
int a, b, c, d, i, da;
scanf("%d%d%d%d", &a, &b, &c, &d);
da = 1;
for (i = 0; i < n; i++)
if (count(b, pp[i]) - count(a - 1, pp[i]) > count(d, pp[i]) - count(c - 1, pp[i])) {
da = 0;
break;
}
printf(da ? "DA\n" : "NE\n");
}
return 0;
}
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... |