(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 #808743

#TimeUsernameProblemLanguageResultExecution timeMemory
808743Tunglam07Vepar (COCI21_vepar)C++17
70 / 70
206 ms18564 KiB
#include<bits/stdc++.h> using namespace std; long long t, a, b, c, d, s, s1; bool chk[10000001]; vector<long long> prim; long long sol(long long v,long long k) { long long ans = 0; while (v) { ans += v/k; v /= k; } return ans; } void findprime() { for(int i = 2; i <= 10000000; i++) { if(!chk[i]) { prim.push_back(i); for(int j = i * 2; j <= 10000000; j += i) { chk[j] = 1; } } } } int main() { ios::sync_with_stdio (0); cin.tie (0); cout.tie (0); findprime(); cin >> t; while(t--) { cin >> a >> b >> c >> d; bool ck = 0; for (int v : prim) { if (sol(b, v) - sol(a - 1, v) > sol(d, v) - sol(c - 1, v)) { ck = 1; break; } } if(!ck) { cout << "DA" << endl; } else { cout << "NE" << endl; } } }
#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...