Language: C++

#include <bits/stdc++.h> using namespace std; #define INF 1001000100010001000 #define MOD 1000000007 #define EPS 1e-10 #define int long long #define rep(i, N) for (int i = 0; i < N; i++) #define Rep(i, N) for (int i = 1; i < N; i++) #define For(i, a, b) for (int i = (a); i < (b); i++) #define pb push_back #define eb emplace_back #define mp make_pair #define i_i pair<int, int> #define vi vector<int> #define vvi vector<vi > #define vb vector<bool> #define vvb vector<vb > #define vp vector< i_i > #define all(a) (a).begin(), (a).end() #define Int(x) int x; cin >> x; #define int2(x, y) Int(x); Int(y); #define int3(x, y, z) Int(x); int2(y, z); #define fir first #define sec second #define ffir first.first #define fsec first.second #define sfir second.first #define ssec second.second #define Decimal fixed << setprecision(10) //int dxy[5] = {0, 1, 0, -1, 0}; // BIT avl cusum dijkstra dinic geo2 gin graph kruskal lca lcm matrix ncm next_combination segtree st tmp topcoder uf vi signed main() { std::ios::sync_with_stdio(false); std::cin.tie(0); int2(n, m); vp kyoko(n); rep(i, n) { kyoko[i].fir = kyoko[i].sec = i; // min, max } vp yui(m); rep(i, m) { int2(a, b); yui[i] = {a, b}; } sort(all(yui)); rep(i, yui.size()) { int tmp = yui[i].sec; kyoko[tmp-1].fir = kyoko[tmp].fir = min(kyoko[tmp-1].fir, kyoko[tmp].fir); kyoko[tmp-1].sec = kyoko[tmp].sec = max(kyoko[tmp-1].sec, kyoko[tmp].sec); } cout << kyoko[0].sec - kyoko[0].fir + 1; Rep(i, n) { cout << " " << kyoko[i].sec - kyoko[i].fir + 1; } cout << endl; return 0; } 





Compiler output:
a.cc:1:26: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++.h> using namespace std; #define INF 1001000100010001000 #define MOD 1000000007 #define EPS 1e-10 #define int long long #define rep(i, N) for (int i = 0; i < N; i++) #define Rep(i, N) for (int i = 1; i < N; i++) #define For(i, a, b) for (int i = (a); i < (b); i++) #define pb push_back #define eb emplace_back #define mp make_pair #define i_i pair<int, int> #define vi vector<int> #define vvi vector<vi > #define vb vector<bool> #define vvb vector<vb > #define vp vector< i_i > #define all(a) (a).begin(), (a).end() #define Int(x) int x; cin >> x; #define int2(x, y) Int(x); Int(y); #define int3(x, y, z) Int(x); int2(y, z); #define fir first #define sec second #define ffir first.first #define fsec first.second #define sfir second.first #define ssec second.second #define Decimal fixed << setprecision(10) //int dxy[5] = {0, 1, 0, -1, 0}; // BIT avl cusum dijkstra dinic geo2 gin graph kruskal lca lcm matrix ncm next_combination segtree st tmp topcoder uf vi signed main() { std::ios::sync_with_stdio(false); std::cin.tie(0); int2(n, m); vp kyoko(n); rep(i, n) { kyoko[i].fir = kyoko[i].sec = i; // min, max } vp yui(m); rep(i, m) { int2(a, b); yui[i] = {a, b}; } sort(all(yui)); rep(i, yui.size()) { int tmp = yui[i].sec; kyoko[tmp-1].fir = kyoko[tmp].fir = min(kyoko[tmp-1].fir, kyoko[tmp].fir); kyoko[tmp-1].sec = kyoko[tmp].sec = max(kyoko[tmp-1].sec, kyoko[tmp].sec); } cout << kyoko[0].sec - kyoko[0].fir + 1; Rep(i, n) { cout << " " << kyoko[i].sec - kyoko[i].fir + 1; } cout << endl; return 0; }
      |                          ^~~~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status