


it was 2.5 / 4 s.
another thing is when i am trying to use bitset it takes much time.



Update:
my solution: https://pastebin.ubuntu.com/p/jzBSNQ8W5k/
verdict : TLE
memory: 184MB (according to CF)
how should i improve my code




void seive()
{
for(int i=3; i<=13333292; i+=2)
{
if(mp[i]==0)
{
prime[len++]=i;
for(int j=i*2; j<=13333292; j+=i)
{
mp[j]=1;
}
}
}
}
const int maxv = 200000000;
const int limit = maxv / 15;
#define MAXV 200000000
#define LIMIT (MAXV / 15)
#define PHAS(_n) (pbits[(_n)>>5] & (1u << ((_n) & 0x1f)))
#define PSET(_n) (pbits[(_n)>>5] |= (1u << ((_n) & 0x1f)))
unsigned int pbits[LIMIT/32+1];
int pr[1000000];
int pc;
void gen( void )
{
int i, j, mx = (int) sqrt( LIMIT );
pc = 0;
for( i = 3; i < LIMIT; i += 2)
if( !PHAS(i) )
{
pr[pc++] = i;
if( i <= mx )
for( j = i*i; j <= LIMIT; j += 2*i) PSET(j);
}
}