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

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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

const int64 mod = 1e9+7;
int32 N;

int32 1ton(int32 x){
	if(x > N){
		return x-N+1;
	}
	return x;
}

int main(void){
	cin >> N;
	if(N > 1 && N%2 == 1){
		cout << "Yes" << endl;
		cout << N << endl;
		REP(i, N){
			cout << 2 << " " << (i+1) << " " << 1ton(i+2) << endl;
		}
	}else if(N % 2 == 0 && N > 4){
		cout << "Yes" << endl;
		cout << N/2+1 << endl;
		for(int32 i = 0;i < N;i += 2){
			cout << 3 << " " << (i+1) << " " << 1ton(i+2) << " " << 1ton(i+3) << endl;
		}
		cout << N/2 << " ";
		for(int32 i = 2;i <= N;i += 2){
			cout << i << " ";
		}
		cout << endl;
	}else if(N == 1){
		cout << "Yes" << endl;
		cout << 2 << endl;
		cout << 1 << 1 << endl;
		cout << 1 << 1 << endl;
	}else{
		cout << "No" << endl;
	}
}


Compiler output:
a.cc:27:7: error: expected unqualified-id before numeric constant
   27 | int32 1ton(int32 x){
      |       ^~~~
a.cc: In function 'int main()':
a.cc:40:61: error: unable to find numeric literal operator 'operator""ton'
   40 |                         cout << 2 << " " << (i+1) << " " << 1ton(i+2) << endl;
      |                                                             ^~~~
a.cc:46:61: error: unable to find numeric literal operator 'operator""ton'
   46 |                         cout << 3 << " " << (i+1) << " " << 1ton(i+2) << " " << 1ton(i+3) << endl;
      |                                                             ^~~~
a.cc:46:81: error: unable to find numeric literal operator 'operator""ton'
   46 |                         cout << 3 << " " << (i+1) << " " << 1ton(i+2) << " " << 1ton(i+3) << endl;
      |                                                                                 ^~~~
Language: C++

#include<vector>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int n;
    cin>>n;
    vector <int> a(100010);
    for(int i=0;i<n;i++){
        cin >> a[i];
    }
    sort(a.begin(),a.end());
    int ans=0;
    for(int i=0;i<n;i++){
        int b=a.end();
        int c=b-i;
        int d=a.at(i);
        int e=a.at(c);
        int f=a.at(i);
        int g=a.at(c-1);
        ans=+(d-e<0)?-(d-e):d-e;
        ans=+(f-g<0)?-(f-g):f-g;
    }
    cout << ans/2<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:20: error: cannot convert 'std::vector<int>::iterator' to 'int' in initialization
   15 |         int b=a.end();
      |               ~~~~~^~
      |                    |
      |                    std::vector<int>::iterator
Language: C++

#include<stdio.h>

int main() {
    int i,j,v,num,a[100001]={0};
    int b[100001] = {0};
    int sum=0;
    scanf ("%d",&num);
    for (i = 1;i <= num; i++ ) {
        scanf ("%d",&a[i]);
    }
    //insertation sort
    for (i = 2;i <= num; i++) {
        v = a[i];
        j = i - 1;
        while (j >= 0 && a[j] > v) {
            a[j + 1] = a[j];
            j--;
        }
        a[j + 1] = v;
    }
    

    if (num % 4 == 2) {
        for (i = 1; i <= num /2 ;i++ ){
            if (i % 2 == 1) {
                b[num / 2 + 1 + (i-1)] = a[i]; 
            } else if (i % 2 == 0) {
                b[num / 2 + 1 - i] = a[i];
            }
        }
        for (i = num/2;i <= num; i++) {
            if (i % 2 ==1) {
                b[num-1-(i-num/2-2)]= a[i];
            } else {
                b[i-num/2]=a[i];
            }
        }
    } else if (num % 4 == 3) {
        for (i = 1; i <= num /2 ;i++ ){
            if (i % 2 == 1) {
                b[num /2+1 -(i-1)] = a[i]; 
            } else if (i % 2 == 0) {
                b[num / 2 + 1 + i] = a[i];
            }
        }
        for (i = num/2+1;i <= num; i++) {
            if (i % 2 ==1) {
                b[i-(num/2+1)]= a[i];
            } else {
                b[num+num/2+1-i]=a[i];
            }
        }
    }
    for (i = 2;i <= num;i ++ ) {
        sum += abs(b[i]-b[i-1]);
    }
    printf ( "%d\n",sum);

}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:16: error: 'abs' was not declared in this scope
   55 |         sum += abs(b[i]-b[i-1]);
      |                ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <vector>
#include <map>

using namespace std;


int main() {
    int N, t;
    int res = 0;
    int subl, subr, tl, tr;
    int x, y, z, w;
    vector<int> a;
    cin >> N;
    vector<int> tmp(N, 0);
    for (int i=0; i < N; i++){
        cin >> t;
        a.push_back(t);
    }
    if (N <= 2){
        cout << abs(a[0] - a[1]) << endl;
        return 0;
    }

    sort(a.begin(), a.end());
    tl = tr = a.front();
    a.erase(a.begin())
    while(a.size() > 0){
        x = abs(tl - a.front()); y = abs(tl - a.back());
        z = abs(tr - a.front()); w = abs(tr - a.back());
        if (max(x, y) < max(z, w)){
            res += z <= w ? w : z;
            if (z <= w){
                tr = a.back();
                a.pop_back();
            }
            else{
                tr = a.front();
                a.erase(a.begin());
            }

        } else{
            res += x <= y ? y : x;
            if (x <= y){
                tl = a.back();
                a.pop_back();
            }
            else{
                tl = a.front();
                a.erase(a.begin());
            }
        }
    }

    cout << res << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:23: error: expected ';' before 'while'
   30 |     a.erase(a.begin())
      |                       ^
      |                       ;
   31 |     while(a.size() > 0){
      |     ~~~~~
Language: C++

#include <iostream>
using namespace std;
sort a, a + n;
int main() {
	int n,a[1000];
	cin >>n;
	for (int i = 0; i < n; i++)cin >> a[i];
	for (int i = 0; i < n; i++) {
		if (i != n - 1)cout << a[i] << " ";
		else cout << a[i] << endl;
      cout<<a[i]+a[i-1]<<endl;
      getchar();
	  getchar();
	  return 0;




    
	}
	

}
    
	


Compiler output:
a.cc:3:1: error: 'sort' does not name a type; did you mean 'short'?
    3 | sort a, a + n;
      | ^~~~
      | short
Language: C++

#include <iostream>
using namespace std;
sort(a, a + n);
int main() {
	int n,a[1000];
	cin >>n;
	for (int i = 0; i < n; i++)cin >> a[i];
	for (int i = 0; i < n; i++) {
		if (i != n - 1)cout << a[i] << " ";
		else cout << a[i] << endl;
      cout<<a[i]+a[i-1]<<endl;
      getchar();
	  getchar();
	  return 0;




    
	}
	

}
    
	


Compiler output:
a.cc:3:5: error: expected constructor, destructor, or type conversion before '(' token
    3 | sort(a, a + n);
      |     ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  
  ll sm = 0;
  for (int i = 0; i < n-1; i++) {
    sm += (a[i+1] - a[i]) * min(i+1, n-i+1);
  }
  cout << sm << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |   sort(a.begin(), a.end());
      |   ^~~~
      |   short
Language: C++

#include <iostream>
using namespace std;
sort(a, a + n);
int main() {
	int n,a[1000];
	cin >>n;
	for (int i = 0; i < n; i++)cin >> a[i];
	sort(a, a + n);
	for (int i = 0; i < n; i++) {
		if (i != n - 1)cout << a[i] << " ";
		else cout << a[i] << endl;
      cout<<a[i]+a[i-1]<<endl;
      getchar();
	  getchar();
	  return 0;




    
	}
	

}
    
	


Compiler output:
a.cc:3:5: error: expected constructor, destructor, or type conversion before '(' token
    3 | sort(a, a + n);
      |     ^
a.cc: In function 'int main()':
a.cc:8:9: error: 'sort' was not declared in this scope; did you mean 'short'?
    8 |         sort(a, a + n);
      |         ^~~~
      |         short
Language: C++

#include <iostream>
#include <algorithm>
#include <functional>
#include <cstdlib>
using namespace std;

long long come_and_go(int *a, int n) {
    
    long long ans = 0;
    int c = n/2;
    
    for (int i = 0; i < n; i++) {
        if (i != c) ans += (long long)abs(a[i] - a[c]);
    }
    ans *= 2ll;
    
    if (n & 1) {
        ans -= abs(a[c-1] - a[c]);
    } else {
        ans -= min(abs(a[c-1] - a[c]), abs(a[c+1] - a[c]))
    }
    
    return ans;
}

int main() {
    
    int n;
    cin >> n;
    
    int a[n];
    for (int i = n; i--;) cin >> a[i];
    if (n == 2) {
        cout << abs(a[0] - a[1]) << endl;
        return 0;
    }
    
    sort(a, a + n);
    
    cout << come_and_go(a, n) << endl;
    
}


Compiler output:
a.cc: In function 'long long int come_and_go(int*, int)':
a.cc:20:59: error: expected ';' before '}' token
   20 |         ans -= min(abs(a[c-1] - a[c]), abs(a[c+1] - a[c]))
      |                                                           ^
      |                                                           ;
   21 |     }
      |     ~
Language: Java

package main.java.tasks;

import java.lang.reflect.Array;
import java.util.*;
import java.io.PrintWriter;

public class Tenka1_2018_C {
    public void solve(int testNumber, Scanner in, PrintWriter out) {
        int n = in.nextInt();
        List<Integer> list = new ArrayList<Integer>();
        List<Integer> maxlist = new ArrayList<Integer>();
        long ans = 0;
        for (int i = 0; i < n; i++) {
            list.add(in.nextInt());
        }
        Collections.sort(list);

        maxlist.add(list.get(0));
        maxlist.add(list.get(list.size() - 1));
        list.remove(0);
        list.remove(list.size() - 1);


        while (list.size() > 0) {
            if (list.size() < 2) break;
            maxlist.add(0, list.get(list.size() - 1));
            list.remove(list.size() - 1);

            maxlist.add(list.get(0));
            list.remove(0);

            if (list.size() < 2) break;
            maxlist.add(list.get(list.size() - 1));
            list.remove(list.size() - 1);

            maxlist.add(0, list.get(0));
            list.remove(0);

        }

        if (list.size() == 1) {
            int last = list.get(0);

            if (Math.abs(last - maxlist.get(0)) > Math.abs(last - maxlist.get(maxlist.size() - 1))){
                maxlist.add(0,list.get(0));
            }else{
                maxlist.add(list.get(0));
            }
        }
        
        for (int i = 0; i < maxlist.size() - 1; i++) {
            ans += Math.abs(maxlist.get(i) - maxlist.get(i + 1));
        }

        out.print(ans);
    }
}


Compiler output:
Main.java:7: error: class Tenka1_2018_C is public, should be declared in a file named Tenka1_2018_C.java
public class Tenka1_2018_C {
       ^
1 error
Language: Java

package main.java.tasks;

import java.lang.reflect.Array;
import java.util.*;
import java.io.PrintWriter;

public class Tenka1_2018_C {
    public void solve(int testNumber, Scanner in, PrintWriter out) {
        int n = in.nextInt();
        List<Integer> list = new ArrayList<Integer>();
        List<Integer> maxlist = new ArrayList<Integer>();
        long ans = 0;
        for (int i = 0; i < n; i++) {
            list.add(in.nextInt());
        }
        Collections.sort(list);

        maxlist.add(list.get(0));
        maxlist.add(list.get(list.size()-1));
        list.remove(0);
        list.remove(list.size()-1);


        while (list.size() > 0) {
            if (list.size() == 0) break;
            maxlist.add(0, list.get(list.size() - 1));
            list.remove(list.size() - 1);

            if (list.size() == 0) break;
            maxlist.add(list.get(0));
            list.remove(0);

            if (list.size() == 0) break;
            maxlist.add(0, list.get(0));
            list.remove(0);

            if (list.size() == 0) break;
            maxlist.add(list.get(list.size()-1));
            list.remove(0);
        }
        for (int i = 0; i < maxlist.size() - 1; i++) {
            ans += Math.abs(maxlist.get(i) - maxlist.get(i + 1));
        }

        out.print(ans);
    }
}


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

// Tenka_2017.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include "pch.h"
#include <iostream>
#include <deque>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
int n, num;
int sum;
deque <int> vc;
int main()
{
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> num;
		vc.push_back(num);
	}
	sort(vc.begin(), vc.end());
	while (!vc.empty()) {
	sum+=abs(vc.front() - vc.back());
	if (vc.empty()) {
		break;
	}
	vc.pop_front();
	if (vc.empty()) {
		break;
	}
	vc.pop_back();
	}
	
	cout << sum << endl;
}








Compiler output:
a.cc:4:10: fatal error: pch.h: No such file or directory
    4 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C++

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

int total  = 0;

int main(int argc, const char * argv[]) {
    //cout << "a";
    int c[10000] = {0};
    int N,prev=0;
    cin >> N;
    //make a map
    for(int i = 0; i < N; i++){
      cin >> c[i];
    }
    sort(c,c+N);
}

    cout << total << endl;
    return 0;
}

Compiler output:
a.cc:20:5: error: 'cout' does not name a type
   20 |     cout << total << endl;
      |     ^~~~
a.cc:21:5: error: expected unqualified-id before 'return'
   21 |     return 0;
      |     ^~~~~~
a.cc:22:1: error: expected declaration before '}' token
   22 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

int main() {
	int n,a[1000];
	cin >>n;
	for (int i = 0; i < n; i++)cin >> a[i];
	sort(a, a + n);
	for (int i = 0; i < n; i++) {
		if (i != n - 1)cout << a[i] << " ";
		else cout << a[i] << endl;
      cout<<a[i]+a[i-1]<<endl;
      getchar();
	  getchar();
	  return 0;




    
	}
	

}
    
	

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'sort' was not declared in this scope; did you mean 'short'?
    8 |         sort(a, a + n);
      |         ^~~~
      |         short
Language: C++

#include <iostream>
using namespace std;

int main() {
	int n,a[1000];
	cin >>n;
	for (int i = 0; i < n; i++)cin >> a[i];
	sort(a, a + n);
	for (int i = 0; i < n; i++) {
		if (i != n - 1)cout << a[i] << " ";
		else cout << a[i] << endl;
      cout<<a[i]+a[i-1]<<endl;




    
	}
	

}
    
	


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'sort' was not declared in this scope; did you mean 'short'?
    8 |         sort(a, a + n);
      |         ^~~~
      |         short
Language: Java

import java.util.*

class Main {
	public static ArrayList<ArrayList<Integer>> permute(int[] num) {
      ArrayList<ArrayList<Integer>> result = new ArrayList<ArrayList<Integer>>();

      //start from an empty list
      result.add(new ArrayList<Integer>());

      for (int i = 0; i < num.length; i++) {
          //list of list in current iteration of the array num
          ArrayList<ArrayList<Integer>> current = new ArrayList<ArrayList<Integer>>();

          for (ArrayList<Integer> l : result) {
              // # of locations to insert is largest index + 1
              for (int j = 0; j < l.size()+1; j++) {
                  // + add num[i] to different locations
                  l.add(j, num[i]);

                  ArrayList<Integer> temp = new ArrayList<Integer>(l);
                  current.add(temp);

                  //System.out.println(temp);

                  // - remove num[i] add
                  l.remove(j);
              }
          }

          result = new ArrayList<ArrayList<Integer>>(current);
      }

      return result;
  }
  
  public static int main() {
  	Scanner sc = new Scanner(System.in);
    int lines = Integer.parseInt(sc.nextLine());
    int[] arr = new int[lines];
    
    for(int i=0; i<lines; i++) {
        arr[i] = Integer.parseInt(sc.nextLine());
    }
    
    System.out.println(Main.calcMax(Main.permute(arr)));
  	return 0;
  }
  
  public static int calcMax(ArrayList<ArrayList<Integer>> ar) {
  	int max = 0;
  	for(ArrayList<Integer> i: ar) {
      int tmp = 0;
      for(int n=0; n<i.size(); n++) {
      	if(n==0)
        	continue;
        tmp += Math.abs(i.get(n) - i.get(n - 1));
      }
      if(max < tmp)
      	max = tmp;
    }
    return max;
  }
}

Compiler output:
Main.java:1: error: ';' expected
import java.util.*
                  ^
1 error
Language: C++

#include <iostream>
using namespace std;

int main() {
	int n,a[1000];
	cin >> n;
	for (int i = 0; i < n; i++)cin >> a[i];
	sort(a, a + n);
	for (int i = 0; i < n; i++) {
		if (i != n - 1)cout << a[i] << " ";
		else cout << a[i] << endl;
      cout<<a[n]+a[n-1]<<endl;




    
	}
	

}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'sort' was not declared in this scope; did you mean 'short'?
    8 |         sort(a, a + n);
      |         ^~~~
      |         short
Language: C++

#include <iostream>
using namespace std;

int main() {
	int n,a[1000];
	cin >> n;
	for (int i = 0; i < n; i++)cin >> a[i];
	sort(a, a + n);
	for (int i = 0; i < n; i++) {
		if (i != n - 1)cout << a[i] << " ";
		else cout << a[i] << endl;
      cout<<a[n]+a[n-1]<<endl;




    
	}
	

}
    
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'sort' was not declared in this scope; did you mean 'short'?
    8 |         sort(a, a + n);
      |         ^~~~
      |         short
a.cc: At global scope:
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <climits>

#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue

using namespace std;
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

int main(int argc, char const* argv[])
{
  int n;
  cin >> n;
  deque<ll> q;
  vector<ll> vec;
  for(int i = 0; i < n; i++){
    ll x;
    cin >> x;
    vec.pb(x);
  }
  sort(vec.begin(), vec.end());

  if(n == 2){
    cout << a[1] - a[2] << endl;
    return 0;
  }

  for(int i = 1; i < vec.size(); i++){
    q.pb(vec[i]);
  }

  ll res = 0;
  ll left = vec[0];
  ll right = vec[0];
  int flag = 1;
  while(!q.empty()){
    if(flag > 0){
      ll val = q.back(); q.pop_back();
      res += val - right;
      right = val;
      if(!q.empty()){
        ll val = q.back(); q.pop_back();
        res += val - left;
        left = val;
      }
    }else{
      ll val = q.front(); q.pop_front();
      res += right - val;
      right = val;
      if(!q.empty()){
        ll val = q.front(); q.pop_front();
        res += left - val;
        left = val;
      }
    }

    flag *= -1;
  }

  cout << res << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:43:13: error: 'a' was not declared in this scope
   43 |     cout << a[1] - a[2] << endl;
      |             ^
Language: C++

#include <iostream>
#include <algorithm>
#include <functional>
#include <cstdlib>
using namespace std;

long long cand(int c, int *a, int n) {
    
    long long ans = 0;
    
    for (int l = 0, r = n-1; l < c || c < r; l++, r--) {
        if (l < c) ans += 2ll * (long long)abs(a[l] - a[c]);
        if (c < r) ans += 2ll * (long long)abs(a[r] - a[c]);
    }
    
    ans -= min(abs(a[c-1] - a[c]), abs(a[c+1] - a[c]));
    
    return ans;
}

int main() {
    
    int n;
    cin >> n;
    
    int a[n];
    long long ans = 0;
    for (int i = n; i--;) cin >> a[i];
    if (n == 2) {
        cout << abs(a[0] - a[1]) << endl;
        return 0;
    }
    
    sort(a, a + n);
    
    cout << min(cand(n/2), cand(n/2+1)) << endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:21: error: too few arguments to function 'long long int cand(int, int*, int)'
   36 |     cout << min(cand(n/2), cand(n/2+1)) << endl;
      |                 ~~~~^~~~~
a.cc:7:11: note: declared here
    7 | long long cand(int c, int *a, int n) {
      |           ^~~~
a.cc:36:32: error: too few arguments to function 'long long int cand(int, int*, int)'
   36 |     cout << min(cand(n/2), cand(n/2+1)) << endl;
      |                            ~~~~^~~~~~~
a.cc:7:11: note: declared here
    7 | long long cand(int c, int *a, int n) {
      |           ^~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
	// 配列, array, vector を昇順にソートする
int a[N];
cin>>a[N];
array<int,N> ar;
vector<int> v;

sort(a, a+N); // 配列
sort(ar.begin(), ar.end()); // array
sort(v.begin(), v.end()); // vector
cout<<a[N]+a[N-1]<<endl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: 'N' was not declared in this scope
    6 | int a[N];
      |       ^
a.cc:7:6: error: 'a' was not declared in this scope
    7 | cin>>a[N];
      |      ^
a.cc:9:1: error: 'vector' was not declared in this scope
    9 | vector<int> v;
      | ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:9:8: error: expected primary-expression before 'int'
    9 | vector<int> v;
      |        ^~~
a.cc:11:1: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 | sort(a, a+N); // 配列
      | ^~~~
      | short
a.cc:12:9: error: request for member 'begin' in 'ar', which is of non-class type 'int'
   12 | sort(ar.begin(), ar.end()); // array
      |         ^~~~~
a.cc:12:21: error: request for member 'end' in 'ar', which is of non-class type 'int'
   12 | sort(ar.begin(), ar.end()); // array
      |                     ^~~
a.cc:13:6: error: 'v' was not declared in this scope
   13 | sort(v.begin(), v.end()); // vector
      |      ^
Language: C++

#include <iostream>
using namespace std;

int main() {
	// 配列, array, vector を昇順にソートする
int a[N];
array<int,N> ar;
vector<int> v;

sort(a, a+N); // 配列
sort(ar.begin(), ar.end()); // array
sort(v.begin(), v.end()); // vector
cout<<a[n]+a[n-1]<<endl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: 'N' was not declared in this scope
    6 | int a[N];
      |       ^
a.cc:8:1: error: 'vector' was not declared in this scope
    8 | vector<int> v;
      | ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:8: error: expected primary-expression before 'int'
    8 | vector<int> v;
      |        ^~~
a.cc:10:6: error: 'a' was not declared in this scope; did you mean 'ar'?
   10 | sort(a, a+N); // 配列
      |      ^
      |      ar
a.cc:10:1: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 | sort(a, a+N); // 配列
      | ^~~~
      | short
a.cc:11:9: error: request for member 'begin' in 'ar', which is of non-class type 'int'
   11 | sort(ar.begin(), ar.end()); // array
      |         ^~~~~
a.cc:11:21: error: request for member 'end' in 'ar', which is of non-class type 'int'
   11 | sort(ar.begin(), ar.end()); // array
      |                     ^~~
a.cc:12:6: error: 'v' was not declared in this scope
   12 | sort(v.begin(), v.end()); // vector
      |      ^
a.cc:13:9: error: 'n' was not declared in this scope
   13 | cout<<a[n]+a[n-1]<<endl;
      |         ^
Language: C++

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

ll A[101010];

int main(){
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  
  int N; cin>>N;
  vector<ll> V(N);
  rep(i,N) cin>>V[i];
  if(N==2){
    cout<<abs(V[0]-V[1])<<endl;
    return 0;
  }
  sort(V.begin(),V.end());
  int l,r,L,R;
  if(N%2==0){
    a[N/2]=V[0];
    a[N/2-1]=V[N-1];
    l=1,r=N-2;
    L=N/2-2,R=N/2+1;
    int cnt=0;
    while(L>=0||R<N){
      if(cnt%2==0){
        if(L>=0) a[L--]=V[l++];
        if(R<N) a[R++]=V[r--];
      }else{
        if(L>=0) a[L--]=V[r--];
        if(R<N) a[R++]=V[l++];
      }
      cnt++;
    }
  }else{
    a[N/2]=V[0];
    a[N/2-1]=V[N-1];
    a[N/2+1]=V[N-2];
    l=1,r=N-3;
    L=N/2-2, R=N/2+2;
    int cnt=0;
    while(L>=0||R<N){
      if(cnt%2){
        if(L>=0) a[L--]=V[r--];
        if(R<N) a[R++]=V[r--];
      }else{
        if(L>=0) a[L--]=V[l++];
        if(R<N) a[R++]=V[l++];
      }
      cnt++;
    }
  }
  ll ans=0;
  rep(i,N-1) ans+=abs(a[i]-a[i+1]);
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:5: error: 'a' was not declared in this scope
   24 |     a[N/2]=V[0];
      |     ^
a.cc:40:5: error: 'a' was not declared in this scope
   40 |     a[N/2]=V[0];
      |     ^
a.cc:58:23: error: 'a' was not declared in this scope
   58 |   rep(i,N-1) ans+=abs(a[i]-a[i+1]);
      |                       ^
Language: C++

#include <iostream>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod (ll)(1e9+7)
#define int ll

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

signed main() {
  int n;
  cin >> n;
  int a[100001];
  rep(i, 0, n) cin >> a[i];
  sort(a, a + n);
  int sum1 = 0, sum2 = 0;
  int fi = n / 2, si = n - 1;
  int f = 1;
  rep(i, 0, n - 1) {
    sum1 += a[si] - a[fi];
    if(f) {
      if(fi == n / 2) fi = -1;
      fi++;
    }else {
      si--;
    }
    f = !f;
  }
  fi = 0, si = n / 2;
  f = 0;

  rep(i, 0, n - 1) {
    sum2 += a[si] - a[fi];
    if(f) {
      fi++;
    }else {
      if(si == n / 2) si = n;
      si--;
    }
    f = !f;
  }
  cout << max(sum1, sum2) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   25 |   sort(a, a + n);
      |   ^~~~
      |   short
Language: C++

#include "pch.h"
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int n,num;
int sum;
vector<int> vc;
int main()
{ 
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> num;
		vc.push_back(num);
	}
	for (int i = 0; i < vc.size()-1; i++) {
		sum+= abs((vc[i]) - (vc[i + 1]));
	}
	cout << sum << endl;
}



Compiler output:
a.cc:1:10: fatal error: pch.h: No such file or directory
    1 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<math>
using namespace std;
pair<int, int> p1[200001], p2[200001];

int main() {
    int n;
    cin >> n;
    vector<int> a;
    long long ans = 0;
    int l = 0, r = 0;
    int ll = 0, rr = n - 2;
    for (int i = 0; i < n; i++) {
        cin >> l;
        a.push_back(l);
    }
    sort(a.begin(), a.end());
    l = a[n - 1];
    r = a[n - 1];
    while (rr - ll >= 0) {
        int mx = 0;
        mx = max(mx, abs(l - a[ll]));
        mx = max(mx, abs(l - a[rr]));
        mx = max(mx, abs(r - a[ll]));
        mx = max(mx, abs(r - a[rr]));
        if (mx == abs(l - a[ll])) {
            l = a[ll];
            ll++;
        } else if (mx == abs(l - a[rr])) {
            l = a[rr];
            rr--;
        } else if (mx == abs(r - a[ll])) {
            r = a[ll];
            ll++;
        } else if (mx == abs(r - a[rr])) {
            r = a[rr];
            rr--;
        }
        ans += mx;
    }
    cout << ans;
    return 0;
}

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

#include<bits\stdc++.h>

using namespace std;
pair<int, int> p1[200001], p2[200001];

int main() {
    int n;
    cin >> n;
    vector<int> a;
    long long ans = 0;
    int l = 0, r = 0;
    int ll = 0, rr = n - 2;
    for (int i = 0; i < n; i++) {
        cin >> l;
        a.push_back(l);
    }
    sort(a.begin(), a.end());
    l = a[n - 1];
    r = a[n - 1];
    while (rr - ll >= 0) {
        int mx = 0;
        mx = max(mx, abs(l - a[ll]));
        mx = max(mx, abs(l - a[rr]));
        mx = max(mx, abs(r - a[ll]));
        mx = max(mx, abs(r - a[rr]));
        if (mx == abs(l - a[ll])) {
            l = a[ll];
            ll++;
        } else if (mx == abs(l - a[rr])) {
            l = a[rr];
            rr--;
        } else if (mx == abs(r - a[ll])) {
            r = a[ll];
            ll++;
        } else if (mx == abs(r - a[rr])) {
            r = a[rr];
            rr--;
        }
        ans += mx;
    }
    cout << ans;
    return 0;
}

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

#include <iostream>
#include <cstdlib>

int main(int argc,char argv**){
  int N;
  std::cin >> N;
  int A[N];
  for(int i=0;i<N;i++) std::cin >> A[i];
  int sum = 0;
  for(int i=0;i<N-1;i++) sum = abs(A[i] - A[i+1]);
  std::cout << sum << std::endl;
  return 0;
}


Compiler output:
a.cc:4:28: error: expected ',' or '...' before '*' token
    4 | int main(int argc,char argv**){
      |                            ^
a.cc:4:5: warning: second argument of 'int main(int, char)' should be 'char **' [-Wmain]
    4 | int main(int argc,char argv**){
      |     ^~~~
Language: C++

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
string s[10];

int main()
{
	cin>>s[1];
	int len=s[1].size();
	cout << l< len << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'l' was not declared in this scope
   14 |         cout << l< len << endl;
      |                 ^
a.cc:14:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   14 |         cout << l< len << endl;
      |                    ~~~~^~~~~~~
Language: C++

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

int main(){
	int N;
	cin >> N;
	int i = 1;
	while(N > i*(i+1)/2){
		i++;
	}
	int k = i+1;
	int ans[k][k-1];
	int num = 1;
	int b;
	if(N == (k*(k-1)/2)){
		cout << "Yes" << endl;
      　cout << k << endl;
		for(int a=0;a<k;a++){
			cout << k-1;
			for(b=0;b<a;b++){
				ans[a][b] = ans[b][a-1];
				cout << " " << ans[a][b];
			}	
			while(b<k-1){
				ans[a][b] = num;
				cout << " " << ans[a][b];
				num++;
				b++;
			}
			cout << endl;
		}	
	}else{
		cout << "No" << endl;
	}
	return 0;
}


Compiler output:
a.cc:17:7: error: extended character 　 is not valid in an identifier
   17 |       　cout << k << endl;
      |       ^
a.cc: In function 'int main()':
a.cc:17:7: error: '\U00003000cout' was not declared in this scope
   17 |       　cout << k << endl;
      |       ^~~~~~
Language: C++

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

int main(){
	int N;
	cin >> N;
	int i = 1;
	while(N > i*(i+1)/2){
		i++;
	}
	int k = i+1;
	int ans[k][k-1];
	int num = 1;
	if(N == (k*(k-1)/2)){
		cout << "Yes" << endl;
		for(int a=0;a<k;a++){
			cout << k-1;
			for(int b=0;b<a;b++){
				ans[a][b] = ans[b][a-1];
				cout << " " << ans[a][b];
			}	
			while(b<k-1){
				ans[a][b] = num;
				cout << " " << ans[a][b];
				num++;
				b++;
			}
			cout << endl;
		}	
	}else{
		cout << "No" << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:31: error: 'b' was not declared in this scope
   22 |                         while(b<k-1){
      |                               ^
Language: C++

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
typedef long long LL;
typedef unsigned long long ULL;
const int MAXN = 100005;
const int P = 1000000007;
const int INF = 1000000007;
const double eps = 1e-6;
using namespace std;
inline int getint() {
    int r = 0; bool b = true; char c = getchar();
    while (c < '0' || c > '9') { if (c == '-') b = false; c = getchar(); }
    while (c >= '0' && c <= '9') { r = (r<<1)+(r<<3) + c - '0'; c = getchar(); }
    return b ? r : -r;
}
int main() {
    n = getint();
    if (n == 1) {
        puts("Yes\n2\n1 1\n1 1");
    } else if (n == 3) {
        puts("Yes\n3\n2 1 2\n2 3 1\n2 2 3");
    } else puts("No");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: 'n' was not declared in this scope
   19 |     n = getint();
      |     ^
Language: C++

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

int main(){
	int N;
	cin >> N;
	int i = 1;
	while(N > i*(i+1)/2){
		i++;
	}
	int k = i+1;
	int ans[k][k-1];
	int num = 1;
	if(N == (k*(k-1)/2)){
		cout << "Yes" << endl;
		for(int a=0;a<k;a++){
			cout << k-1;
			for(int b=0;b<a;b++){
				ans[a][b] = ans[b][a-1];
				cout << " " << ans[a][b];
			}	
			for(;b<k-1;b++){
				ans[a][b] = num;
				cout << " " << ans[a][b];
				num++;
			}
			cout << endl;
		}	
	}else{
		cout << "No" << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:30: error: 'b' was not declared in this scope
   22 |                         for(;b<k-1;b++){
      |                              ^
Language: C++

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

int main(){
	int N;
	cin >> N;
	int i = 1;
	while(N > i*(i+1)/2){
		i++;
	}
	int k = i+1;
	int ans[k][k-1];
	int num = 1;
	if(N == (k*(k-1)/2)){
		cout << "Yes" << endl;
		for(int a=0;a<k;a++){
			cout << k-1;
			for(int b=0;b<a;b++){
				cout << " " << ans[a][b] = ans[b][a-1];
			}	
			for(;b<k-1;b++){
				cout << " " << ans[a][b] = num;
				num++;
			}
			cout << endl;
		}	
	}else{
		cout << "No" << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:70: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>' and 'int')
   19 |                                 cout << " " << ans[a][b] = ans[b][a-1];
      |                                                                      ^
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
                 from a.cc:1:
/usr/include/c++/14/ostream:458:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator=(std::basic_ostream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]'
  458 |       operator=(basic_ostream&& __rhs)
      |       ^~~~~~~~
/usr/include/c++/14/ostream:458:33: note:   no known conversion for argument 1 from 'int' to 'std::basic_ostream<char>&&'
  458 |       operator=(basic_ostream&& __rhs)
      |                 ~~~~~~~~~~~~~~~~^~~~~
a.cc:21:30: error: 'b' was not declared in this scope
   21 |                         for(;b<k-1;b++){
      |                              ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

vector<int> s[500];

int bs(int n) {
  int l = 1, r = n;
  while (r - l > 1) {
    int mid = (l + r) >> 1;
    if (mid * (mid - 1) <= n)
      l = mid;
    else
      r = mid;
  }
  return l;
}

void solve(int n) {
  int k = bs(2 * n);
  if (k * (k - 1) != n + n) {
    cout << "No" << endl;
    return ;
  }
  int cur = 1;
  for (int i = 1; i <= k; ++i) {
    for (int j = i + 1; j <= k; ++j) {
      s[i].push_back(cur);
      s[j].push_back(cur++);
    }
  }
  assert(cur == n + 1);
  cout << "Yes" << endl;
  for (int i = 1; i <= k; ++i) {
    cout << k - 1 << " ";
    for (auto ele : s[i]) {
      cout << ele << " ";
    }
    cout << endl;
  }
  return ;
}

int main() {
  int n;
  cin >> n;
  solve(n);
  return 0;
}


Compiler output:
a.cc: In function 'void solve(int)':
a.cc:33:3: error: 'assert' was not declared in this scope
   33 |   assert(cur == n + 1);
      |   ^~~~~~
a.cc:3:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    2 | #include <vector>
  +++ |+#include <cassert>
    3 |
Language: Java

import java.util.Scanner;

// MainT1P2018D
public class MainT1P2018D {

	public static void main(String[] args) {
		try (Scanner in = new Scanner(System.in)) {
			final int N = in.nextInt();
			int d = 8*N + 1;
			int dr = (int)Math.sqrt(d);
			if (dr * dr != d) {
				System.out.println("No");
				return;
			}

			final int k = (1 + dr) / 2;

			final int[] startIdx = new int[k - 1];
			{
				int idx = 1;
				for (int i = 0; i < k - 1; ++i) {
					startIdx[i] = idx;
					idx += i + 1;
				}
			}

			System.out.println("Yes");
			System.out.println(k);
			{
				System.out.print(k - 1);
				for (int i = 0; i < k - 1; ++i) {
					System.out.printf(" %d", startIdx[i] + i);
				}
				System.out.println();
			}
			for (int i = 0; i < k - 1; ++i) {
				System.out.print(k - 1);
				for (int j = 0; j < i; ++j) {
					System.out.printf(" %d", startIdx[i] + j);
				}
				for (int j = i; j < k - 1; ++j) {
					System.out.printf(" %d", startIdx[j] + i);
				}
				System.out.println();
			}
		}
	}
}


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

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

#define int long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define dbg(x) cerr << #x << ": " << x << endl;
#define dbg2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define dbg3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define dbgB(value, size) cerr<<#value<<": "<<bitset<size>(value) << endl;
#define line() cerr << "---------------" << endl;

const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};
const double PI = 3.14159265358979323846;

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<typename T>
void printA(vector<T> &printArray, char between = ' ') {
   int paSize = printArray.size();
   for (int i = 0; i < paSize; i++) { cerr << printArray[i] << between;}
   if (between != '\n') {cerr << endl;}
}

// ------------------------------------------------------------------------------------------

int N;

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

signed main() {
    // 前処理
    COMinit();

    cin >> N;

    int M = COM(N, 2);
    if (M % N != 0 ){
       puts("No");
       return 0;
    }

   rep (i, N) {
      repp (i, j, M) {
         cout << j%N+1;
      }
      puts("");
   }


    // 計算例
   //  cout << COM(100000, 50000) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:16: error: 'j' was not declared in this scope
   73 |       repp (i, j, M) {
      |                ^
a.cc:11:39: note: in definition of macro 'repp'
   11 | #define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
      |                                       ^
Language: C++

#include <cstdio>

using namespace std ;

int N ;

inline bool Squ( int K ) {
	
	if( sqrt( K ) * sqrt( K ) == K ) return true ;
	return false ;
	
}

int S[405][405] ;
int Top[405] ;

int main() {
	
	scanf( "%d\n" , &N ) ;
	if( not Squ( N * 8 + 1 ) ) return not printf( "No\n" ) ;
	if( sqrt( N * 8 + 1 ) % 2 == 0 ) return not printf( "No\n" ) ;
	printf( "Yes\n" ) ;
	int Nod = sqrt( N * 8 + 1 ) + 1 >> 1 ;
	int Cnt = 0 ;
	for(register int i = 1 ; i <= Nod ; i++ )
		for(register int j = i + 1 ; j <= Nod ; j++ ) {
			++Cnt ;
			S[++Top[i]] = Cnt ;
			S[++Top[j]] = Cnt ;
		}
	printf( "%d\n" , Nod ) ;
	for(register int i = 1 ; i <= Nod ; i++ ) {
		printf( "%d " , Top[i] ) ;
		for(register int j = 1 ; j <= Top[i] ; j++ )
			printf( "%d " , S[i][j] ) ;
		printf( "\n" ) ;
	}
	return 0 ;
	
} 

Compiler output:
a.cc: In function 'bool Squ(int)':
a.cc:9:13: error: 'sqrt' was not declared in this scope
    9 |         if( sqrt( K ) * sqrt( K ) == K ) return true ;
      |             ^~~~
a.cc: In function 'int main()':
a.cc:21:13: error: 'sqrt' was not declared in this scope
   21 |         if( sqrt( N * 8 + 1 ) % 2 == 0 ) return not printf( "No\n" ) ;
      |             ^~~~
a.cc:23:19: error: 'sqrt' was not declared in this scope
   23 |         int Nod = sqrt( N * 8 + 1 ) + 1 >> 1 ;
      |                   ^~~~
a.cc:25:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   25 |         for(register int i = 1 ; i <= Nod ; i++ )
      |                          ^
a.cc:26:34: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   26 |                 for(register int j = i + 1 ; j <= Nod ; j++ ) {
      |                                  ^
a.cc:28:37: error: incompatible types in assignment of 'int' to 'int [405]'
   28 |                         S[++Top[i]] = Cnt ;
      |                         ~~~~~~~~~~~~^~~~~
a.cc:29:37: error: incompatible types in assignment of 'int' to 'int [405]'
   29 |                         S[++Top[j]] = Cnt ;
      |                         ~~~~~~~~~~~~^~~~~
a.cc:32:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   32 |         for(register int i = 1 ; i <= Nod ; i++ ) {
      |                          ^
a.cc:34:34: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   34 |                 for(register int j = 1 ; j <= Top[i] ; j++ )
      |                                  ^
Language: Java

import java.util.*;
import java.util.stream.IntStream;

public class Main {
    static int n;
    static int[][] a = new int[2000][2000];


    static Scanner sc;

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

        if(n=1) {
            System.out.println("Yes");
            System.out.println("2");
            System.out.println("1 1");
            System.out.println("1 1");
        }

        if(n<3) {
            System.out.println("No");
            return;
        }
        int tmp = 4;
        a[0][0] = 1;
        a[0][1] = 2;
        a[1][0] = 2;
        a[1][1] = 3;
        a[2][0] = 3;
        a[2][1] = 1;
        if(n == 3) {
             out();
             return;
        }
        for (int i = 0; i < 1000; i++) {
            int j = 0;
            int l = 0;
            for (int k = 0; k < a[j].length; k++) {
                if (a[j][k] == 0) {

                    l = k;
                    break;
                }
            }
            while(a[j][0] != 0) {
                a[j][l] = tmp;
                tmp++;
                j++;
            }
            for (int k = 0; k <= l; k++) {
                a[j][k] = a[k][l];
            }
            if(tmp == n+1) {
                break;
            }
            if(tmp > n+1) {
                System.out.println("No");
                return;
            }
        }

        out();
    }

    static void out() {
        int l = 0;
        System.out.println("Yes");
        for (int i = 0; i < a[0].length; i++) {
            if(a[0][i] == 0 ){
                l = i;
                break;
            }
        }
        int ttt =0 ;
        for (int i = 0; i < a.length; i++) {
            if(a[i][0] == 0) {
                ttt = i;
                break;
            }
        }
        System.out.println(ttt);
        for (int i = 0; i < a.length; i++) {
            if(a[i][0] == 0) {
                return;
            }
            System.out.print(l + " ");
            for (int j = 0; j < l; j++) {
                System.out.print(a[i][j] + " ");
            }
            System.out.println();
        }
    }
}


Compiler output:
Main.java:15: error: incompatible types: int cannot be converted to boolean
        if(n=1) {
            ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T> using vt = vector<T>;
template<class T> using vvt = vector<vt<T>>;
template<class T> using ttt = tuple<T,T>;
using tii = tuple<int,int>;
using tiii = tuple<int,int,int>;
using vi = vector<int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define mt make_tuple
#define ALL(a) (a).begin(),(a).end()
#define FST first
#define SEC second
#define DEB cerr<<"!"<<endl
#define SHOW(a,b) cerr<<(a)<<" "<<(b)<<endl
#define DIV int(1e9+7)
const int INF = (INT_MAX/2);
const ll LLINF = (LLONG_MAX/2);
const double eps = 1e-8;
//const double PI = M_PI;  
inline ll pow(ll x,ll n,ll m){ll r=1;while(n>0){if((n&1)==1)r=r*x%m;x=x*x%m;n>>=1;}return r%m;}
inline ll lcm(ll d1, ll d2){return d1 / __gcd(d1, d2) * d2;}
 
/*Coding Space*/
int main(){
  int n; cin >> n;
  if(n == 1){
    cout << "Yes" << endl;
    cout << 2 << endl << "1 1" << endl << "1 1" << endl;
  }else if(n == 3){
    cout << "Yes" << endl;
    cout << 3 << endl << "2 1 2" << endl << "2 3 1" << endl << "2 2 3" << endl;
  }else if(n %3 == 0){
    return -1;
    cout <<"Yes" << endl;
    int d = 1;
    cout << 2 + n/3 << endl;
    rep(j,3){cout << 1+n/3<<" ";rep(i,1 + n/3){cout << (i+d > n?(i+d)%n:i + d) << (i == n/3?"\n":" ");} d += n/3;}
    int tt = 2;
    rep(x,n/3 - 1)cout << 3  << " " << tt << " " << tt + n/3 << " " <<  tt + 2*(n/3) << endl,++tt;
  }else if{
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:11: error: expected '(' before '{' token
   43 |   }else if{
      |           ^
      |           (
Language: C++

#include <iostream>
#include <algorithm>
#include <bitset>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <complex>
#include <string.h>
#include <numeric>
using namespace std;

//#define int long long
#define reps(i,s,n) for(int (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define all(c) (c).begin(),(c).end()
#define mp make_pair
typedef long long ll;

int main(){
    int n = 0; cin >> n;
    if(n==1){
        cout << "Yes\n
        2
        1 1
        1 1" << endl;
    }
    if(n<3){cout << "No" << endl; return 0;}
    int k = 3;
    while(k*(k-1) < 2 * n) k++;
    if(k*(k-1) != 2 * n){cout << "No" << endl; return 0;}
    vector<vector<int>> s(k);
    rep(i,k) s[i].push_back(k-1);
    s[0].push_back(1); s[0].push_back(2);
    s[1].push_back(1); s[1].push_back(3);
    s[2].push_back(2); s[2].push_back(3);
    int now = 3,num = 3;
    rep(i,k - 3){
        rep(j,i+3) s[j].push_back(j+num+1);
        rep(j,i+3) s[i+3].push_back(j+num+1);
        num += i+3;   
    }
    cout << "Yes" << endl;
    cout << k << endl;
    rep(i,k) { rep(j,k) cout << s[i][j] << " "; cout << endl;}
    return 0;
}

Compiler output:
a.cc:26:17: warning: missing terminating " character
   26 |         cout << "Yes\n
      |                 ^
a.cc:26:17: error: missing terminating " character
   26 |         cout << "Yes\n
      |                 ^~~~~~
a.cc:29:12: warning: missing terminating " character
   29 |         1 1" << endl;
      |            ^
a.cc:29:12: error: missing terminating " character
   29 |         1 1" << endl;
      |            ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:27:10: error: expected ';' before numeric constant
   27 |         2
      |          ^
      |          ;
   28 |         1 1
      |         ~