# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
367378 | 2021-02-17T04:15:10 Z | chubyxdxd | Vepar (COCI21_vepar) | C++11 | 1500 ms | 48980 KB |
#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
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 87 ms | 5724 KB | Output is correct |
2 | Correct | 88 ms | 5744 KB | Output is correct |
3 | Correct | 87 ms | 5724 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 87 ms | 5852 KB | Output is correct |
2 | Correct | 88 ms | 5724 KB | Output is correct |
3 | Correct | 87 ms | 5724 KB | Output is correct |
4 | Correct | 86 ms | 5724 KB | Output is correct |
5 | Correct | 88 ms | 5852 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 88 ms | 5724 KB | Output is correct |
2 | Correct | 87 ms | 5724 KB | Output is correct |
3 | Correct | 87 ms | 5744 KB | Output is correct |
4 | Correct | 87 ms | 5724 KB | Output is correct |
5 | Correct | 87 ms | 5736 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1590 ms | 30272 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1559 ms | 48924 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1539 ms | 48896 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1592 ms | 48980 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |