이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define pb push_back
#define all(x) x.begin(), x.end()
const int N = 1e7+10;
int a, b, c, d, T, x, y;
vector<ll> primes;
vector<bool> is(N);
int main(){
cin.tie(0); ios::sync_with_stdio(0);
for(int i = 2; i < N; i++){
if(!is[i]){
primes.pb(i);
for(int j = i; j < N; j += i) is[j] = 1;
}
}
cin >> T;
while(T--){
cin >> a >> b >> c >> d;
bool ok = 1;
for(ll p: primes){
x = y = 0;
ll e = p;
while(e <= max(b, d)){
ll n = ((a+e-1) / e);
ll m = (b / e);
x += max(0LL, m-n+1);
n = ((c+e-1) / e);
m = (d / e);
y += max(0LL, m-n+1);
e *= p;
}
if(x>y) ok = 0;
}
if(ok) cout << "DA\n";
else cout << "NE\n";
}
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... |