(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.

제출 #388334

#제출 시각아이디문제언어결과실행 시간메모리
388334phathnvVepar (COCI21_vepar)C++11
70 / 70
318 ms43812 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e7 + 7; int p[N]; vector<int> primes; int Calc(int x, int factor){ int res = 0; while (x >= factor) res += (x /= factor); return res; } int Calc(int l, int r, int factor){ return Calc(r, factor) - Calc(l - 1, factor); } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); for(int i = 2; i < N; i++){ if (p[i]) continue; primes.push_back(i); for(int j = i; j < N; j += i) p[j] = i; } int t; cin >> t; while (t--){ int a, b, c, d; cin >> a >> b >> c >> d; bool stop = 0; for(int factor : primes) if (Calc(c, d, factor) < Calc(a, b, factor)){ cout << "NE\n"; stop = 1; break; } if (!stop) cout << "DA\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...