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

Submission #768743

#TimeUsernameProblemLanguageResultExecution timeMemory
7687431075508020060209tcVepar (COCI21_vepar)C++14
70 / 70
1451 ms43924 KiB
#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)

Main.cpp: In function 'void solve()':
Main.cpp:13:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 | for(int pid=0;pid<prm.size();pid++){
      |               ~~~^~~~~~~~~~~
#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...