# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
475731 | CaroLinda | Vepar (COCI21_vepar) | C++14 | 1496 ms | 288988 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 ;
int d[MAX+10] , idx[MAX+10] ;
vector< vector<int> > lists ;
vector<int> primes ;
int main()
{
for(int i = 2 ; i <= MAX ; i++ )
{
if(d[i] > 0 ) continue ;
for(int j = i ; j <= MAX ; j += i )
if(d[j] == 0 ) d[j] = i ;
}
for(int i = 2 ; i <= MAX ; i++ )
{
if(d[i] == i)
{
idx[i] = sz(primes) ;
primes.push_back(i) ;
lists.push_back( {i} ) ;
continue ;
}
int x = i ;
while(x>1)
{
int p = d[x] ;
lists[idx[p]].pb( i ) ;
x /= p ;
}
}
scanf("%d", &T ) ;
}
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... |