/in/foo.cc: In function 'void primes(int)':
/in/foo.cc:18:19: warning: left operand of comma operator has no effect [-Wunused-value]
for(ll j=1;j<=num1,i*prime[j]<=n;++j){
~^~~~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:36:15: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'll* {aka long long int*}' [-Wformat=]
scanf("%d",&n);primes(maxx);
~~^
/in/foo.cc:39:46: warning: format '%d' expects argument of type 'int', but argument 2 has type 'll {aka long long int}' [-Wformat=]
for(int i=1;i<=num2;++i)printf("%d\n",ans[i]);
~~~~~~^
/in/foo.cc:17:16: warning: iteration 100008 invokes undefined behavior [-Waggressive-loop-optimizations]
if(!vis[i]){prime[++num1]=i;prime1[i]=1;}
~~~~~^
/in/foo.cc:16:17: note: within this loop
for(ll i=2;i<=n;++i){
~^~~