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

제출 #872984

#제출 시각아이디문제언어결과실행 시간메모리
872984aegVepar (COCI21_vepar)C++17
30 / 70
80 ms16076 KiB
#include <iostream> #include <vector> using namespace std; #define PB push_back const int maxn = 1e7 + 5; bool prime[maxn]; vector<int> primes; inline int szfact (int a, int p){ int ret = 0; for(int i=p; i<=a; i*=p) { ret += a/i; } return ret; } inline void solve() { int a,b,c,d; cin >> a >> b >> c >> d; for(auto p:primes) { if(szfact(b,p)-szfact(a-1,p)>szfact(d,p)-szfact(c-1,p)) { cout << "NE\n"; return; } } cout << "DA\n"; } int main() { cin.tie(NULL)->sync_with_stdio(false); int t; cin >> t; for(int i=2; i<maxn; i++) { if(prime[i]) continue; for(int j=i*2; j<=1e7+1; j+=i) prime[j] = true; primes.PB(i); } 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...