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

#TimeUsernameProblemLanguageResultExecution timeMemory
541503AlperenTVepar (COCI21_vepar)C++17
70 / 70
250 ms14352 KiB
#include <bits/stdc++.h> using namespace std; const int N = 1e7 + 5; long long t, a, b, c, d, cnt1, cnt2; bool isprime[N]; vector<int> primes; void precalc(){ fill(isprime + 2, isprime + N, true); for(int i = 2; i * i < N; i++){ if(isprime[i]){ for(int j = i * i; j < N; j += i) isprime[j] = false; } } for(int i = 2; i < N; i++) if(isprime[i]) primes.push_back(i); } long long findexp(int n, int x){ long long cnt = 0; while(n > 0){ cnt += n / x; n /= x; } return cnt; } void solve(){ cin >> a >> b >> c >> d; for(auto p : primes){ cnt1 = findexp(b, p) - findexp(a - 1, p); cnt2 = findexp(d, p) - findexp(c - 1, p); if(cnt1 > cnt2){ cout << "NE\n"; return; } } cout << "DA\n"; } int main(){ ios_base::sync_with_stdio(false);cin.tie(NULL); precalc(); cin >> t; while(t--){ solve(); } }
#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...