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

제출 #373823

#제출 시각아이디문제언어결과실행 시간메모리
373823NimbostratusVepar (COCI21_vepar)C++17
70 / 70
320 ms14568 KiB
#include <bits/stdc++.h> using namespace std; #define pb push_back #define ub upper_bound #define lb lower_bound #define clean(a,s) memset((a),0,sizeof((a)[0])*(s)) #define all(x) (x).begin() , (x).end() #define fi first #define se second #define int int using pii = pair<int,int>; using ll = long long; const int maxn = 1e7+5; const int inf = 2e9; const int mod = 1e9+7; int t,a,b,c,d; vector<int> prime; bool composite[maxn]; int count(int x,int p) { int cnt = 0; int cur = 1; while(cur <= x/p) { cur *= p; cnt += x/cur; } return cnt; } int32_t main () { //freopen("in","r",stdin); freopen("out","w",stdout); ios_base::sync_with_stdio(0); cout.tie(0); cin.tie(0); for(int i=2;i<=maxn-5;i++) { if(composite[i]) continue; prime.pb(i); for(ll j=1ll*i*i;j<=maxn-5;j+=i) composite[j] = true; } cin >> t; while(t--) { cin >> a >> b >> c >> d; bool ans = true; for(int p : prime) { if(count(b,p)-count(a-1,p) > count(d,p)-count(c-1,p)) { ans = false; break; } } cout << (ans ? "DA" : "NE") << endl; } }
#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...