Only One Case is Failing

#include <bits/stdc++.h>
using namespace std;
vector primes;

void sieve(long long *p)
{
for (long long i = 2; i <= 500000; i++)
{
if (p[i] == 0)
{
primes.push_back(i);
for (long long j = i * i; j <= 500000; j = j + i)
{
p[j] = 1;
}
}
}
}
int main()
{

long long p[500000] = {0};
primes.push_back(0);
sieve(p);
int t;
cin >> t;
while (t--)
{
	long long n;
	cin >> n;
	cout << primes[n] << endl;
}

}

Hello @suhaib0900 check this is the updated code:

Hi Tushar,

Can you tell me the meaning of int32_t

Hello @suhaib0900 as you can see that i have defines int as long long int above but int in int main can’t be of the type long long so we have to use this syntax then.

Okay I have 2 questions.

  1. Why can’t we simply do int main() because here we are just taking small inputs and printing so why did you do int32_t ?

  2. #define int long long int . What is this? I mean what does it mean. I have never seen anything like this. I know what define does. Something like #define ll long long but what is going on in this one.

@suhaib0900 here i when you will do i*i then it will be handled with the help of the long long int only.
and just like #define ll long long in this we have defined ll as long long and every variables data type will be ll now but in mine way i have define int as long long int so every int will be long long int.if you will define int as long long int then you have to take int32_t otherwise if you define ll as long long then int main() will also work.

Okay Thanks.
I have one last dumb question.
long long int and long long means the same thing right?

@suhaib0900 yes it is the same thing.
if you have any other doubt you can ask here:
please confirm if i can mark this doubt as resolved?

Yeah you can mark it as resolved. Thanks a lot.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.