# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
768743 | 1075508020060209tc | Vepar (COCI21_vepar) | C++14 | 1451 ms | 43924 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;
//#define int long long
#define X first
#define Y second
int ttt;
vector<int>prm;
int prmtbl[10000007];
int ans[11];
int A[11];int B[11];int C[11];int D[11];
int ac[11];int bc[11];
void solve(){
for(int pid=0;pid<prm.size();pid++){
for(int t=1;t<=ttt;t++){
ac[t]=0;bc[t]=0;
}
int p=prm[pid];
for(int i=p;i<=10000000;i+=p){
int v=i;
int vc=0;
while(v%p==0){
vc++;
v/=p;
}
for(int t=1;t<=ttt;t++){
if(i>=A[t]&&i<=B[t]){
ac[t]+=vc;
}
if(i>=C[t]&&i<=D[t]){
bc[t]+=vc;
}
}
}
for(int t=1;t<=ttt;t++){
if(ac[t]>bc[t]){
ans[t]=0;
}
}
}
}
signed main(){
for(int i=2;i<=10000000;i++){
if(prmtbl[i]==0){
prm.push_back(i);
}
for(int j=i+i;j<=10000000;j+=i){
prmtbl[j]=1;
}
}
cin>>ttt;
for(int i=1;i<=ttt;i++){
ans[i]=1;
cin>>A[i]>>B[i]>>C[i]>>D[i];
}
solve();
for(int i=1;i<=ttt;i++){
if(ans[i]==1){
cout<<"DA\n";
}else{
cout<<"NE\n";
}
}
}
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... |