-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathAMR11E.cpp
More file actions
50 lines (46 loc) · 764 Bytes
/
AMR11E.cpp
File metadata and controls
50 lines (46 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <queue>
#include <algorithm>
#include <set>
#include <math.h>
#include <map>
#include <utility>
using namespace std;
#define mp make_pair
#define pb push_back
#define INF -1
#define MAX 10000007
#define X first
#define Y second
#define all(x) x.begin(),x.end()
int prime[10005];
vector <int> num;
void sieve()
{
for(int i=2;i<10001;i++)
{
if(prime[i])
continue;
for(int j=2;j*i<10001;j++)
prime[j*i]++;
}
for(int i=3;i<10001;i++)
{
if(prime[i]>=3)
num.pb(i);
}
}
int main()
{
int t,x;
cin>>t;
sieve();
while(t--)
{
cin>>x;
cout<<num[x-1]<<"\n";;
}
}