This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define int long long
using namespace std;
int count(int n, int p){
int c = 0;
while(n>0){
n /= p;
c += n;
}
return c;
}
int32_t main(){
int t,a,b,c,d;
cin >> t;
vector<int> prime;
for(int i=2;i<100000;i++){
bool p = true;
for(int j=2;j*j<=i;j++){
if(i%j==0){
p = false;
break;
}
}
if(p) prime.push_back(i);
}
while(t--){
cin >> a >> b >> c >> d;
bool ans = true;
for(auto pr:prime){
if(count(b,pr)-count(a-1,pr)>count(d,pr)-count(c-1,pr)){
ans = false;
break;
}
}
if(ans) cout << "DA" << endl;
else cout << "NE" << endl;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |