Submission #497973

# Submission time Handle Problem Language Result Execution time Memory
497973 2021-12-24T07:11:45 Z abc864197532 Vepar (COCI21_vepar) C++17
10 / 70
616 ms 78672 KB
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pii pair <int, int>
#define X first
#define Y second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
void abc() {cout << endl;}
template <typename T, typename ...U> void abc(T a, U ...b) {
    cout << a << ' ', abc(b...);
}
template <typename T> void printv(T l, T r) {
    while (l != r) cout << *l << " \n"[++l == r];
}
template <typename A, typename B> istream& operator >> (istream& o, pair<A, B> &a) {
    return o >> a.X >> a.Y;
}
template <typename A, typename B> ostream& operator << (ostream& o, pair<A, B> a) {
    return o << '(' << a.X << ", " << a.Y << ')';
}
template <typename T> ostream& operator << (ostream& o, vector<T> a) {
    if (a.empty())
        return o << "{}";
    bool is = false;
    for (T i : a) {o << (is ? ' ' : '{'), is = true, o << i;}
    return o << '}';
}
template <typename T> struct vv : vector <vector <T>> {
    vv(int n, int m, T v) : vector <vector <T>> (n, vector <T>(m, v)) {}
    vv() {}
};
template <typename T> struct vvv : vector <vv <T>> {
    vvv(int n, int m, int k, T v) : vector <vv <T>> (n, vv <T>(m, k, v)) {}
    vvv() {}
};
#ifdef Doludu
#define test(args...) abc("[" + string(#args) + "]", args)
#define owo freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout)
#else
#define test(args...) void(0)
#define owo ios::sync_with_stdio(false); cin.tie(0)
#endif
const int mod = 1e9 + 7, N = 10000010, logN = 17, K = sqrt(N) + 87, M = N * 40;

int lp[N], cur[N];

int main () {
    owo;
    iota(lp, lp + N, 0);
    for (int i = 2; i < N; ++i) if (lp[i] == i) {
        for (int j = i + i; j < N; j += i) if (lp[j] == j) {
            lp[j] = i;
        }
    }
    int t;
    cin >> t;
    while (t--) {
        fill(cur, cur + N, 0);
        int a, b, c, d;
        cin >> a >> b >> c >> d;
        for (int i = 2; i < N; ++i) if (lp[i] == i) {
            int now = i;
            while (now < N) {
                cur[i] -= b / now - (a - 1) / now;
                cur[i] += d / now - (c - 1) / now;
                now *= i;
            }
        }
        bool is = true;
        for (int i = 2; i < N; ++i) if (cur[i] < 0) {
            is = false;
            break;
        }
        cout << (is ? "DA\n" : "NE\n");
    }
}
# Verdict Execution time Memory Grader output
1 Correct 530 ms 78572 KB Output is correct
2 Correct 616 ms 78568 KB Output is correct
3 Correct 530 ms 78532 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 557 ms 78564 KB Output is correct
2 Incorrect 505 ms 78672 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 523 ms 78572 KB Output is correct
2 Incorrect 562 ms 78604 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 508 ms 78564 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 507 ms 78564 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 512 ms 78572 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 518 ms 78568 KB Output isn't correct
2 Halted 0 ms 0 KB -