제출 #367379

#제출 시각아이디문제언어결과실행 시간메모리
367379chubyxdxdVepar (COCI21_vepar)C++11
30 / 70
1596 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; } } scanf("%d",&t); while(t--){ int a,b,c,d; scanf("%d %d %d %d",&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)printf("DA\n"); else printf("NE\n"); } }

컴파일 시 표준 에러 (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++){
      |                 ~^~~~~~~~~
Main.cpp:16:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   16 |   scanf("%d",&t);
      |   ~~~~~^~~~~~~~~
Main.cpp:19:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   19 |     scanf("%d %d %d %d",&a,&b,&c,&d);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
#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...