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

제출 #372992

#제출 시각아이디문제언어결과실행 시간메모리
372992sam571128Vepar (COCI21_vepar)C++14
70 / 70
413 ms87136 KiB
#include <bits/stdc++.h> #define int long long #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); using namespace std; const int N = 1e7+5; int isprime[N]; vector<int> primes; void init(){ fill(isprime,isprime+N,1); for(int i = 2;i < N;i++){ if(isprime[i]){ primes.push_back(i); for(int j = i*i;j < N;j += i){ isprime[j] = 0; } } } } int val(int n, int p){ int res = 0; while(n){ res += n/p; n/=p; } return res; } void solve(){ int a,b,c,d; cin >> a >> b >> c >> d; //O(psize*4log_psize(C)) for(auto x : primes){ if(val(c-1,x)+val(b,x)>val(d,x)+val(a-1,x)){ cout << "NE\n"; return; } } cout << "DA\n"; } signed main(){ fastio init(); int t; 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...