Language: C++

#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
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;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}
int prime[55555];         // i番目の素数
bool is_prime[55555 + 1]; // is_prime[i]がtrueならiは素数

int sieve(int n) {
    int p = 0;
    for(int i = 0; i <= n; i++) {
        is_prime[i] = true;
    }
    is_prime[0] = is_prime[1] = false;
    for(int i = 2; i < n + 1; i++) {
        if(is_prime[i]) {
            prime[p++] = i;
            for(int j = 2 * i; j <= n; j += i) {
                is_prime[j] = false;
            }
        }
    }
    return p;
}

int main() {
    int N;
    cin >> N;
    long long sum = 0;
    REP(i, N - 1) { sum += prime[i]; }
    for(int i = N - 1; i < INF; i++) {
        if(sum + prime[i] % 3 == 0) {
            REP(i, N - 1) { cout << prime[i]; }
            cout << prime[i] << endl;
            return 0;
        }
    }
    return 0;
}


Compiler output:
a.cc:8:9: error: 'string' does not name a type
    8 | typedef string str;
      |         ^~~~~~
a.cc:9:9: error: 'pair' does not name a type
    9 | typedef pair<ll, ll> p;
      |         ^~~~
a.cc:26:23: error: 'vector' in namespace 'std' does not name a template type
   26 | void print(const std::vector<int> &v) {
      |                       ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #define REP(i, n) for(ll i = 0; i < (ll)n; i++)
a.cc:26:29: error: expected ',' or '...' before '<' token
   26 | void print(const std::vector<int> &v) {
      |                             ^
a.cc: In function 'void print(int)':
a.cc:27:10: error: 'for_each' is not a member of 'std'
   27 |     std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
      |          ^~~~~~~~
a.cc:27:19: error: 'v' was not declared in this scope
   27 |     std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
      |                   ^
a.cc: In lambda function:
a.cc:27:56: error: 'cout' is not a member of 'std'
   27 |     std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
      |                                                        ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #define REP(i, n) for(ll i = 0; i < (ll)n; i++)
a.cc: In function 'void print(int)':
a.cc:28:10: error: 'cout' is not a member of 'std'
   28 |     std::cout << std::endl;
      |          ^~~~
a.cc:28:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:28:23: error: 'endl' is not a member of 'std'
   28 |     std::cout << std::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 REP(i, n) for(ll i = 0; i < (ll)n; i++)
a.cc: In function 'int main()':
a.cc:52:5: error: 'cin' was not declared in this scope
   52 |     cin >> N;
      |     ^~~
a.cc:52:5: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:57:29: error: 'cout' was not declared in this scope
   57 |             REP(i, N - 1) { cout << prime[i]; }
      |                             ^~~~
a.cc:57:29: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:58:13: error: 'cout' was not declared in this scope
   58 |             cout << prime[i] << endl;
      |             ^~~~
a.cc:58:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:58:33: error: 'endl' was not declared in this scope
   58 |             cout << prime[i] << endl;
      |                                 ^~~~
a.cc:58:33: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'