# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
475740 | CaroLinda | Vepar (COCI21_vepar) | C++14 | 325 ms | 43852 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>
#define mkt make_tuple
#define all(x) x.begin(),x.end()
#define sz(x) (int)(x.size())
#define ll long long
#define lp(i,a,b) for(int i = a ; i < b ; i++ )
#define pii pair<int,int>
#define mk make_pair
#define pb push_back
const int MAX= 10000000 ;
const int MAX_PRIMES = 664589 ;
using namespace std ;
int T ;
vector<int> primes ;
int d[MAX+10] ;
int getQtd(int x, int j)
{
int ans = 0 ;
ll k = primes[j] ;
while(k <= x)
{
ans += x/k ;
k *= primes[j] ;
}
return ans ;
}
int main()
{
for(int i = 2 ; i <= MAX ; i++ )
{
if(d[i] > 0 ) continue ;
primes.pb(i) ;
for(int j = i ; j <= MAX ; j += i )
if(d[j] == 0 ) d[j] = i ;
}
scanf("%d", &T ) ;
for(int i = 1 ; i <= T ; i++ )
{
int a , b , c , d ;
scanf("%d %d %d %d", &a, &b, &c, &d ) ;
bool ok = true ;
for(int j = 0 ; j < sz(primes) ; j++ )
{
if( getQtd(b,j)-getQtd(a-1,j) > getQtd(d,j)-getQtd(c-1,j) )
{
ok = false ;
break ;
}
}
printf("%s\n" , ok ? "DA" : "NE") ;
}
}
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... |