criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
#include <atcoder/all>
#define rep(i, n) for(int i = 0; i < (n); ++i)
using namespace std;
using namespace atcoder;
using P = pair<int, int>;
using Tuple = tuple<int, int, int>;

void solve() {
    int N; cin >> N;
    vector<Tuple> ps(N);
    rep(i, N) {
        int x, y;
        cin >> x >> y;
        ps[i] = make_tuple(x, y, i);
    }
    dsu uf(N);
    rep(_, 2) {
        sort(ps.begin(), ps.end());
        set<P> st;
        auto[x, y, id] = ps[0];
        st.emplace(y, id);
        for(int i = 1; i < N; ++i) {
            auto[x, y, id] = ps[i];
            auto [mn, mid] = *st.begin();
            if(mn < y) uf.merge(mid, id);
            else mn = y, mid = id;
            auto it = st.lower_bound({y, id});
            if(it != st.begin()) {
                it = prev(it);
                assert(it->first < y);
                uf.merge(id, it->second);
            }
            st.insert({y, id});
        }
        rep(i, N) {
            auto[x, y, id] = ps[i];
            ps[i] = make_tuple(-x, -y, id);
        }
    }
    rep(i, N) cout << uf.size(i) << '\n';
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
}


Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#include<atcoder/all>

using namespace std;
using namespace atcoder;

int main(){
    int N;
    cin>>N;
    dsu d(N+1);
    pair<int,int> p[N];
    int iny[N];
    for(int i=0;i<N;i++){
        int x,y;
        cin>>x>>y;
        pair<int,int> tmpp;
        tmpp.first=x;
        tmpp.second=y;
        p[i]=tmpp;
        iny[i]=y;
    }

    sort(p,p+N);

    int NM=N;
    for(int i=0;i<N;i++){
        int py=p[i].second;
        for(int j=py+1;j<=NM;j++){
            //cout<<py<<","<<j<<endl;
            d.merge(py,j);
        }
        NM=min(py-1,NM);
    }
    NM=1;
    for(int i=N-1;i>=0;i--){
        int py=p[i].second;
        for(int j=py-1;j>=NM;j--){
           // cout<<py<<"/"<<j<<endl;
            d.merge(py,j);
        }
        NM=max(py+1,NM);
    }


    int ans[N];
    for(int i=0;i<N;i++){
        ans[i]=d.size(i+1);
    }
    for(int i=0;i<N;i++){
        cout<<ans[iny[i]-1]<<endl;
    }
}


Compiler output:
a.cc:2:9: fatal error: atcoder/all: No such file or directory
    2 | #include<atcoder/all>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <algorithm> //sort,二分探査など
#include <atcoder/all>
//#include<bitset>
//#include<cmath>//pow,logなど
//#include<deque>
//#include<functional>
//#include<iterator>
//#include<map>
//#include<numeric>//gcd,lcm
//#include<queue>
//#include<set>
//#include<stack>
//#include<string>
//#include<utility>//pair

//QCFium法
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

//浮動小数点処理高速化
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

using namespace std;
using namespace atcoder;
using i64 = int64_t;
using f80 = __float80;
using u64 = uint_fast64_t;

constexpr i64 INF = 1010000000000000017LL;
constexpr u64 MOD = 1000000007LL;
constexpr f80 PI = 3.14159265358979323846;

#define _overload3(_1, _2, _3, name, ...) name
#define repi(i, start, end) for (int i = (int)(start); i < (int)(end); ++i)
#define _rep(i, n) repi(i, 0, n)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define rrep(i, start, end) for (int i = (int)(start); i > (int)(end); --i)
#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()

#define v(T) vector<T>
#define vv(T) v(v(T))
#define vvv(T) v(v(v(T)))
typedef v(int) vi;

#define show(x) cout << #x << " = " << x << endl;
#define PQ(T) priority_queue<T, v(T), greater<T>>

template <class T>
inline bool chmax(T &a, T b)
{
  if (a < b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T &a, T b)
{
  if (a > b)
  {
    a = b;
    return true;
  }
  return false;
}

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v)
{
  rep(i, v.size()) os << v[i] << (i + 1 != v.size() ? " " : "");
  return os;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &v)
{
  for (T &in : v)
    is >> in;
  return is;
}

void Main()
{
  int N;
  cin >> N;

  v(int) xy(N), yx(N), xi(N);

  rep(i, N)
  {
    int x, y;
    cin >> x >> y;
    x--;
    y--;

    xy[x] = y;
    yx[y] = x;
    xi[x] = i;
  }

  dsu d(N);
  int y = N - 1;

  rep(x, N)
  {
    if (xy[x] < y)
    {
      d.merge(xi[x], xi[yx[y]]);
      if (y < 0)
        break;
    }
    y--;
  }

  rep(i, N)
  {
    cout << d.size(i) << "\n";
  }
}

int main()
{
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  //  cout << fixed << setprecision(15);
  Main();
}

Compiler output:
a.cc:4:10: fatal error: atcoder/all: No such file or directory
    4 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int[] x = new int[n];
        int[] y = new int[n];
        boolean[][] answer = new boolean[n][n];

        for (int i = 0; i < n; i++) {
            x[i] = sc.nextInt();
            y[i] = sc.nextInt();
            for (int j = 0; j < n; j++) {
                answer[i][j] = (i == j);
            }
        }

        int counter = 1;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (answer[i][j]) continue;
                if((x[j] < x[i] && y[j] < y[i]) || (x[j] > x[i] && y[j] > y[i]))
                    if(j < i) counter += fillWithTrue(i, j, n, answer);
                    else {
                        answer[i][j] = true;
                        counter++;
                    }
            }
            System.out.println(counter);
            counter = 1;
        }
    }

    private static int fillWithTrue(int current, int target, int n, boolean[][] answer) {
        int counter = 0;
        for (int j = 0; j < n; j++) {
            if (answer[target][j] && !answer[current][j]) {
                answer[current][j] = true;
                counter++;
            }
        }
        return counter;
    }

Compiler output:
Main.java:47: error: reached end of file while parsing
    }
     ^
1 error
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using ll=long long;

int main(){
 int n,count;
 cin >> n;
 vector<int> x(n),y(n),a(n),b(n,1);
 rep(i,n) cin >> x[i] >> y[i];
 rep(i,n) a[i]=i;
 for(int i=0; i<n-1; i++){
   for(int j=i+1; j<n; j++){
     if(x[i]>=x[j]&&y[i]>=y[j]) a[j]=a[i];
     if(x[i]<x[j]&&y[i]<y[j]) a[j]=a[i];
   }
 }
 rep(i,n){
   rep(j,n){
     if(i!=j&&a[i]==a[j]){ 
       if(b[j]==1) b[i]++;
       if(b[j]!=1){
         b[i]=b[j];
         break;
     }
   }
   cout << b[i] << endl;
 }
     
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:2: error: expected '}' at end of input
   30 | }
      |  ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: Java

import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

public class Main {

	class City {
		int index, x, y;

		public City(int x, int y, int index) {
			this.x = x;
			this.y = y;
			this.index = index;
		}
	}

	private int getMax(int[] l, int index) {

		int ans = 0;
		for (int i = index; i > 0; i -= i & (-i)) {
			ans += l[i];
		}

		return ans;
	}

	private void updateMax(int[] l, int index, int val) {

		for (int i = index; i < l.length; i++) {
			l[i] += val;
		}
	}

	public void getNumberOfReachableCities(int input) throws Exception {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		if (input == 1) {
			br = new BufferedReader(new FileReader("test.txt"));
		}
		
		int n = Integer.parseInt(br.readLine());
		int[] ans = new int[n];

		List<City> cities = new ArrayList<City>();

		for (int i = 0; i < n; i++) {
			StringTokenizer st = new StringTokenizer(br.readLine(), " ");
			cities.add(new City(Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken()), i));
		}

		cities.sort((City c1, City c2) -> c1.x - c2.x);

		int[] left = new int[n + 1];
		int[] right = new int[n + 1];

		for (int i = 0; i < n; i++) {
			int num = getMax(left, cities.get(i).y);
			ans[cities.get(i).index] = num + 1;
			updateMax(left, cities.get(i).y + 1, 1);
		}

		for (int i = n - 1; i >= 0; i--) {
			int num = getMax(right, n - cities.get(i).y + 1);
			ans[cities.get(i).index] += num;
			updateMax(right, n - cities.get(i).y + 2, 1);
		}

		for (int i = 0; i < n; i++) {
			System.out.println(ans[i] + " ");
		}
		// System.out.print(ans[n - 1] + " ");
	}

	public static void main(String[] args) throws Exception {

		A a = new A();

		a.getNumberOfReachableCities(0);

	}
}

Compiler output:
Main.java:78: error: cannot find symbol
		A a = new A();
		^
  symbol:   class A
  location: class Main
Main.java:78: error: cannot find symbol
		A a = new A();
		          ^
  symbol:   class A
  location: class Main
2 errors
Language: C++

#include<bits/stdc++.h>
#define maxn 200005
#define pii pair<int,int>
#define mk make_pair
using namespace std;

int n;

struct node {int x,y,id;}poi[maxn];

bool cmp1(node i,node j)
{
	return i.x<j.x;
}

int ans[maxn],siz[maxn];

set< pii >	sets;
set< pii >::iterator it;

int fa[maxn];

int find(int x)
{
	return fa[x]==x ? x:fa[x]=find(fa[x]);
}

signed main()
{
	cin>>n;
	for(int i=1;i<=n;i++)	cin>>poi[i].x>>poi[i].y,poi[i].id=fa[i]=i,siz[i]=1;
	sort(poi+1,poi+n+1,cmp1);
	sets.insert(mk(9999999,9999999));
	for(int i=1;i<=n;i++)
	{
		it=sets.begin();
		while((*it).first<poi[i].y)
		{
			int fx=find(poi[i].id),fy=find((*it).second);
			if(fx!=fy)
			{
				fa[fx]=fy;
				siz[fy]+=siz[fx];
			}
			it++;
		}
		else sets.insert(mk(poi[i].y,poi[i].id));
	}
	for(int i=1;i<=n;i++)
		cout<<siz[find(i)]<<endl;
	
		
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:47:17: error: 'else' without a previous 'if'
   47 |                 else sets.insert(mk(poi[i].y,poi[i].id));
      |                 ^~~~
Language: C++

#include <atcoder/fenwicktree>
#include <algorithm>
#include <stdio.h>
using namespace std;
using namespace atcoder;
long long x[200000];
long long y[200000];
long long z[200000];
int w[200000];
int a[200000];
int s;
long long n;
int main() {
	scanf("%lld", &n);
	fenwick_tree<long long> fw(n);
	for (int i = 0; i < n; i++) {
		scanf("%lld%lld", x + i, y + i);
		x[i]--;
		y[i]--;
		z[i] = x[i] * n + y[i];
	}
	std::sort(z, z + n);
	for (int i = 0; i < n; i++) {
		fw.add(z[i] % n, 1);
		if (fw.sum(n - i - 1, n) == i + 1) {
			w[i] = 1;
		}
	}
	s = 0;
	for (int i = 1; i <= n; i++) {
		if (w[i - 1]) {
			for (int j = s; j < i; j++) {
				a[j] = i - s;
			}
			s = i;
		}
	}
	for (int i = 0; i < n; i++) {
		printf("%d\n", a[x[i]]);
	}
}

Compiler output:
a.cc:1:10: fatal error: atcoder/fenwicktree: No such file or directory
    1 | #include <atcoder/fenwicktree>
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main()
{    
    int n, x, y;
    cin >> n;
    vector<pair<int, int>> p;
    for (int i = 0; i < n; i++) {
        cin >> x >> y;
        p.push_back(pair<int, int>(x, y));
    }
    vector<int> arr(n);
    vector<int> skip;
    for (int i = 0; i < n - 1; i++) {
        if (count(skip.begin(), skip.end(), i))
            continue;
        vector<int> group;
        int count = 1;
        group.push_back(i);
        for (int j = i + 1; j < n; j++) {
            if ((p[i].first > p[j].first && p[i].second > p[j].second) || (p[i].first < p[j].first && p[i].second < p[j].second)) {
                count++;
                group.push_back(j);
                skip.push_back(j);
            }
        }
        for (int k : group) {
            arr[k] = count;
        }
    }
    for (int i = 0; i < arr.size(); i++) {
        cout << arr[i] << "\n";
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: 'count' was not declared in this scope
   19 |         if (count(skip.begin(), skip.end(), i))
      |             ^~~~~
Language: C++

#include<iostream>
//#include<string>
using namespace std;
int main()
{
	int N;
	cin>>N;
	int *x_and_y=new int[N*2];
	int *an=new int[N];
	for(int i=0;i<N;i++)
		cin>>x_and_y[i][0];
		cin>>x_and_y[i][1];
	}
	for(int k=0;k<N;k++){
		for(int i=0;i<N;i++){
			if((x_and_y[i][0]<x_and_y[k][0])&&(x_and_y[i][1]<x_and_y[k][1])||(x_and_y[i][0]>x_and_y[k][0])&&(x_and_y[i][1]>x_and_y[k][1])){
				an[k]++;
			}
		}
	}
	for(int i=0;i<N;i++){
		cout<<an[i]<<\n;
	}
	return 0;
}

Compiler output:
a.cc:22:30: error: stray '\' in program
   22 |                 cout<<an[i]<<\n;
      |                              ^
a.cc: In function 'int main()':
a.cc:11:32: error: invalid types 'int[int]' for array subscript
   11 |                 cin>>x_and_y[i][0];
      |                                ^
a.cc:12:30: error: 'i' was not declared in this scope
   12 |                 cin>>x_and_y[i][1];
      |                              ^
a.cc: At global scope:
a.cc:14:9: error: expected unqualified-id before 'for'
   14 |         for(int k=0;k<N;k++){
      |         ^~~
a.cc:14:21: error: 'k' does not name a type
   14 |         for(int k=0;k<N;k++){
      |                     ^
a.cc:14:25: error: 'k' does not name a type
   14 |         for(int k=0;k<N;k++){
      |                         ^
a.cc:21:9: error: expected unqualified-id before 'for'
   21 |         for(int i=0;i<N;i++){
      |         ^~~
a.cc:21:21: error: 'i' does not name a type
   21 |         for(int i=0;i<N;i++){
      |                     ^
a.cc:21:25: error: 'i' does not name a type
   21 |         for(int i=0;i<N;i++){
      |                         ^
a.cc:24:9: error: expected unqualified-id before 'return'
   24 |         return 0;
      |         ^~~~~~
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#include <atcoder/all>
#include <boost/multiprecision/cpp_int.hpp>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using namespace atcoder;
using namespace boost::multiprecision;
using ll = long long;

int main() {
    int n;
    cin >> n;
    vector<pair<pair<int, int>, int>> p(n);
    rep(i, n) {
        int x, y;
        cin >> x >> y;
        x--;
        y--;
        p[i] = {{x, y}, i};
    }
    sort(all(p));
    dsu d(n);
    priority_queue<pair<pair<int, int>, int>> pq; // y, x, i
    rep(i, n) {
        pq.push({{-p[i].first.second, p[i].first.first}, p[i].second});
        while (pq.top().first.first > -p[i].first.second) {
            d.merge(p[i].second, pq.top().second);
            pq.pop();
        }
    }
    rep(i, n) cout << d.size(i) << endl;
}
/*
g++ -std=c++17 -Wall -Wextra -g -O0 -fsanitize=undefined,address main.cpp && oj t
*/

Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <atcoder/segtree>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;

int op(int a, int b) { return a+b; }

int e() { return  0; }
#define pb push_back
#define mp make_pair
#define F first
#define S second
int main() {
    int n,i;
    scanf("%d", &n);
	vector<pair<int,pair<int,int> > >vec;
	for(i=0;i<n;i++)    
	{
		int a,b;
		cin>>a>>b;
		vec.pb(mp(a,mp(b,i)));	
	}
	sort(vec.begin(),vec.end());
 	vector<int> a(n);
    for (int i = 0; i < n; i++) {
        a[i] = 0;
    }
    segtree<int, op, e> seg(a);
    vector<pair<int,int> >ans(n);
    for (i = 0; i < n; i++) {
        int a=vec[i].first,b=vec[i].second.first,c=vec[i].S.S;
        int tot = seg.prod(0,b-1);
        ans[i] = mp(c,tot);	
        seg.set(b,1);
    }
    for (int i = 0; i < n; i++) {
        a[i] = 0;
    }
    segtree<int, op, e> seg1(a);
    for(i=n-1;i>=0;i--){
    	int a=vec[i].first,b=vec[i].second.first,c=vec[i].S.S;
        int tot = seg1.prod(b-1,n-1);
        ans[i].S += tot;	
        seg1.set(b,1);
	}
	sort(ans.begin(),ans.end());
	for(i=0;i<n;i++)
		cout<<ans[i]<<endl;
}

Compiler output:
a.cc:1:10: fatal error: atcoder/segtree: No such file or directory
    1 | #include <atcoder/segtree>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include "bits/stdc++.h"
#include "atcoder/all"
using namespace atcoder;
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

typedef pair<P, int> PP;
const int INF = 1e9;

class union_find {
    private:
        vector<int> par;
        vector<int> ran;
        vector<ll> size;
    public:
        union_find(int n);
        int find(int x);
        void unite(int x, int y);
        bool same(int x, int y);
        ll show_size(int x);
};

union_find::union_find(int n){
    par.resize(n);
    ran.resize(n);
    size.resize(n);
    rep(i,n) par[i] = i;
    rep(i,n) ran[i] = 0;
    rep(i,n) size[i] = 1;
};

int union_find::find(int x) {
    if(par[x] == x) return x;
    else return par[x] = find(par[x]);
};

void union_find::unite(int x, int y) {
    x = find(x);
    y = find(y);
    if(x == y) return;
    ll t = show_size(x)+show_size(y);
    size[x] = size[y] = t;
    if(ran[x] < ran[y]){
        par[x] = y;
        //size[y] += size[x];
    }
    else{
        par[y] = x;
        //size[x] += size[y];
        if(ran[x] == ran[y]) ran[x]++;
    }
};

ll union_find::show_size(int x) {
    if(par[x] == x) return size[x];
    return show_size(par[x] = find(par[x]));
}

bool union_find::same(int x, int y) {
    return (find(x) == find(y));
};

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	vector<PP> v;
	rep(i,n){
		int x, y;
		cin >> x >> y;
		v.emplace_back(P(x, y), i+1);
	}
	sort(v.begin(), v.end());
	union_find uf(n+1);
	set<P> st;
	st.insert(P(INF, INF));
	for(int i = n-1; i >= 0; --i){
		int x = v[i].first.first;
		int y = v[i].first.second;
		int idx = v[i].second;
		auto itr = st.lower_bound(P(y, -1));
		bool merge = false;
		while(*itr != P(INF, INF)){
			P p = *itr;
			uf.unite(idx, p.second);
			merge = true;
			++itr;
		}
		if(!merge) st.insert(P(y, idx));
	}
	for(int i = 1; i <= n; ++i){
		cout << uf.show_size(i) << endl;
	}
	return 0;
}

Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include "atcoder/all"
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
//#include<string>
using namespace std;
int main()
{
	int N;
	cin>>N;
	int *x_and_y=new int[N][2];
	int *an=new int[N];
	for(int i=0;i<N;i++)
		cin>>x_and_y[i][0];
		cin>>x_and_y[i][1];
	}
	for(int k=0;k<N;k++){
		for(int i=0;i<N;i++){
			if((x_and_y[i][0]<x_and_y[k][0])&&(x_and_y[i][1]<x_and_y[k][1])||(x_and_y[i][0]>x_and_y[k][0])&&(x_and_y[i][1]>x_and_y[k][1])){
				an[k]++;
			}
		}
	}
	for(int i=0;i<N;i++){
		cout<<an[i]<<\n;
	}
	return 0;
}

Compiler output:
a.cc:22:30: error: stray '\' in program
   22 |                 cout<<an[i]<<\n;
      |                              ^
a.cc: In function 'int main()':
a.cc:8:34: error: cannot convert 'int (*)[2]' to 'int*' in initialization
    8 |         int *x_and_y=new int[N][2];
      |                                  ^
      |                                  |
      |                                  int (*)[2]
a.cc:11:32: error: invalid types 'int[int]' for array subscript
   11 |                 cin>>x_and_y[i][0];
      |                                ^
a.cc:12:30: error: 'i' was not declared in this scope
   12 |                 cin>>x_and_y[i][1];
      |                              ^
a.cc: At global scope:
a.cc:14:9: error: expected unqualified-id before 'for'
   14 |         for(int k=0;k<N;k++){
      |         ^~~
a.cc:14:21: error: 'k' does not name a type
   14 |         for(int k=0;k<N;k++){
      |                     ^
a.cc:14:25: error: 'k' does not name a type
   14 |         for(int k=0;k<N;k++){
      |                         ^
a.cc:21:9: error: expected unqualified-id before 'for'
   21 |         for(int i=0;i<N;i++){
      |         ^~~
a.cc:21:21: error: 'i' does not name a type
   21 |         for(int i=0;i<N;i++){
      |                     ^
a.cc:21:25: error: 'i' does not name a type
   21 |         for(int i=0;i<N;i++){
      |                         ^
a.cc:24:9: error: expected unqualified-id before 'return'
   24 |         return 0;
      |         ^~~~~~
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: C++

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

int main(){
    long long N;
    cin >> N;

    vector<vector<int>> xy;
    for(int i=0;i<N;i++){
        cin >> xy[0][i] >> xy[1][i];
    }

    int ans[N];

    /*
    (xi > xi+1) && (yi > yi+1) OR (xi < xi+1) && (yi < yi+1)
    のとき+1
    */

   /*
   for(long long i=0;i<N;i++){
       ans[i] = 1;
       for(long long j=0;j<N;j++){
            if((xy[0][i] > xy[0][j]) && (xy[1][i] > xy[1][j])){    
                ans[i]++;
            }
            if((xy[0][i] < xy[0][j]) && (xy[1][i] < xy[1][j])){
                ans[i]++;
            }
       }
   }
   */

    sort(xy.begin(),xy.end(),[](const vector<int> &alpha,const vector<int> &beta){return alpha[0] < beta[0];});

    for(int i=0;i<N;i++){
        cout << ans[i] << endl;
    }

}

Compiler output:
a.cc:2:9: fatal error: vector.h: No such file or directory
    2 | #include<vector.h>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include <atcoder/segtree>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;

int op(int a, int b) { return a+b; }

int e() { return  0; }
#define pb push_back
#define mp make_pair
#define F first
#define S second
int main() {
    int n,i;
    scanf("%d", &n);
	vector<pair<ll,pair<ll,ll> > >vec;
	for(i=0;i<n;i++)    
	{
		int a,b;
		cin>>a>>b;
		vec.pb(mp(a,mp(b,i)));	
	}
	sort(vec.begin(),vec.end());
 	vector<int> a(n);
    for (int i = 0; i < n; i++) {
        a[i] = 0;
    }
    segtree<int, op, e> seg(a);
    vector<pair<int,int> >ans(n);
    for (i = 0; i < n; i++) {
        int a=vec[i].first,b=vec[i].second.first,c=vec[i].S.S;
        int tot = seg.prod(0,b-1);
        ans[i] = mp(c,tot);	
        seg.set(b,1);
    }
    for (int i = 0; i < n; i++) {
        a[i] = 0;
    }
    segtree<int, op, e> seg1(a);
    for(i=n-1;i>=0;i--){
    	int a=vec[i].first,b=vec[i].second.first,c=vec[i].S.S;
        int tot = seg1.prod(b-1,n-1);
        ans[i].S += tot;	
        seg1.set(b,1);
	}
	sort(ans.begin(),ans.end());
	for(i=0;i<n;i++)
		cout<<ans[i]<<endl;
}

Compiler output:
a.cc:1:10: fatal error: atcoder/segtree: No such file or directory
    1 | #include <atcoder/segtree>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

#define pb push_back
#define mp make_pair
#define f1 first
#define s2 second

#define fastio ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define debug(x...) cerr << "[" << #x << "]: " << x << "\n";

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef pair<ll, ll> pl;

ld const PI = 4*atan((ld)1);

int const N = 2e5 + 7;

int n;
int res[N];
pair<ii, int> ar[N];
int main()
{
	fastio;

	for (int i = 1; i < N; ++i)
		ds[i] = {i, 1};

	cin >> n;
	for (int i = 0; i < n; ++i)
		cin >> ar[i].f1.f1 >> ar[i].f1.s2, ar[i].s2 = i+1;
	sort(ar, ar+n);

	set<int, greater<int>> st;
	for (int i = 1; i <= n; ++i)
		st.insert(i);

	int idx = 0;
	for (int i = 0; i < n; ++i)
	{
		if (*st.begin() == ar[i].f1.s2)
		{
			for (int j = idx; j <= i; ++j)
				res[ar[j].s2] = i - idx + 1;
			idx = i+1;
		}
		st.erase(ar[i].f1.s2);
	}

	for (int i = 1; i <= n; ++i)
		cout << res[i] << '\n';

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:17: error: 'ds' was not declared in this scope
   29 |                 ds[i] = {i, 1};
      |                 ^~
Language: C++

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

ios::sync_with_stdio(false);
cin.tie(nullptr);


int main() {
  int N;
  cin >> N;
  vector<vector<int>> A(N, vector<int>(2));
  vector<int> count(N);
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < 2; j++) {
      cin >> A.at(i).at(j);
    }
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      if (A.at(i).at(0) >= A.at(j).at(0) && A.at(i).at(1) >= A.at(j).at(1)) {
        count.at(i)++;
      }
      else if (A.at(i).at(0) < A.at(j).at(0) && A.at(i).at(1) < A.at(j).at(1)) {
        count.at(i)++;
      }
    }
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      if (A.at(i).at(0) >= A.at(j).at(0) && A.at(i).at(1) >= A.at(j).at(1)) {
        count.at(i) = max(count.at(i), count.at(j)); 
      }
      else if (A.at(i).at(0) < A.at(j).at(0) && A.at(i).at(1) < A.at(j).at(1)) {
        count.at(i) = max(count.at(i), count.at(j)); 
      }
    }
  }
  for (int i = 0; i < N; i++) {
    cout << count.at(i) << endl;
  }
}


Compiler output:
a.cc:4:1: error: specializing member 'std::basic_ios<char>::sync_with_stdio' requires 'template<>' syntax
    4 | ios::sync_with_stdio(false);
      | ^~~
a.cc:5:1: error: 'cin' does not name a type
    5 | cin.tie(nullptr);
      | ^~~
Language: C++

#include <bits/stdc++.h>

#include <atcoder/all>

#ifdef LOCAL
#include <debug.hpp>
#else
#define debug(...) void()
#endif

using namespace std;
using namespace atcoder;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> x(n), y(n);
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  vector<int> ans(n, 1);
  vector<bool> checked(n, false);
  for (int i = 0; i < n; i++) {
    if (!checked[i]) {
      checked[i] = true;
      vector<int> same;
      for (int j = i + 1; j < n; j++) {
        if ((x[i] > x[j]) ^ (y[i] > y[j])) continue;
        ans[i]++;
        same.emplace_back(j);
        checked[j] = true;
      }
      for (auto&& e : same) {
        ans[e] = ans[i];
      }
    }
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] << '\n';
  }
  return 0;
}

Compiler output:
a.cc:3:10: fatal error: atcoder/all: No such file or directory
    3 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++


//region Template
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#ifdef LOCAL
#include "../debug_prettyprint.hpp"
#else
#define debug(...) 42
#pragma GCC optimize("Ofast")
#pragma GCC target("avx")
#endif
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cout<<fixed<<setprecision(12);
#define FOR(i, n) for(int i=0; i<int(n); i++)
#define RNG(i, f, t) for(int i=int(f); i<=int(t); i++)
#define REV(i, f, t) for(int i=int(f); i>=int(t); --i)
#define ALL(v) (v).begin(), (v).end()
#define EXIT(answer) { cerr<<"EXIT #"<<__LINE__<<endl; cout<<answer<<endl; exit(0); }
#define sz(v) int(v.size())
template<int,typename T> struct MINMAX{ T val; MINMAX(T val) : val(val) {} };
template<typename T> MINMAX<1,T> MAX(T val) { return MINMAX<1,T>(val); };
template<typename T> MINMAX<2,T> MIN(T val) { return MINMAX<2,T>(val); };
template<typename T, typename U> inline T& operator|=(T &lhs, MINMAX<1,U> rhs) { return lhs = max(lhs, rhs.val); }
template<typename T, typename U> inline T& operator|=(T &lhs, MINMAX<2,U> rhs) { return lhs = min(lhs, rhs.val); }
template<typename T, typename U> istream& operator>>(istream& in, pair<T,U> &p) { in>>p.first>>p.second; return in; }
template<typename T> inline vector<T> READ(int n) { vector<T> vec(n); FOR(i,n) cin>>vec[i]; return vec; }
template<typename T> using min_heap = priority_queue<T, vector<T>, greater<T> >;
typedef signed long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
//endregion

signed main() {
    FASTIO

    int n; cin>>n;
    vpii a = READ<pii>(n);
    min_heap<pii> pq;

    dsu ds(n);

    FOR(i,n) {
        pq.push({a[i].first, i});
    }

    map<int,int> yc;

    while(pq.size()) {
        int idx = pq.top().second;
        int y = a[idx].second;
        pq.pop();

        int miny = y;
        while(yc.size() && yc.begin()->first < y) {
            ds.merge(yc.begin()->second, idx);
            miny |= MIN(yc.begin()->first);
            yc.erase(yc.begin());
        }

        yc.insert({miny, idx});
    }

    FOR(i,n) {
        cout<<ds.size(i)<<endl;
    }

}

Compiler output:
a.cc:4:10: fatal error: atcoder/all: No such file or directory
    4 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

// -----------------------------------
// author   : MatsuTaku
// country  : Japan
// created  : 09/20/20 21:00:19
// -----------------------------------

#include <bits/stdc++.h>
#include <atcoder/all>

using namespace std;
using ll = long long;

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);

  int n; cin>>n;
  struct City {
    int x,y,i;
  };

  vector<City> C(n);
  for (int i = 0; i < n; i++) {
    int a,b; cin>>a>>b;
    C[i] = {a,b,i};
  }

  sort(C.begin(), C.end(), [](auto l, auto r) {return l.x<r.x;});
  atcoder::dsu cdsu(n);
  {
    vector<City> tc;
    for (int i = 0; i < n; i++) {
      auto c = C[i];
      bool updated = false;
      for (auto& [x,y,j]:tc) {
        if (y < c.y) {
          cdsu.merge(j, c.i);
          x = c.x;
          y = c.y;
          j = c.i;
          updated = true;
        }
      }
      if (!updated) {
        tc.push_back(c);
      }
    }
  }
  for (int i = 0; i < n; i++) {
    cout << cdsu.size(i) << endl;
  }

  return 0;
}


Compiler output:
a.cc:8:10: fatal error: atcoder/all: No such file or directory
    8 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<map>
#include<atcoder/all>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long li;
#define rep(i,n) for(int i=0;i<(n);i++)
#define df 0
template<class T> void print(const T& t){ cout << t << "\n"; }
template<class T, class... Ts> void print(const T& t, const Ts&... ts) { cout << t; if (sizeof...(ts)) cout << " "; print(ts...); }

// Container コンテナ型, map以外
template< template<class ...> class Ctn,class T>
std::ostream& operator<<(std::ostream& os,const Ctn<T>& v){
  auto itr=v.begin();
  while(itr!=v.end()){
    if(itr!=v.begin())cout << " ";
    cout << *(itr++);
  }
  return os;
}

// map 型
template<class S,class T>
std::ostream& operator<<(std::ostream& os, const map<S,T>& mp){
  for(const pair<S,T>& x: mp){
    cout << "[" << x.first << "]=" << x.second << " ";
  }
  return os;
}

struct deta{
  int a,b,i;
  deta(int x=0,int y=0,int z=0){a=x;b=y;i=z;};
};
std::ostream& operator<<(std::ostream& os, const deta& x){
  print(x.a,x.b,x.i);
  return os;
}

const int operator<(const deta& p1, const deta& p2){
  return p1.a<p2.a;
}

struct less1 {
  bool operator()(const deta& p1, const deta& p2) const{
    return p1.i<p2.i;
  }
};



int main(){
  int n; cin >>n;
  vector<deta> v(n);
  rep(i,n){
    int a,b; cin >>a >>b;
    v[i]={a,b,i};
  }
  sort(v.begin(),v.end());
  if(df)print(v);
  atcoder::dsu d(n);
  map<int,int> mp;
  rep(i,n){
    int b=v[i].b;
    auto itr=mp.lower_bound(b);
    if(itr==mp.begin()){
      mp[b]=v[i].i;
    }else{
      while(itr!=mp.begin()){
        itr--;
        d.merge(v[i].i,itr->second);
        if(itr!=mp.begin())itr=mp.erase(itr);
      }
    }
    if(df)print(mp);
  }
  rep(i,n){
    print(d.size(i));
  }
}


Compiler output:
a.cc:3:9: fatal error: atcoder/all: No such file or directory
    3 | #include<atcoder/all>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

//g++ main.cpp -I /usr/local/include/ac-library
#include<cmath>
#include <atcoder/all>
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
using namespace atcoder;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n); i++)
#define mins(x,y) x=min(x,y)
#define maxs(x,y) x=max(x,y)
#define ALL(a) a.begin(), a.end()
typedef set<int> set_t;
typedef set<string> set_g;
typedef complex<double> xy_t;
static const int NIL = -1;
static const int INF = 1000000007;
#define mp make_pair
#define sz(x) int(x.sise())
#define mod 1000000007
#define reps(i,s,n) for(int i = s; i < n; i++)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
deque<int> deq;
#define fi first
#define se second
//const ll MOD = 998244353;
const ll MOD = (1e+9) + 7;
typedef pair<int, int> P;
typedef vector<ll> vec;
typedef vector<vec> mat;
vector<pair<pair<int,int>,int>> V;
map<int,pair<int,int>> M;
vector<int> S;

int main(){
    int n;
    cin >> n;
    dsu tree=dsu(n);
    rep(i,n){
        int x,y;
        cin >> x>> y;
        V.push_back(mp(mp(x,y),i));
        M.insert(mp(i,mp(x,y)));
    }
    sort(ALL(V));
    rep(i,n){
        bool ind=1;
        rep(j,S.size()){
            if(M[S[j]].fi<V[i].fi.fi&&M[S[j]].se<V[i].fi.se){
                tree.merge(S[j],V[i].se);
                ind=0;
                //j=S.size();
            }else if(M[S[j]].fi>V[i].fi.fi&&M[S[j]].se>V[i].fi.se){
                tree.merge(S[j],V[i].se);
                ind=0;
                //j=S.size();
            }       
        }
        if(ind){
            S.push_back(V[i].se);
        }
    }
    rep(i,n){
        cout<<tree.size(i)<<endl;
    }
    //cout<<S.size()<<endl;
    return 0;
}

Compiler output:
a.cc:3:10: fatal error: atcoder/all: No such file or directory
    3 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>

using namespace std;
typedef long long int ll;

const int MAXN = 2e5 + 5;
int n, par[MAXN], sz[MAXN], comp[MAXN], x[MAXN], y[MAXN], ss = 0;
bool visit[MAXN];
int c = 0;
vector <int> adj[MAXN];

void dfs(int v){
	visit[v] = true;
	sz[c]++; comp[v] = c;
	for(auto u: adj[v])
		if(!visit[u])
			dfs(u);
	return;
}

void dfsall(){
	for(int i = 0; i < n; i++){
		if(visit[i]) continue;
		ss = 0;
		dfs(i);
		c++;
	}
	return;
}


int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> n;
	set <pair<int,int>> s, s2;
	for(int i = 0; i < n; i++){
		cin >> x[i] >> y[i];
		s.insert({-x[i], i});
	}
	while(!s.empty()){
		int ind = s.begin()->second;
		s.erase(*s.begin());
		set <pair<int,int>> :: iterator it = s2.upper_bound({y[ind], 0});
		if(it != s2.end()){
	//		cout << ind + 1 << " -> " << it->second + 1 << '\n';
			adj[ind].push_back(it->second);
			adj[it->second].push_back(ind);
		}
		s2.insert({y[ind], ind});
	}
	dfsall();
	for(int i = 0; i < n; i++)
		cout << sz[comp[i]] << '\n';
	return 0; 
}


Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:13:9: error: reference to 'visit' is ambiguous
   13 |         visit[v] = true;
      |         ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:8:6: note:                 'bool visit [200005]'
    8 | bool visit[MAXN];
      |      ^~~~~
a.cc:16:21: error: reference to 'visit' is ambiguous
   16 |                 if(!visit[u])
      |                     ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:8:6: note:                 'bool visit [200005]'
    8 | bool visit[MAXN];
      |      ^~~~~
a.cc: In function 'void dfsall()':
a.cc:23:20: error: reference to 'visit' is ambiguous
   23 |                 if(visit[i]) continue;
      |                    ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:8:6: note:                 'bool visit [200005]'
    8 | bool visit[MAXN];
      |      ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <climits>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <list>
#include <ctime>
#include <complex>
#include <bitset>
#include <tuple>
#include <random>

#include <atcoder/all>

#define ff first
#define ss second

using namespace std;

using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;

pii operator+(pii a, pii b)
{
    return {a.ff+b.ff,a.ss+b.ss};
}

int op(int a, int b)
{
    return a+b;
}

int e(){
    return 0;
}

int main()
{
    ios::sync_with_stdio(false);
	cin.tie(0);

    int n;
    cin>>n;
    vector<pii> v(n);
    for(int i=0; i<n; i++){
        cin>>v[i].ff>>v[i].ss;
    }
    sort(v.begin(),v.end());
    atcoder::segtree<int,op,e> st1(n),st2(n);
    vector<int> answer(n);
    for(int i=0; i<n; i++){
        answer[i]+=st1.prod(0,v[i].ss);
        st1.set(v[i].ss,1);
    }
    for(int i=n-1; i>=0; i--){
        answer[i]+=st1.prod(v[i].ss,n-1);
        st2.set(v[i].ss,1);
    }
    for(int i=0; i<n; i++) cout<<answer[i]<<"\n";

    return 0;
}


Compiler output:
a.cc:19:10: fatal error: atcoder/all: No such file or directory
   19 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <climits>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <list>
#include <ctime>
#include <complex>
#include <bitset>
#include <tuple>
#include <random>

#define ff first
#define ss second

using namespace std;

using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;

pii operator+(pii a, pii b)
{
    return {a.ff+b.ff,a.ss+b.ss};
}

int op(int a, int b)
{
    return a+b;
}

int e(){
    return 0;
}

int main()
{
    ios::sync_with_stdio(false);
	cin.tie(0);

    int n;
    cin>>n;
    vector<pii> v(n);
    for(int i=0; i<n; i++){
        cin>>v[i].ff>>v[i].ss;
    }
    sort(v.begin(),v.end());
    atcoder::segtree<int,op,e> st1(n),st2(n);
    vector<int> answer(n);
    for(int i=0; i<n; i++){
        answer[i]+=st1.prod(0,v[i].ss);
        st1.set(v[i].ss,1);
    }
    for(int i=n-1; i>=0; i--){
        answer[i]+=st1.prod(v[i].ss,n-1);
        st2.set(v[i].ss,1);
    }
    for(int i=0; i<n; i++) cout<<answer[i]<<"\n";

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:55:5: error: 'atcoder' has not been declared
   55 |     atcoder::segtree<int,op,e> st1(n),st2(n);
      |     ^~~~~~~
a.cc:55:22: error: expected primary-expression before 'int'
   55 |     atcoder::segtree<int,op,e> st1(n),st2(n);
      |                      ^~~
a.cc:58:20: error: 'st1' was not declared in this scope; did you mean 'std'?
   58 |         answer[i]+=st1.prod(0,v[i].ss);
      |                    ^~~
      |                    std
a.cc:62:20: error: 'st1' was not declared in this scope; did you mean 'std'?
   62 |         answer[i]+=st1.prod(v[i].ss,n-1);
      |                    ^~~
      |                    std
a.cc:63:9: error: 'st2' was not declared in this scope; did you mean 'std'?
   63 |         st2.set(v[i].ss,1);
      |         ^~~
      |         std
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <climits>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <list>
#include <ctime>
#include <complex>
#include <bitset>
#include <tuple>
#include <random>

#include "atcoder/segtree"

#define ff first
#define ss second

using namespace std;

using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;

pii operator+(pii a, pii b)
{
    return {a.ff+b.ff,a.ss+b.ss};
}

int op(int a, int b)
{
    return a+b;
}

int e(){
    return 0;
}

int main()
{
    ios::sync_with_stdio(false);
	cin.tie(0);

    int n;
    cin>>n;
    vector<pii> v(n);
    for(int i=0; i<n; i++){
        cin>>v[i].ff>>v[i].ss;
    }
    sort(v.begin(),v.end());
    atcoder::segtree<int,op,e> st1(n),st2(n);
    vector<int> answer(n);
    for(int i=0; i<n; i++){
        answer[i]+=st1.prod(0,v[i].ss);
        st1.set(v[i].ss,1);
    }
    for(int i=n-1; i>=0; i--){
        answer[i]+=st1.prod(v[i].ss,n-1);
        st2.set(v[i].ss,1);
    }
    for(int i=0; i<n; i++) cout<<answer[i]<<"\n";

    return 0;
}


Compiler output:
a.cc:19:10: fatal error: atcoder/segtree: No such file or directory
   19 | #include "atcoder/segtree"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <climits>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <list>
#include <ctime>
#include <complex>
#include <bitset>
#include <tuple>
#include <random>
#include <segtree>

#define ff first
#define ss second

using namespace std;

using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;

pii operator+(pii a, pii b)
{
    return {a.ff+b.ff,a.ss+b.ss};
}

int op(int a, int b)
{
    return a+b;
}

int e(){
    return 0;
}

int main()
{
    ios::sync_with_stdio(false);
	cin.tie(0);

    int n;
    cin>>n;
    vector<pii> v(n);
    for(int i=0; i<n; i++){
        cin>>v[i].ff>>v[i].ss;
    }
    sort(v.begin(),v.end());
    atcoder::segtree<int,op,e> st1(n),st2(n);
    vector<int> answer(n);
    for(int i=0; i<n; i++){
        answer[i]+=st1.prod(0,v[i].ss);
        st1.set(v[i].ss,1);
    }
    for(int i=n-1; i>=0; i--){
        answer[i]+=st1.prod(v[i].ss,n-1);
        st2.set(v[i].ss,1);
    }
    for(int i=0; i<n; i++) cout<<answer[i]<<"\n";

    return 0;
}


Compiler output:
a.cc:18:10: fatal error: segtree: No such file or directory
   18 | #include <segtree>
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <atcoder/dsu>
#define rep(i,n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using V = vector<int>;

int main(int argc, char const *argv[])
{
    int n; cin >> n;
    int x[200010], y[200010];
    rep(i,n) {
        cin >> x[i] >> y[i];
        x[i]--; y[i]--;
    }
    dsu d(n);
    for (int i = 0; i < n; i++)
    {
        for (int j = i+1; j < n; j++)
        {
            if ((x[i]-x[j])*(y[i]-y[j]) > 0) d.merge(i,j);
        }
        
    }
    rep(i,n) cout << d.size(i) << endl;


    return 0;
}


Compiler output:
a.cc:2:10: fatal error: atcoder/dsu: No such file or directory
    2 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <atcoder/all>
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
using namespace std;
using ll = long long int;
using namespace atcoder;
template<typename T>
ostream& operator+(ostream& out, const vector<T> &vec){
    for(const auto &x : vec){
        out<<x<<" ";
    }
    out<<"\n";
    return out;
}
template<typename T>
ostream& operator*(ostream& out, const vector<T> &vec){
    for(const auto &x : vec){
        out+x;
    }
    return out;
}
template<typename T>
istream& operator>>(istream& in, vector<T> &vec){
    for(auto &x : vec){
        in>>x;
    }
    return in;
}
void solve(){
    int n;
    cin>>n;
    vector<int> x(n), y(n);
    for(int i=0;i<n;i++){
        cin>>x[i]>>y[i];
        --x[i];--y[i];
    }
    dsu comp(n);
    vector<int> order(n);
    iota(order.begin(), order.end(), 0);
    sort(order.begin(), order.end(), [&](int l,int r){
        return x[l] < x[r];
    });
    set<int> roots;
    for(const auto &i : order){
        roots.insert(y[i]);
        vector<int> toremove = {y[i]};
        for(const auto &x : roots){
            if(x < y[i]){
                toremove.pb(x);
            }
            else{
                break;
            }
        }
        int left = *min_element(toremove.begin(), toremove.end());
        for(const auto &x : toremove){
            comp.merge(left, x);
            if(x!=left){
                roots.erase(x);
            }
        }
    }
    for(int i=0;i<n;i++){
        cout<<comp.size(y[i])<<"\n";
    }
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
}

Compiler output:
a.cc:1:10: fatal error: atcoder/all: No such file or directory
    1 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<atcoder/dsu>
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
using namespace std;
using ll = long long int;
using namespace atcoder;
template<typename T>
ostream& operator+(ostream& out, const vector<T> &vec){
    for(const auto &x : vec){
        out<<x<<" ";
    }
    out<<"\n";
    return out;
}
template<typename T>
ostream& operator*(ostream& out, const vector<T> &vec){
    for(const auto &x : vec){
        out+x;
    }
    return out;
}
template<typename T>
istream& operator>>(istream& in, vector<T> &vec){
    for(auto &x : vec){
        in>>x;
    }
    return in;
}
void solve(){
    int n;
    cin>>n;
    vector<int> x(n), y(n);
    for(int i=0;i<n;i++){
        cin>>x[i]>>y[i];
        --x[i];--y[i];
    }
    dsu comp(n);
    vector<int> order(n);
    iota(order.begin(), order.end(), 0);
    sort(order.begin(), order.end(), [&](int l,int r){
        return x[l] < x[r];
    });
    set<int> roots;
    for(const auto &i : order){
        roots.insert(y[i]);
        vector<int> toremove = {y[i]};
        for(const auto &x : roots){
            if(x < y[i]){
                toremove.pb(x);
            }
            else{
                break;
            }
        }
        int left = *min_element(toremove.begin(), toremove.end());
        for(const auto &x : toremove){
            comp.merge(left, x);
            if(x!=left){
                roots.erase(x);
            }
        }
    }
    for(int i=0;i<n;i++){
        cout<<comp.size(y[i])<<"\n";
    }
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
}

Compiler output:
a.cc:1:9: fatal error: atcoder/dsu: No such file or directory
    1 | #include<atcoder/dsu>
      |         ^~~~~~~~~~~~~
compilation terminated.