# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
367378 | chubyxdxd | Vepar (COCI21_vepar) | C++11 | 1592 ms | 48980 KiB |
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>
using namespace std;
typedef long long ll;
const ll MAX=1e7;
vector<bool> sieve(MAX+5,true);
vector<int> y;
int main(){
int t;
for(int i=2;i<=MAX+5;i++){
if(sieve[i]==false)continue;
y.push_back(i);
for(ll j=i+i;j<=MAX+5;j+=i){
sieve[j]=false;
}
}
cin>>t;
while(t--){
int a,b,c,d;
cin>>a>>b>>c>>d;
map<int,int> mpa,mpb;
for(int i=0;i<y.size() && y[i]<=b;i++){
int aux=1;
while(aux<=b){
aux*=y[i];
int cur=b/aux-(a-1)/aux;
mpa[y[i]]+=cur;
}
}
for(int i=0;i<y.size() && y[i]<=d;i++){
int aux=1;
while(aux<=d){
aux*=y[i];
int cur=d/aux-(c-1)/aux;
mpb[y[i]]+=cur;
}
}
int sw=1;
for(auto it=mpa.begin();it!=mpa.end();it++){
int fi=(*it).first;
int se=(*it).second;
if(mpb[fi]<se)sw=0;
}
if(sw)cout<<"DA"<<endl;
else cout<<"NE"<<endl;
}
}
Compilation message (stderr)
# | 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... |