(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 #367378

#TimeUsernameProblemLanguageResultExecution timeMemory
367378chubyxdxdVepar (COCI21_vepar)C++11
30 / 70
1592 ms48980 KiB
#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)

Main.cpp: In function 'int main()':
Main.cpp:21:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |     for(int i=0;i<y.size() && y[i]<=b;i++){
      |                 ~^~~~~~~~~
Main.cpp:29:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |     for(int i=0;i<y.size() && y[i]<=d;i++){
      |                 ~^~~~~~~~~
#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...