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

#TimeUsernameProblemLanguageResultExecution timeMemory
418811ChaskaVepar (COCI21_vepar)C++11
70 / 70
343 ms14392 KiB
#include <bits/stdc++.h> using namespace std; const int N = 1e7+6; int t,a,b,c,d; bool vs[N]; vector<int> primes; void precalc() { for (int i=2;i<=10000000;i++) { if (!vs[i]) { primes.push_back(i); for (int j=i;j<=10000000;j+=i) { vs[j] = true; } } } return; } int calc(int u,int v) { int k = 0; while (u) { k += u/v; u /= v; } return k; } int main() { precalc(); cin >> t; while (t--) { cin >> a >> b >> c >> d; a--; c--; bool y = true; for (int u : primes) { int p1,p4,p2,p3; p1 = calc(a,u); p2 = calc(b,u); p3 = calc(c,u); p4 = calc(d,u); p2 -= p1; p4 -= p3; if (p2>p4) y = false; } if(y) cout << "DA\n"; else cout <<"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...