(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #515543

#TimeUsernameProblemLanguageResultExecution timeMemory
515543KoDVepar (COCI21_vepar)C++17
70 / 70
341 ms14432 KiB
#include <bits/stdc++.h> using std::vector; using std::array; using std::pair; using std::tuple; int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); const int MAX = 10000000; vector<char> is_prime(MAX + 1, true); is_prime[0] = is_prime[1] = false; vector<int> prime; for (int i = 2; i <= MAX; ++i) { if (is_prime[i]) { prime.push_back(i); for (int j = i + i; j <= MAX; j += i) { is_prime[j] = false; } } } const auto count = [&](int x, int p) { int ret = 0; while (x > 0) { ret += x /= p; } return ret; }; int T; std::cin >> T; while (T--) { int a, b, c, d; std::cin >> a >> b >> c >> d; a -= 1, c -= 1; bool f = true; for (const int p : prime) { if (count(b, p) - count(a, p) > count(d, p) - count(c, p)) { f = false; break; } } std::cout << (f ? "DA" : "NE") << '\n'; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...