Language: C++

#define pb push_back
using namespace std;
using ll = long long;
using P = pair<int,int>;
template<class T> inline bool chmin(T& a,T b) {if(a > b){a = b; return true;} return false;}
template<class T> inline bool chmax(T& a,T b) {if(a < b){a = b; return true;} return false;}
const int inf = 1001001001;

struct Sieve {
  int n;
  vector<int> f, primes;
  Sieve(int n=1):n(n), f(n+1) {
    f[0] = f[1] = -1;
    for (ll i = 2; i <= n; ++i) {
      if (f[i]) continue;
      primes.push_back(i);
      f[i] = i;
      for (ll j = i*i; j <= n; j += i) {
        if (!f[j]) f[j] = i;
      }
    }
  }
  bool isPrime(int x) { return f[x] == x;}
  vector<int> factorList(int x) {
    vector<int> res;
    while (x != 1) {
      res.push_back(f[x]);
      x /= f[x];
    }
    return res;
  }
  vector<P> factor(int x) {
    vector<int> fl = factorList(x);
    if (fl.size() == 0) return {};
    vector<P> res(1, P(fl[0], 0));
    for (int p : fl) {
      if (res.back().first == p) {
        res.back().second++;
      } else {
        res.emplace_back(p, 1);
      }
    }
    return res;
  }
};

int main() {
    Sieve s(55555);
    int n;
    cin >> n;
    vector<int> ans;
    int now = 11;
    while (ans.size() < n) {
        if(s.isPrime(now)) ans.pb(now);
        now += 10;
    }
    rep(i,n) cout << ans[i] << " ";
    cout << endl;
}


Compiler output:
a.cc:4:11: error: 'pair' does not name a type
    4 | using P = pair<int,int>;
      |           ^~~~
a.cc:11:3: error: 'vector' does not name a type
   11 |   vector<int> f, primes;
      |   ^~~~~~
a.cc:24:3: error: 'vector' does not name a type
   24 |   vector<int> factorList(int x) {
      |   ^~~~~~
a.cc:32:3: error: 'vector' does not name a type
   32 |   vector<P> factor(int x) {
      |   ^~~~~~
a.cc: In constructor 'Sieve::Sieve(int)':
a.cc:12:24: error: class 'Sieve' does not have any field named 'f'
   12 |   Sieve(int n=1):n(n), f(n+1) {
      |                        ^
a.cc:13:5: error: 'f' was not declared in this scope
   13 |     f[0] = f[1] = -1;
      |     ^
a.cc:16:7: error: 'primes' was not declared in this scope
   16 |       primes.push_back(i);
      |       ^~~~~~
a.cc: In member function 'bool Sieve::isPrime(int)':
a.cc:23:32: error: 'f' was not declared in this scope
   23 |   bool isPrime(int x) { return f[x] == x;}
      |                                ^
a.cc: In function 'int main()':
a.cc:50:5: error: 'cin' was not declared in this scope
   50 |     cin >> n;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #define pb push_back
a.cc:51:5: error: 'vector' was not declared in this scope
   51 |     vector<int> ans;
      |     ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #define pb push_back
a.cc:51:12: error: expected primary-expression before 'int'
   51 |     vector<int> ans;
      |            ^~~
a.cc:53:12: error: 'ans' was not declared in this scope
   53 |     while (ans.size() < n) {
      |            ^~~
a.cc:57:9: error: 'i' was not declared in this scope
   57 |     rep(i,n) cout << ans[i] << " ";
      |         ^
a.cc:57:5: error: 'rep' was not declared in this scope
   57 |     rep(i,n) cout << ans[i] << " ";
      |     ^~~
a.cc:58:5: error: 'cout' was not declared in this scope
   58 |     cout << endl;
      |     ^~~~
a.cc:58:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:58:13: error: 'endl' was not declared in this scope
   58 |     cout << endl;
      |             ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #define pb push_back