# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
475735 | CaroLinda | Vepar (COCI21_vepar) | C++14 | 617 ms | 524292 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 ;
using namespace std ;
int T ;
vector< int > sub[MAX+10] , soma[MAX+10] ;
int qtd[15][664589] , freq[664589] ;
int idx[MAX+10] , d[MAX+10] ;
int node = 0 ;
int main()
{
scanf("%d", &T ) ;
for(int i = 1 ; i <= T ; i++ )
{
int a , b , c , d ;
scanf("%d %d %d %d", &a, &b, &c, &d ) ;
soma[a-1].pb(i) ;
sub[b].pb(i) ;
sub[c-1].pb(i) ;
soma[d].pb(i) ;
}
for(int i = 2 ; i <= MAX ; i++ )
{
if(d[i] == 0)
{
idx[i] = ++node ;
for(int j = i ; j <= MAX ; j += i)
if(d[j] == 0) d[j] = i ;
}
int x = i ;
while(x > 1)
{
int p = d[x] ;
freq[ idx[p] ]++ ;
x /= p ;
}
for(auto e : sub[i])
for(int j = 1 ; j <= node ; j++ )
qtd[e][j] -= freq[j] ;
for(auto e : soma[i])
for(int j = 1 ; j <= node ; j++ )
qtd[e][j] += freq[j] ;
}
for(int i = 1 ; i <= T ; i++ )
{
bool ok = true ;
for(int j = 1 ; j <= node ; j++ ) ok &= ( qtd[i][j] >= 0 ) ;
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... |