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

#include<iostream>
#include<cmath>
using namespace std;

int main() {
	long long n, m, range;
	cin >> n >> m;
	range = n - 1;
	for (long long i = 0; i < m; i++) {
		cout << i + 1 << " " << i + long long(1) + range << '\n';
		range--;
		range--;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:45: error: expected primary-expression before 'long'
   10 |                 cout << i + 1 << " " << i + long long(1) + range << '\n';
      |                                             ^~~~
Language: C

#include <iostream>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    int n, m;
    cin >> n >> m;
    for (int i = 1; i <= m; ++i)
        cout << i << " " << 2 * m + 1 - i << endl;
    return 0;
}


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: Java

import java.io.*;
import java.util.*;
class Main
{
  public static void main(String [] args)
  {
    Scanner sc=new Scanner(System.in);
    int N=sc.nextInt();
    int M=sc.nextInt();
    if(n%2==0)
      System.out.print(n/2,n/2 + 1);
    else
    {
      int l=1;
      int r=n;
      while(l<=r)
      {
        System.out.println(l+" "+r);
      }
    }
  }
}

Compiler output:
Main.java:10: error: cannot find symbol
    if(n%2==0)
       ^
  symbol:   variable n
  location: class Main
Main.java:11: error: cannot find symbol
      System.out.print(n/2,n/2 + 1);
                       ^
  symbol:   variable n
  location: class Main
Main.java:11: error: cannot find symbol
      System.out.print(n/2,n/2 + 1);
                           ^
  symbol:   variable n
  location: class Main
Main.java:15: error: cannot find symbol
      int r=n;
            ^
  symbol:   variable n
  location: class Main
4 errors
Language: C++

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

int main() {
  long long N,M,A,B;
  cin >>N>>M;
  vector<int>x(N);
  for(int i=0;i<N;i++){
    x[i]=0;
  }
  A=1;
  B=2*M+1;
  for(long long i=0;i<M;i++){
    cout<<A<<" "<<B<<endl;
    A++;
    B--;
    if(B-A==A+N-B){
      B--;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:2: error: expected '}' at end of input
   21 | }
      |  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>

#pragma region Macro
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define SORT(v) sort(v.begin(), v.end())
#define pb(a) push_back(a)
#define eb(a) emplace_back(a)
#define vi vector<int>
#define vvi vector<vector<int>>
#define chmax(x,y) (x = max(x,y))
#define chmin(x,y) (x = min(x,y))

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#pragma endregion

void solve(){
	#define int ll
	// ここに処理を記述
	// コンパイル時はエイリアス「gpp」--> c++17でコンパイル
	
	int N, M;
	cin >> N >> M;

	int left = n / 2;
	int right = (n + 1) / 2;

	rep(i, m){
		cout << left << " " << right << endl;
		left--;
		right++;
	}

}

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	
	solve();
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:27:20: error: 'n' was not declared in this scope
   27 |         int left = n / 2;
      |                    ^
a.cc:30:16: error: 'm' was not declared in this scope
   30 |         rep(i, m){
      |                ^
a.cc:4:44: note: in definition of macro 'rep'
    4 | #define rep(i, n) for(int i = 0; i < (int)(n); i++)
      |                                            ^
Language: C++

#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define sz(a) a.size()
#define re return
#define all(a) a.begin(),a.end()
#define int long long
using namespace std;
int a[100005];
signed main()
{
	int n,m;
	cin>>n>>m;
	if (n%2==1){
		for (int i=1;i<=m;i++){
			cout<<i<<' '<<n-i<<endl;
		}
		re 0;
	}
	int res=0;
	for (int i=1;i<n;i++){
		if (res==m)  re 0;
		if (a[i]==1)  continue;
		for (int j=i+1;j<n;j++){
			if (n%(j-i)!=0 || j=i+1) {cout<<i<<' '<<j<<endl;res++;a[i]=1;a[j]=1;break;}
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:40: error: lvalue required as left operand of assignment
   25 |                         if (n%(j-i)!=0 || j=i+1) {cout<<i<<' '<<j<<endl;res++;a[i]=1;a[j]=1;break;}
      |                             ~~~~~~~~~~~^~~~
Language: C++

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

int main(){
    int n, m;
    cin >> n >> m;
    
    for(int i=0; i<m; i++){
      cout << 1+i << " " << N-i <<endl;
    }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:29: error: 'N' was not declared in this scope
    9 |       cout << 1+i << " " << N-i <<endl;
      |                             ^
Language: C++

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

int main() {
  int N,M;
  cin>>N>>M;
  int K=N;
  for(int i=1 ;i<=M; i++){
    cout<<i<<" "<<N<<endl;
    K--;
    if(K-i<=N) i++:
    
  }
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: expected ';' before ':' token
   11 |     if(K-i<=N) i++:
      |                   ^
      |                   ;
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;

//typedef
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//conversion
inline LL toLong(string s) {LL v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) LL((a).size())
#define EACH(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define UNTIL(p) while(!(p))

//constant
const double EPS = 1e-5;
const double PI  = acos(-1.0);

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

#define PUTS(x) cout << (x) << endl;

LL used[100005] = {0};
int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    LL n,m;
    cin>>n>>m;
    LL x = 1;
    LL y = n;
    REP(i,m){
        while(true){
            LL a = y - x;
            LL b = n - a;
            if(used[a] == 0 && used[b] == 0){
                used[a]++;
                used[b]++;
                break;
            }
            y--;
            if(x >= y){
                // 通らないはず
                PUTS("????");
                break;
            }
        }
        cout<< x << " " << y <<endl;
        x++;
        y--;
    }
}
/*
n = 10
1 9 | 8 2
2 8 | 6 4
3 6 | 3 7
4 5 | 1 9

1 10 | 9 1
2 9  | 7 3
3 7  | 4 6
4 6  | 2 8
*/

/*
1 6 | 5 2 
2 5 | 3 4
3 4 | 1 6

1 7 | 6 1
2 6 | 4 3
3 5 | 2 5

r1
a b c d e f g
1 2 3 4 5 6 7
a f
b e
c d

r2
a b c d e f g
2 3 4 5 6 7 1
e g
a d
b c

r3
a b c d e f g
3 4 5 6 7 1 2
d f
c g
a b

r4
a b c d e f g
4 5 6 7 1 2 3
c e
b f
a g

r5
a b c d e f g
5 6 7 1 2 3 4
d b
a e
f g

r6
a b c d e f g
6 7 1 2 3 4 5
a c
d g
e f

r7
a b c d e f g
7 1 2 3 4 5 6
b g
c f
d e
*

Compiler output:
a.cc:107:1: error: unterminated comment
  107 | /*
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e,i,j;
int main(){
	ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin>>n>>m;
	for(i=1; i<=m; i++){
		cout<<i<<" "<<n-i+1<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |         cin>>n>>m;
      |              ^
      |              yn
a.cc:6:17: error: 'm' was not declared in this scope; did you mean 'tm'?
    6 |         cin>>n>>m;
      |                 ^
      |                 tm
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){int i,n,m,l,r,c;
cin>>n>>m;
c=m;
l=1;
r=m+2;
for(i=1;i<=m;i++){
    if(i%2){
        cout<<l<<" "l+c<<"\n";
        c--;l++;
    }else{cout<<r<<" "<<r+c<<"\n";
        c--;r++;
    }
}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: unable to find string literal operator 'operator""l' with 'const char [2]', 'long unsigned int' arguments
   10 |         cout<<l<<" "l+c<<"\n";
      |                  ^~~~
Language: C++

//#pragma GCC optimize("Ofast")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define mod 998244353
#define fi first
#define se second
#define pii pair<int,int>
#define int long long
#define endl '\n'
#define pll pair<long long,long long>
#define LONGLONG_MAX 100000000000000
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
long long power(long long a,long long b){
    long long ans=1;
    while(b>0){
        if(b&1){ans=(ans*a)%mod;}
                a=(a*a)%mod;
                b>>=1;
        }
    return ans;
        
}

int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n,m;
    cin>>n>>m;
    if(n&1){
        n--;
        for(int i=0;i<m;i++){
            cout<<i+1<<" "<<n-i<<endl;
        }
    }
    else{
        for(int i=0;i<m;i++){
            else cout<<i+2<<" "<<n-i<<endl;
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:44:13: error: 'else' without a previous 'if'
   44 |             else cout<<i+2<<" "<<n-i<<endl;
      |             ^~~~
Language: Java

import java.util.*;
import java.math.*;
public class RotationMatching {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt(), M = in.nextInt();
        HashSet<Integer> set = new HashSet<>();
        boolean subOne = false;
        for (int i = 0; i < M; i++) {
            int left = i;
            if (set.contains(N - 1 - i - i) || set.contains(i + N - (N - 1 - i))) {
                subOne = true;
            }
            int right = N - 1 - i - (subOne ? 1 : 0);
            System.out.println((left + 1) + " " + (right + 1));
            set.add(right - left);
            set.add(left + N - right);
        }
        System.out.println(set.size() == M * 2);
    }
}

Compiler output:
Main.java:3: error: class RotationMatching is public, should be declared in a file named RotationMatching.java
public class RotationMatching {
       ^
1 error
Language: C++

//#pragma GCC optimize("Ofast")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define mod 998244353
#define fi first
#define se second
#define pii pair<int,int>
#define int long long
#define endl '\n'
#define pll pair<long long,long long>
#define LONGLONG_MAX 100000000000000
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
long long power(long long a,long long b){
    long long ans=1;
    while(b>0){
        if(b&1){ans=(ans*a)%mod;}
                a=(a*a)%mod;
                b>>=1;
        }
    return ans;
        
}

int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n,m;
    cin>>n>>m;
    if(n&1){
        n--;
        for(int i=0;i<m;i++){
            cout<<i+1<<" "<<n-i<<endl;
        }
    }
    else{
        n-=2;
        for(int i=0;i<m;i++){
            else cout<<i+1<<" "<<n-i<<endl;
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:45:13: error: 'else' without a previous 'if'
   45 |             else cout<<i+1<<" "<<n-i<<endl;
      |             ^~~~
Language: C

#include<stdio.h>

int main(void)
{
	unsigned long int a, b, c;
	int i = 0;
	

	scanf("%ld%ld", &a, &b);

	if (0 != a % 2) {
		a = a - 1;
		for (i = 0; b > i; i++) {
			printf("%ld %ld\n", (i + 1), (a - i));
		}
	}

		else {
		for (i = 0; b > i; i++) {
			if (i < b / 2){
			printf("%ld %ld\n", (i + 1), (a - i - 1));
		}
			else {
				printf("%ld %ld\n", (i + 2), (a - i - 1));
			}

	}


	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:31:1: error: expected declaration or statement at end of input
   31 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

int main()
{
  //入力
  long int n,m;
  cin>> n>> m;

  //操作
  if(2*m+1>n) return 1;
  
  
  
  //出力
  cout<< value <<endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:10: error: 'value' was not declared in this scope
   16 |   cout<< value <<endl;
      |          ^~~~~
Language: C++

#include<bits/stdc++.h>
#define int long long
using namespace std;
constexpr int mod=1e9+7;
signed main(){
    int m;
    cin>>m>>m;
    for(int i=0;i<(n+1)/2;i++)
        cout<<i+1<<' '<<(n+1)/2*2-i<<endl;
    for(int i=0;i<n/2;i++)
        cout<<(n+1)/2*2+1+i<<' '<<n*2+1-i<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: 'n' was not declared in this scope
    8 |     for(int i=0;i<(n+1)/2;i++)
      |                    ^
a.cc:10:19: error: 'n' was not declared in this scope
   10 |     for(int i=0;i<n/2;i++)
      |                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int n,m;
  cin>>n>>m;
  int k = n/2;
  int l = k+1;
  for(int i=0; i<m; i++){
    cout<<k<<' '<< l<<endl;
      k--;
    l++;
}


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

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

int main() {
    int64_t N, M;
    cin >> N >> M;
    for (int64_t i = 1; i <= M; i++) {
        cout << N / 2 - i + 1 << " " << N / 2 + i + 1 << endl;
    }
    return 0;

    if (N % 2 == 1) {
        for (int64_t i = 1; i <= M; i++) {
            cout << N / 2 - i + 1 << " " << N / 2 + i + 1 << endl;
        }
        return 0;
    }

    assert(false);

    set<int64_t> st;
    for (int64_t i = 1; i <= N; i++) {
        st.insert(i);
    }

    vector<pair<int64_t, int64_t>> ans;
    vector<bool> diff(M + 1, false);
    for (int64_t i = 1; i <= M; i++) {
        auto l = st.begin();
        st.erase(l);
        
        for (int64_t d = 1; ; d++) {
            if ()
        }

        int64_t l_value = *l;
        auto r = st.lower_bound(l_value + i);
        ans.emplace_back(l_value, *r);
        cout << l_value << " " << *r << endl;
        st.erase(r);
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:17: error: expected primary-expression before ')' token
   33 |             if ()
      |                 ^
a.cc:34:9: error: expected primary-expression before '}' token
   34 |         }
      |         ^
Language: C++

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


void solve(long long N, long long M){
    for(int i=1;i<=M;i++)
    {
        cout<<i<<' '<<(N-i+1)%(2*m)<<endl;
    }
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    scanf("%lld",&N);
    long long M;
    scanf("%lld",&M);
    solve(N, M);
    return 0;
}


Compiler output:
a.cc: In function 'void solve(long long int, long long int)':
a.cc:8:34: error: 'm' was not declared in this scope
    8 |         cout<<i<<' '<<(N-i+1)%(2*m)<<endl;
      |                                  ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

using ll = long long;

constexpr char newl = '\n';

bool judge()

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

    int n, m;
    cin >> n >> m;

    set<int> s;
    for (int i = 0; i < n; i++) {
        s.insert(i);
    }

    int j1 = 0, j2 = 1;
    set<int> s2;
    for (int i = 0; i < m; i++) {
        int d = abs(j1 - j2);
        if (d * 2 > n) d = n - d;
        if (s2.find(d) != s2.end()) {
            j2 = (j2 + 1) % n;
            --d;
        }
        assert(s2.find(d) == s2.end());
        assert(d > 0);
        s2.insert(d);

        assert(s.find(j1) != s.end());
        s.erase(j1);
        assert(s.find(j2) != s.end());
        s.erase(j2);

        cout << j1 + 1 << " " << j2 + 1 << newl;

        j1 = (j1 + n - 1) % n;
        j2 = (j2 + 1) % n;
    }

    return 0;
}

Compiler output:
a.cc:11:1: error: expected initializer before 'int'
   11 | int main() {
      | ^~~
Language: C++

#include<iostream>
#include<stdio.h>
#include<vector>
#include<cmath>
#include<queue>
#include<string.h>
#include<map>
#include<set>
#include<algorithm>
#define ll long long
#define pi pair < ll,ll >
#define mp(a,b) make_pair(a,b)
#define mid (low+high)/2
#define rep(i,a,b) for(int i = a;i < b;i++)
#define N 300004
#define INF 1e9+7

using namespace std;

ll ans[N];
ll n,m;

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

    cin >> n >> m;
    ll cnt=  0;

    if(n%4==2)
        p = n-1;

    rep(i,1,m+1)
    {
        cout << i << " " << p << endl;
        p--;
    }
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:32:9: error: 'p' was not declared in this scope
   32 |         p = n-1;
      |         ^
a.cc:36:29: error: 'p' was not declared in this scope
   36 |         cout << i << " " << p << endl;
      |                             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
#define get_unique(x) x.erase(unique(all(x)), x.end());
typedef long long ll;
typedef complex<double> Complex;
const int INF = 1e9;
const ll MOD = 1e9 + 7;
const ll LINF = 1e18;
template <class T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> v) {
    for (int i = 0; i < sz(v); i++) {
        os << v[i];
        if (i < sz(v) - 1) os << " ";
    }
    return os;
}
int main() {
    int n, m;
    cin >> n >> m;
    for (int i = 1; i <= n; i++) st.insert(i);
    {
        int a = 1, b = m + 1;
        for (int i = m; i >= 1; i -= 2) {
            assert(b <= n);
            cout << a << " " << b << endl;
            a++;
            b--;
        }
    }
    {
        int a = m + 2, b = 2 * m + 1;
        for (int i = m - 1; i >= 1; i -= 2) {
            assert(b <= n);
            cout << a << " " << b << endl;
            a++;
            b--;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:34: error: 'st' was not declared in this scope; did you mean 'std'?
   48 |     for (int i = 1; i <= n; i++) st.insert(i);
      |                                  ^~
      |                                  std
Language: Java

import java.util.*;
public class test {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int left = 1, right = n;
		while(m > 0) {
			int step = n - right + 1;
			if(left + step == right) {
				right--;
				continue;
			}
			System.out.println(left + " " + right);
			left++;
			right--;
			m--;
		}
    }
}

Compiler output:
Main.java:2: error: class test is public, should be declared in a file named test.java
public class test {
       ^
1 error
Language: C++

#include <iostream>
using namespace std;

int main(){
  long long n, m;
  cin >> n >> m;
  if(n%2==1){
    for(long long i=0;i<m;i++){
      cout << i+1 << " " << 2*m-i << endl;
    }
  }else{
    for(long long i=0;i<m;i++){
      cout << i+1 << " " << 2*m-i+1 << endl;
  }
}

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

20200502 E
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		long n=sc.nextLong();
		long m=sc.nextLong();
		if(n%2==1){
			for(int i=0;i<m;i++){
				System.out.println((i+1)+" "+(n-(i+1)));
			}
		}else{
			for(int i=0;i<m;i++){
				if(i%2=0){
					System.out.println((i+1)+" "+(n-(i+1)));
				}else{
					System.out.println((n/2-i)+" "+(n/2+i+2));
				}
			}
		}
	}
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
20200502 E
^
1 error
Language: C++

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

int main() {
  int N,M;
  cin>>N>>M;
  int K=2*M+1;
  for(int i=1 ;i<=M; i++){
    cout<<i<<" "<<K<<endl;
    K++
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: expected ';' before '}' token
   10 |     K++
      |        ^
      |        ;
   11 |   }
      |   ~
Language: C++

include<bits/stdc++.h>
using namespace std;
 
int main(){
	int n,m,m2,d;
	set<int>diffs;
	cin>>n>>m;
	m2=m;
	for(int i=1;i<=n;i++){
		d=n-i-i+1;
		if(((2*d)+1)%n==1)continue;
		cout<<i<<" "<<n-i+1<<"\n";
		m2--;
		if(m2==0)break;
	}
	return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'set' was not declared in this scope
    6 |         set<int>diffs;
      |         ^~~
a.cc:6:13: error: expected primary-expression before 'int'
    6 |         set<int>diffs;
      |             ^~~
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin>>n>>m;
      |         ^~~
a.cc:12:17: error: 'cout' was not declared in this scope
   12 |                 cout<<i<<" "<<n-i+1<<"\n";
      |                 ^~~~
Language: C++

#include<iostream>
#include<cmath>
#include<numeric>
#include<functional>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<n;i++)
#define ll long long
using namespace std;

int main(){
  int n,m;
  cin>>n>>m;
  if(n%2==1){
    for(int i=1;i<=m;i++){
      cout<<i<<" "<<n+1-i<<"\n";
    }
  }else if(n%4==2){
    int k=(n-2)/4;
    for(int i=1;i<=min(m,k+1);i++){
      cout<<i<<" "<<n+1-i<<"\n";
    }
    if(m>=k+2){
      for(int i=k+2;i<=m;i++){
        cout<<i<<" "<<n-i<<"\n";
      }
    }
  else{
    int k=(n-4)/4;
    for(int i=1;i<=min(m,k+1);i++){
      cout<<i<<" "<<n+1-i<<"\n";
    }
    if(m>=k+2){
      for(int i=k+2;k<=m;i++){
        cout<<i<<" "<<n-i<<"\n";
      }
    }
  }
}

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

#include <iostream>
#include <sstream>
#include <stack>
#include <iomanip>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <map>
#include <set>
#include <vector>
#include <utility>
#include <queue>
#include <cmath>

#define BEGIN(x) x.begin()
#define END(x) x.end()
#define ALL(x) BEGIN(x), END(x)
#define PAIR make_pair
#define VEC(type) vector<type >

#define FOR(i, A, B) for(auto i = (A);i != (B); i++)
#define FORD(i, A, B) for(auto i = (A);i != (B); i--)

#define READRANGE(begin, end) FOR(it, begin, end) cin >> *it
#define READVEC(V) READRANGE(BEGIN(V), END(V))

using namespace std;

typedef long long lint;
typedef pair<int, int> Pii;
typedef pair<int, lint> Pil;
typedef pair<lint, lint> Pll;
typedef pair<lint, int> Pli;

// ---- BEGIN LIBRARY CODE ----
// ---- END LIBRARY CODE ----
void io_init()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
};

int main(int argc, char **argv)
{
    io_init();

    // Actual program code starts here.
    int N, M;
    cin >> N >> M;
    set<int> seen;
    FOR(i, 0, M) {
        int a = i + 1, b = N - i;
        assert(seen.count(a) == 0 && seen.count(b) == 0);
        seen.insert(a);
        seen.insert(b);
        cout << a << " " << b << endl;
    }

    return 0;
};


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:55:9: error: 'assert' was not declared in this scope
   55 |         assert(seen.count(a) == 0 && seen.count(b) == 0);
      |         ^~~~~~
a.cc:16:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
   15 | #include <cmath>
  +++ |+#include <cassert>
   16 |
Language: Java

import java.util.*;import java.io.*;import java.math.*;
public class Solution
{
    public static void process()throws IOException
    {
        int n=ni();
        int m=ni();
        int x=1,y=n-1;
        for(int i=0;i<m;i++)
        {
            pn(x+" "+y);
            x++;
            y--;
        }
    }

    static AnotherReader sc;
    static PrintWriter out;
    public static void main(String[]args)throws IOException
    {
        boolean oj =true;
        if(oj){sc=new AnotherReader();out=new PrintWriter(System.out);}
        else{sc=new AnotherReader(100);out=new PrintWriter("output.txt");}
        int t=1;
        // t=ni();
        while(t-->0) {process();}
        out.flush();out.close();  
    }

    static void pn(Object o){out.println(o);}
    static void p(Object o){out.print(o);}
    static void pni(Object o){out.println(o);out.flush();}
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static double nd()throws IOException{return sc.nextDouble();}
    static String nln()throws IOException{return sc.nextLine();}
    static int[] nai(int N)throws IOException{int[]A=new int[N];for(int i=0;i!=N;i++){A[i]=ni();}return A;}
    static long[] nal(int N)throws IOException{long[]A=new long[N];for(int i=0;i!=N;i++){A[i]=nl();}return A;}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}

/////////////////////////////////////////////////////////////////////////////////////////////////////////

    static class AnotherReader{BufferedReader br; StringTokenizer st;
    AnotherReader()throws FileNotFoundException{
    br=new BufferedReader(new InputStreamReader(System.in));}
    AnotherReader(int a)throws FileNotFoundException{
    br = new BufferedReader(new FileReader("input.txt"));}
    String next()throws IOException{
    while (st == null || !st.hasMoreElements()) {try{
    st = new StringTokenizer(br.readLine());}
    catch (IOException  e){ e.printStackTrace(); }}
    return st.nextToken(); } int nextInt() throws IOException{
    return Integer.parseInt(next());}
    long nextLong() throws IOException
    {return Long.parseLong(next());}
    double nextDouble()throws IOException { return Double.parseDouble(next()); }
    String nextLine() throws IOException{ String str = ""; try{
    str = br.readLine();} catch (IOException e){
    e.printStackTrace();} return str;}}
   
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
}

Compiler output:
Main.java:2: error: class Solution is public, should be declared in a file named Solution.java
public class Solution
       ^
1 error
Language: C++

#include <iostream>
#include <numeric>
#include <stdio.h>
#include <iomanip>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
using ll = long long;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
int Max(long long(a), long long(b), long long(c)) {
	return max(max(a,b), c);
}
int Min(long long(a), long long(b), long long(c)) {
	return min(min(a, b), c);
}

int cnt(ll N) {
	int digits = 0;

	while (N > 0) {
		N /= 10;
		digits++;
	}

	return digits;
}



int main() {
	ll N,M;
	cin >>N>>M;
	if (N % 2 == 1) {
		rep(i, M) {
			cout << i + 1 <<" "<< N - i << endl;
		}
	}
	else if (N %4== 0) {
		rep(i, N / 4) {
			cout << i + 1 << " " << N - i << endl;
		}
		for (int i = N / 4; i < M; i++) {
			cout << i + 2 << " " << N - i << endl;
		}
	}
	else{ 
		rep(i, M) {
			cout << i + 1 << " " << N - i << endl;
		}
	}
	}
	
	

	
}


Compiler output:
a.cc:70:1: error: expected declaration before '}' token
   70 | }
      | ^
Language: C++

#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <algorithm> 
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (ll)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vc = vector<char>;
using vvc = vector<vc>;
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; 
}
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll n,m;
  cin>>n>>m;
  ll s,b
  s=n/2;
  b=n/2+2;
  rep(i,m){
    cout<<s<<" "<<b<<endl;
    s--;
    b++;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:3: error: expected initializer before 's'
   53 |   s=n/2;
      |   ^
a.cc:54:3: error: 'b' was not declared in this scope
   54 |   b=n/2+2;
      |   ^
Language: C++

#include <bits/stdc++.h>
//#pragma GCC optimize ("O3")
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,abm,mmx,avx,avx2,tune=native")
//Use above if bruteforcing with lots of small operations. Or just use it anytime, there's no downside.
//AVX is better slightly
using namespace std;
typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef long double ld;

#define rc(s) return cout << s, 0
#define fi first
#define se second
#define L (nod << 1)
#define R (L | 1)
#define smax(X, Y) ((X) > (Y) ? (X) : (Y))
#define smin(X, Y) ((X) < (Y) ? (X) : (Y))

const ll inf = (1LL<<62);
const int iinf = (1<<30);
//CLOCKS_PER_SEC

int n, m;

int main(){
    //mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    //ios_base::sync_with_stdio(0); cin.tie(0);
    //ifstream cin ("test.in");
    cin >> n >> m;
    assert(n % 2);
    for (int i=1; i<=m; i++)
        cout << i << ' ' << n - i + () << '\n';
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:38: error: expected primary-expression before ')' token
   34 |         cout << i << ' ' << n - i + () << '\n';
      |                                      ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m;
  cin>>n>>m;
  for(int i=1;i<=m;i++){
    cout<<i n-i<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: expected ';' before 'n'
    7 |     cout<<i n-i<<endl;
      |            ^~
      |            ;
Language: C

#include <bits/stdc++.h>
#define int long long
using namespace std;
const int maxN=200005;
int n,cnt;
int c[maxN],b[maxN];
int m[maxN];
vector <int> a[maxN];
int tree[4*maxN+5];
int ans[maxN];
void update(int node,int l,int r,int pos,int val)
{
    if (pos<l||pos>r) return;
    if (l>r) return;
    if (l==r)
    {
        //cout<<pos<<endl;
        tree[node]=val;
        return;
    }
    int mid=(l+r)/2;
    update(node*2,l,mid,pos,val);
    update(node*2+1,mid+1,r,pos,val);
    tree[node]=max(tree[node*2],tree[node*2+1]);
}
int query(int node,int l,int r,int u,int v)
{
    if (u>r||v<l) return 0;
    if (l>r) return 0;
    if (u<=l&&r<=v) return tree[node];
    int mid=(l+r)/2;
    int ml=query(node*2,l,mid,u,v);
    int mr=query(node*2+1,mid+1,r,u,v);
    return max(ml,mr);
}
void dfs(int u,int p)
{
    //cout<<u<<" "<<m[c[u]]<<'\n';
    int x=query(1,1,cnt,1,m[c[u]]-1);
    ans[u]=x+1;
    update(1,1,cnt,m[c[u]],ans[u]);
    for (int v:a[u])
        if (v!=p) dfs(v,u);
    update(1,1,cnt,m[c[u]],0);
}
int32_t main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        int x;
        cin>>c[i];
        b[i]=c[i];
    }
    for (int i=1;i<n;i++)
    {
        int x,y;
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    sort(b+1,b+1+n);
    for (int i=1;i<=n;i++)
        if (!m[b[i]]) m[b[i]]=++cnt;
    dfs(1,0);
    for (int i=1;i<=n;i++)
        cout<<ans[i]<<endl;
    return 0;
}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}
 
bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=std::sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}
 
long long gcd_(long long a, long long b){
  if(a<b){
    std::swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}
 
using namespace std;
//using namespace boost::multiprecision;
//using namespace __gnu_pbds;

const int MAX_N = 200'050;

vector<int> G[MAX_N];
long long dp[MAX_N]; //長さiの増加部分列の末尾として取りうる最小値をdp[i]として持つ
long long ans[MAX_N];

void dfs(int v, vector<int>& a, int p = -1){
  int index = lower_bound(dp, dp + MAX_N, a[v]) - dp;
  long long old_val = dp[index];
  ans[v] = lower_bound(dp, dp + MAX_N, INF) - dp - 1;
  for(int nv: G[v]){
    if(nv == p) continue;
    dfs(nv, a, v);
  }
  dp[index] = old_val;
  return;
}

int main(){
  //using namespace std;
  int n;
  cin>>n;
  vector<long long> a(n);
  REP(i, n) cin>>a[i];
  int u[n - 1], v[n - 1];
  REP(i, n - 1){
    cin>>u[i]>>v[i];
    u[i]--; v[i]--;
  }
  
  REP(i, n - 1){
    G[u[i]].push_back(v[i]);
    G[v[i]].push_back(u[i]);
  }
  REP(i, MAX_N) dp[i] = INF;
  dp[0] = -INF;
  
  dfs(0, a);
  
  REP(i, n) cout << ans[i] << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:106:10: error: invalid initialization of reference of type 'std::vector<int>&' from expression of type 'std::vector<long long int>'
  106 |   dfs(0, a);
      |          ^
a.cc:75:30: note: in passing argument 2 of 'void dfs(int, std::vector<int>&, int)'
   75 | void dfs(int v, vector<int>& a, int p = -1){
      |                 ~~~~~~~~~~~~~^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll read(){
	ll a=0,b=getchar(),c=1;
	while(!isdigit(b))c=b=='-'?-1:1,b=getchar();
	while(isdigit(b))a=a*10+b-'0',b=getchar();
	durn a*c;
}
const int N=2e5+5;
vector<int> g[N];
int n,ab,a[N],ans[N],b[N],c[N],d[N];
void dfs(int x,int y){
	if(ans[ab]<a[x]){
		b[x]=ab+1,c[x]=0;
		ans[++ab]=a[x];
	}
	else{
		b[x]=lower_bound(ans+1,ans+1+ab,a[x])-ans;
		c[x]=ans[b[x]];
		ans[b[x]]=a[x];
	}
	d[x]=ab;
	for(int i=0;i<g[x].size();i++)
		if(g[x][i]!=y)dfs(g[x][i],x);
	if(c[x]==0)ab--;
	else ans[b[x]]=c[x];
}
int main(){
	n=read();
	for(int i=1;i<=n;i++)
		a[i]=read();
	for(int i=1;i<n;i++){
		int x=read(),y=read();
		g[x].push_back(y),g[y].push_back(x);
	}
	dfs(1,-1);
	for(int i=1;i<=n;i++)
		cout << d[i] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'll read()':
a.cc:8:9: error: 'durn' was not declared in this scope
    8 |         durn a*c;
      |         ^~~~
a.cc:9:1: warning: no return statement in function returning non-void [-Wreturn-type]
    9 | }
      | ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <string.h>
#include <stack>
#include <assert.h>
#include <bitset>
#include <self/utility>
#include <self/debug>
using namespace std;

template <typename T>
struct SegmentTreemaxInterval//[)
{
	const T unchanged=-1;
	const T minValue=0;
	T* data;
	T* tag;
	int nn;
	int size()
	{
		return nn;
	}
	void init(int size)
	{
		nn=1;
		while(nn<size)
		{
			nn<<=1;
		}
		data=new T[nn*2+5];
		tag=new T[nn*2+5];
		for(int i=0;i<=nn*2;i++)
		{
			data[i]=minValue;
			tag[i]=unchanged;
		}
	}
	void build(int a[],int len)
	{
		for(int i=0;i<len;i++)
		{
			data[i+nn]=a[i];
		}
		for(int i=nn-1;i>=1;i--)
		{
			data[i]=max(data[i*2],data[i*2+1]);
		}
	}
	void pushdown(int x)
	{
		if(x>=nn) return;
		if(tag[x]==unchanged) return;
		data[x*2]=tag[x];
		data[x*2+1]=tag[x];
		tag[x*2]=tag[x];
		tag[x*2+1]=tag[x];
		tag[x]=unchanged;
	}
	void change(int ql,int qr,T value)
	{
		change(1,0,nn,ql,qr,value);
	}
	void change(int x,int l,int r,int ql,int qr,T value)
	{
		if(l>=qr || r<=ql) return;
		pushdown(x);
		if(l>=ql && r<=qr)
		{
			data[x]=value;
			tag[x]=value;
			return;
		}
		change(x*2,l,l+r>>1,ql,qr,value);
		change(x*2+1,l+r>>1,r,ql,qr,value);
		data[x]=max(data[x*2],data[x*2+1]);
	}
	T query(int ql,int qr)
	{
		return query(1,0,nn,ql,qr);
	}
	T query(int x,int l,int r,int ql,int qr)
	{
		if(l>=qr || r<=ql) return minValue;
		pushdown(x);
		if(l>=ql && r<=qr)
		{
			return data[x];
		}
		return max(query(x*2,l,l+r>>1,ql,qr),query(x*2+1,l+r>>1,r,ql,qr));
	}
};
SegmentTreemaxInterval <int> sgt;

vector <int> vec[200005];
int n;
int dp[200005];
vector <int> lsh;
int a[200005];

void dfs(int x,int p)
{
	int i=x;
	chmax(dp[x],sgt.query(0,a[x])+1);
	int t=sgt.query(a[x],a[x]+1);
	sgt.change(a[x],a[x]+1,dp[x]);
	for(auto u:vec[x])
	{
		if(u==p) continue;
		chmax(dp[u],dp[x]);
		dfs(u,x);
	}
	sgt.change(a[i],a[i]+1,t);
}

int main()
{
//	freopen("input.txt","r",stdin);
//	freopen("output.txt","w",stdout);
	cin>>n;
	sgt.init(n);
	for(int i=0;i<n;i++)
	{
		scanf("%d",a+i);
		lsh.push_back(a[i]);
	}
	sort(all(lsh));
	lsh.erase(unique(all(lsh)),lsh.end());
	for(int i=0;i<n;i++)
	{
		a[i]=lower_bound(all(lsh),a[i])-lsh.begin();
	}
	for(int i=0;i<n-1;i++)
	{
		int x,y;
		scanf("%d%d",&x,&y);
		x--;
		y--;
		vec[x].push_back(y);
		vec[y].push_back(x);
		
	}
	dfs(0,-1);
	for(int i=0;i<n;i++)
	{
		printf("%d\n",dp[i]);
	}
	return 0;
}

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

#include <iostream>
#include <vector>
#include <limits>
using namespace std;

void dfs(const vector<vector<int>> &e, const vector<int> &a, vector<bool> &v, int x, vector<int> &f, vector<int> &ans) {
  v[x] = true;
  int d = distance(f.begin(), lower_bound(f.begin(), f.end(), a[x]));
  int t = f[d];
  f[d] = a[x];
  ans[x] = distance(f.begin(), lower_bound(f.begin(), f.end(), INT_MAX));

  for (int i = 0; i < e[x].size(); i++)
    if (!v[e[x][i]])
      dfs(e, a, v, e[x][i], f, ans);

  f[d] = t;
}

int main() {
  int n;
  scanf("%d", &n);
  vector<int> a(n);
  for (int i = 0; i < n; i++)
    scanf("%d", &a[i]);

  vector<vector<int>> e(n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d %d", &u, &v);

    u--, v--;
    e[u].emplace_back(v);
    e[v].emplace_back(u);
  }

  vector<bool> v(n);
  vector<int> f(n, INT_MAX), ans(n);
  dfs(e, a, v, 0, f, ans);

  for (int i = 0; i < n; i++)
    printf("%d\n", ans[i]);

  return 0;
}

Compiler output:
a.cc: In function 'void dfs(const std::vector<std::vector<int> >&, const std::vector<int>&, std::vector<bool>&, int, std::vector<int>&, std::vector<int>&)':
a.cc:11:64: error: 'INT_MAX' was not declared in this scope
   11 |   ans[x] = distance(f.begin(), lower_bound(f.begin(), f.end(), INT_MAX));
      |                                                                ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <limits>
  +++ |+#include <climits>
    4 | using namespace std;
a.cc: In function 'int main()':
a.cc:38:20: error: 'INT_MAX' was not declared in this scope
   38 |   vector<int> f(n, INT_MAX), ans(n);
      |                    ^~~~~~~
a.cc:38:20: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define eb emplace_back

using ll = long long;
using vll = vector<ll>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using P = pair<int, int>;

const int INF = 1001001001;

vvi to;
vi a;
vi ans;
vi lis;

void dfs(int v = 0, int p = -1){
    auto it = lower_bound(all(lis), a[v]);
    change = int(it - lis.begin());
    value = *it;
    
    *it = a[v];
    int l = lower_bound(all(lis), INF) - lis.begin();
    ans[v] = l - 1;
    
    for(auto u : to[v]){
        if(u == p) continue;
        dfs(u, v);
    }
    lis[change] = value;
    return;
}

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

    a.resize(n);
    rep(i, n) {
        cin >> a[i];
        a[i]--;
    }
    
    to.resize(n);
    rep(i, n-1){
        int u, v; cin >> u >> v;
        u--; v--;
        to[u].pb(v);
        to[v].pb(u);
    }

    ans.resize(n);

    lis.resize(n+1, INF);
    lis[0] = -INF;
    dfs();
    
    rep(i, n) cout << ans[i] << endl;
    return;
}

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

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:29:5: error: 'change' was not declared in this scope
   29 |     change = int(it - lis.begin());
      |     ^~~~~~
a.cc:30:5: error: 'value' was not declared in this scope
   30 |     value = *it;
      |     ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using P = pair<int,int>;
int main() {
  	int N;
    unordered_map<int,int> mp;
  	cin>>N;
  	vector<vector<int>> tree(N,vector<int>(0));
	vector<int> answer(N);
	vector<int> LIS(N);
	vector<int> A(N);
  	for(int i=0;i<N;i++){
    	cin>>A.at(i);
    	LIS.at(i)=1000000007;
  	}
  	for(int i=0;i<N-1;i++){
    	int a,b;
    	cin>>a>>b;
   	 	tree.at(a-1).push_back(b-1);
   	 	tree.at(b-1).push_back(a-1);
  	}
    vector<int> dist(N,-1);
    stack<int> stk;
    stack<P> stk2;
  	dist.at(0)=0;
  	stk.push(0);
    stk2.push(make_pair(0,1000000007));
  	LIS.at(0)=A.at(0);
  	answer.at(0)=1;
    int ans=0;
    int count=0;
  	while(!stk.empty()){
    	int v=stk.top();
    	stk.pop();
        //cout<<" "<<v<<endl;
      	if(v>0){
      	if(mp[v]==1){
            int memo=stk2.size()-1;
      		for(int i=0;i<count;i++){
        		int a=stk2.top().first,b=stk2.top().second;
                //cout<<v<<"    "<<a<<" "<<b<<endl;
                stk2.pop();
          		LIS.at(a)=b;
                //count=0;
        	}
    	}
        count++;
        int left=0,right=N-1,check=0;
        ans=0;
        while(left<=right){
       		int mid=left+(right-left)/2;
       		if(LIS.at(mid)>A.at(v)){
       			right=mid-1;
       		}
       		if(LIS.at(mid)==A.at(v)){
                check=1;
          		break;
        	}
       		if(LIS.at(mid)<A.at(v)){
       			left=mid+1;
          		ans=max(ans,mid+1);
       		}
        }
      	
      	answer.at(v)=max(answer.at(v),ans+1);
        //cout<<v<<" "<<tree.at(v).size()<<endl;
        if(tree.at(v).size()==3){
            //cout<<v<<" "<<tree.at(v).at(0)<<" "<<tree.at(v).at(1)<<endl;
            mp[tree.at(v).at(0)]=1;
      	    mp[tree.at(v).at(1)]=1;
            count=0;
        }
        if(v==0 && tree.at(v).size()==2){
            //cout<<v<<" "<<tree.at(v).at(0)<<endl;
            mp[tree.at(v).at(0)]=1;
            count=0;
        }
    	for(int i=0;i<(int)tree.at(v).size();i++){
      		int nv=tree.at(v).at(i);
      		if(dist.at(nv)!=-1){
        		continue;
      		}
            stk.push(nv);
          	dist.at(nv)=1;
    	}
  	}
  	for(int i=0;i<N;i++){
    	cout<<answer.at(i)<<endl;
  	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:90:2: error: expected '}' at end of input
   90 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^