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


#include <iostream>
#include <list>

using namespace std;

int main(int argc, const char * argv[]) {
    int N;
    list<int> V;
    int A;
    list<int>::iterator itr;
    list<int>::iterator a;
    int answer = 0;
    
    cin >> N;
    
    for (int i = 0; i < N; i++) {
        cin >> A;
        V.push_back(A);
    }
    sort(V.begin() ,V.end());
    
    for (int i = 0; i < V.size(); i++) {
        itr = V.end();
        cout << *itr;
        a = V.begin();
        answer += abs(*itr - *a);
        V.erase(itr);
        V.erase(a);
        }
    
    return 0;
}


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

#include <iostream>
#include <list>

using namespace std;

int main(int argc, const char * argv[]) {
    int N;
    list<int> V;
    int A;
    list<int>::iterator itr;
    list<int>::iterator a;
    int answer = 0;
    
    cin >> N;
    
    for (int i = 0; i < N; i++) {
        cin >> A;
        V.push_back(A);
    }
    sort(V.begin() ,V.end());
    
    for (int i = 0; i < V.size(); i++) {
        itr = V.end();
        cout << *itr;
        a = V.begin();
        answer += abs(*itr - *a);
        V.erase(itr);
        V.erase(a);
        }
}


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

#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<cstdio>
using namespace std;
#define FOR(i,n) for(int i=1;i<=n;i++)
long long a[100050];

int main()
{
 ios::sync_with_stdio(false);
long long N;
cin>>N;
long long i;
for(i=1;i<=N;i++)
{
	cin>>a[i];
}
sort(a+1,a+N+1);

long long sum=0;
long long L=a[1];
long long R=a[1];

long long r=N+1;

while(1)
{
	r--;
	if(l==r) break;
	if(abs(a[r]-L)>=abs(a[r]-R))
	{
		sum+=abs(a[r]-L);
		L=a[r];
	}
	else
	{
		sum+=abs(a[r]-R);
		R=a[r];
	}
	
//	cout<<sum<<" ";
	
	l++;
	if(l==r) break;
	if(abs(a[l]-L)>=abs(a[l]-R))
	{
		sum+=abs(a[l]-L);
		L=a[l];
	}
	else
	{
		sum+=abs(a[l]-R);
		R=a[l];
	}
	
//	cout<<sum<<" ";
}
cout<<sum<<endl;

 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:12: error: 'l' was not declared in this scope
   31 |         if(l==r) break;
      |            ^
a.cc:45:9: error: 'l' was not declared in this scope
   45 |         l++;
      |         ^
Language: C++

#include<iostream>
#include<string>

using namespace std;

int main(){
int a[100000],b[100000],n;
cin >> n;
for(int i=0;i<n;i++){
	cin >> a[i];
}
for(int i=0;i<n;i++){
	for(int j=i+i;j<n;j++){
		if(a[i]>a[j]){
			int T=a[i];
			a[i]=a[j];
			a[j]=T;
		}
	}
}
if(n%2==1){
		int k=n-1;
	for(int i=0;i<n;i++){
		if((i+1)*2+1<n){
			b[i]=a[(i+1)*2+1];
		}else{
			
			b[i]=a[k];
			k-=2;
		}
	}
}else{
	int k=0;
	for(int i=1;i<=n;i++){
		if(i*2<=n){
			b[i]=a[i*2];
		}else if(k<n){
			b[i]=a[k];
			k+=2;
		}else break;
	}
}
for(int i=0;i<n;i++){
	int l=0,sum=0;
	if(b[i]<b[i+1]){
		l=b[i+1]-b[i];
	}else{
		l=b[i]-b[i+1];
	}
	sum+=l;
}
cout << sum << endl;
	
return 0;}


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

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

int main(){
    int n;
    cin >> n;
    int a[100000];
    for(int i=0;i<n;i++)cin >> a[i];
    sort(a,a+n);
    int b[50000],c[50000];
    for(int i=0;i<n/2;i++){
        b[i]=a[i];
    }
    for(int i=n/2;i<n;i++){
        c[i-n/2]=a[i];
    }
    reverse(c,c+(n-n/2));
    if(i%2==0){
    int ans=c[0]-b[1];
    for(int i=0;i<n/2;i++){
        ans+=c[i]-b[i];
        ans+=c[i+1]-b[i];
    }
    cout << ans << endl;
    }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:18:8: error: 'i' was not declared in this scope
   18 |     if(i%2==0){
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define long_long ll
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    int a[N];
    for(int i = 0;i < N;i++){
        cin >> a[i];
    }
    stable_sort(a,a + N);
    int count = 0;
    int b[N] = {0};
    for(int i = 2;i < N;i += 2){
        b[i] = a[N - i];
    }

    for(int i = 1;i < N; i+= 2){
        b[i] = a[N - i];
    }
    for(int i = 0;i < N - 1;i++){
        if(b[i] - b[i + 1] < 0){
            count += b[i + 1] - b[i];
        }else{
            count += b[i] - b[i + 1];
        }
        }
        cout << count << endl;
    }

}


Compiler output:
a.cc:33:1: error: expected declaration before '}' token
   33 | }
      | ^
Language: Java

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n];
        for(int i=0; i<n; i++){
            a[i] = sc.nextInt();
        }
        int max=0;
        for(i=0; i<n-1; i++){
            int x;
            if(a[i] < a[i+1]){
                x = a[i+1]-a[i];
            }else{
                x = a[i]-a[i+1];
            }
            if(x > max){
                max = x;
            }
        }
        System.out.println(max);
    }
}

Compiler output:
Main.java:12: error: cannot find symbol
        for(i=0; i<n-1; i++){
            ^
  symbol:   variable i
  location: class Main
Main.java:12: error: cannot find symbol
        for(i=0; i<n-1; i++){
                 ^
  symbol:   variable i
  location: class Main
Main.java:12: error: cannot find symbol
        for(i=0; i<n-1; i++){
                        ^
  symbol:   variable i
  location: class Main
Main.java:14: error: cannot find symbol
            if(a[i] < a[i+1]){
                 ^
  symbol:   variable i
  location: class Main
Main.java:14: error: cannot find symbol
            if(a[i] < a[i+1]){
                        ^
  symbol:   variable i
  location: class Main
Main.java:15: error: cannot find symbol
                x = a[i+1]-a[i];
                      ^
  symbol:   variable i
  location: class Main
Main.java:15: error: cannot find symbol
                x = a[i+1]-a[i];
                             ^
  symbol:   variable i
  location: class Main
Main.java:17: error: cannot find symbol
                x = a[i]-a[i+1];
                      ^
  symbol:   variable i
  location: class Main
Main.java:17: error: cannot find symbol
                x = a[i]-a[i+1];
                           ^
  symbol:   variable i
  location: class Main
9 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    int N;
    scanf("%d",&N);
    ll A[N],C=0,D=0;
    for(int i=0;i<N;i++){
		scanf("%lld",&A[i]);
	}
	sort(A,A+N);
	int K=N/2;
	
	A[N/2];
	if(N%2){
		if( (A[K]-A[K-1]) > (A[K+1]-A[K]) ){
			//D bigger\
			for(int i=0;i<K;i++){
				C+=A[i];
			}
			for(int i=K;i<N;i++){
				D+=A[i];
			}
			printf("%lld",2*D-2*C-A[K+1]-A[K]);
		}else{
			//C bigger
			for(int i=0;i<K+1;i++){
				C+=A[i];
			}
			for(int i=K+1;i<N;i++){
				D+=A[i];
			}
			printf("%lld",2*D-2*C+A[K-1]+A[K]);
		}
	}else{
		for(int i=0;i<K;i++){
			C+=A[i];
		}
		for(int i=K;i<N;i++){
			D+=A[i];
		}
		printf("%lld",2*D-2*C-A[K]+A[K-1]);
	}
}
	


Compiler output:
a.cc: In function 'int main()':
a.cc:19:38: error: 'i' was not declared in this scope
   19 |                                 C+=A[i];
      |                                      ^
a.cc: At global scope:
a.cc:35:10: error: expected unqualified-id before 'else'
   35 |         }else{
      |          ^~~~
a.cc:44:1: error: expected declaration before '}' token
   44 | }
      | ^
Language: C++

#include <cstdio>
#include <algorithm>
using namespace std;
int N,A[100005],l,r;
long long Ans;
inline void read(int &Res){
	char ch=getchar(); bool fl=false;
	for (Res=0;!isdigit(ch);ch=getchar()) fl=ch=='-';
	for (;isdigit(ch);ch=getchar()) Res=(Res<<3)+(Res<<1)+ch-48;
	if (fl) Res=-Res;
}
int main(){
	read(N);
	for (int i=1;i<=N;++i) read(A[i]);
	std::sort(A+1,A+1+N),l=r=A[N];
	for (int i=1,num=1,fl=0;num<N;i=N-i+fl,fl^=1,++num) if (abs(A[i]-l)>abs(A[i]-r)){
		Ans+=abs(A[i]-l),l=A[i];
	} else{
		Ans+=abs(A[i]-r),r=A[i];
	}
	return printf("%lld",Ans),0;
}

Compiler output:
a.cc: In function 'void read(int&)':
a.cc:8:21: error: 'isdigit' was not declared in this scope
    8 |         for (Res=0;!isdigit(ch);ch=getchar()) fl=ch=='-';
      |                     ^~~~~~~
a.cc:9:15: error: 'isdigit' was not declared in this scope
    9 |         for (;isdigit(ch);ch=getchar()) Res=(Res<<3)+(Res<<1)+ch-48;
      |               ^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
int N,ans=0;
cin >> N;
vector<int> data(N);
sort(data.begin(),data.end())
for(int i=0;i <= N;i++){
if(data[i]-data[N-i] < 0){
ans += data[N-i]-data[i];
}
else if(data[i]-data[N-i]>0){
ans += data[i]-data[N-i];
}
}
 cout << ans/2 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:30: error: expected ';' before 'for'
    7 | sort(data.begin(),data.end())
      |                              ^
      |                              ;
    8 | for(int i=0;i <= N;i++){
      | ~~~                           
a.cc:8:13: error: 'i' was not declared in this scope
    8 | for(int i=0;i <= N;i++){
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
int N,ans=0;
cin >> N;
vector<int> data(N);
for(int i=1;i <= N;i++){
if(data[i-1]-data[i] < 0)[
ans += data[i]-data[i-1];
}
else if(data[i-1]-data[i]>0){
ans += data[i-1]-data[i];
}
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:4: error: expected ',' before '+=' token
    9 | ans += data[i]-data[i-1];
      |    ^~~
      |    ,
a.cc:9:5: error: expected identifier before '+=' token
    9 | ans += data[i]-data[i-1];
      |     ^~
a.cc:9:25: error: expected ']' before ';' token
    9 | ans += data[i]-data[i-1];
      |                         ^
      |                         ]
a.cc: In lambda function:
a.cc:9:25: error: expected '{' before ';' token
a.cc: In function 'int main()':
a.cc:11:1: error: 'else' without a previous 'if'
   11 | else if(data[i-1]-data[i]>0){
      | ^~~~
a.cc:11:14: error: 'i' was not declared in this scope
   11 | else if(data[i-1]-data[i]>0){
      |              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
int N,ans=0;
cin >> N;
vector<int> data(N);
for(i=1;i <= N;i++){
if(data[i-1]-data[i] < 0)[
ans += data[i]-data[i-1];
}
else if(data[i-1]-data[i]>0){
ans += data[i-1]-data[i];
}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'i' was not declared in this scope
    7 | for(i=1;i <= N;i++){
      |     ^
a.cc:9:4: error: expected ',' before '+=' token
    9 | ans += data[i]-data[i-1];
      |    ^~~
      |    ,
a.cc:9:5: error: expected identifier before '+=' token
    9 | ans += data[i]-data[i-1];
      |     ^~
a.cc:9:25: error: expected ']' before ';' token
    9 | ans += data[i]-data[i-1];
      |                         ^
      |                         ]
a.cc: In lambda function:
a.cc:9:25: error: expected '{' before ';' token
a.cc: In function 'int main()':
a.cc:11:1: error: 'else' without a previous 'if'
   11 | else if(data[i-1]-data[i]>0){
      | ^~~~
a.cc:11:14: error: 'i' was not declared in this scope
   11 | else if(data[i-1]-data[i]>0){
      |              ^
Language: C++

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

const string YES = "Yes";
const string NO = "No";
#include <bits/stdc++.h>
using namespace std;

const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

const string YES = "Yes";
const string NO = "No";

int main(){
    int n;
    cin >> n;
    int k = 1;
    while (k*(k-1)/2 <= n) {
        if (k*(k-1)/2 == n) break;
        ++k;
    }
    if (k*(k-1)/2 > n) cout << NO << endl;
    else {
        vector<vi> s(k);
        int val = 1;
        for (int i=0; i<k; ++i) for (int j=i+1; j<k; ++j) {
            s[i].pb(val); s[j].pb(val);
            ++val;
        }
        cout << YES << endl;
        cout << k << endl;
        rep(i, k) {
            printf("%d ", k-1);
            rep(j, k-1) printf("%d%c", s[i][j], (j<k-2?' ':'\n'));
        }
    }
    return 0;
}

void solve(long long N) {}

// 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);
  solve(N);
  return 0;
}


Compiler output:
a.cc:45:14: error: redefinition of 'const std::string YES'
   45 | const string YES = "Yes";
      |              ^~~
a.cc:4:14: note: 'const std::string YES' previously declared here
    4 | const string YES = "Yes";
      |              ^~~
a.cc:46:14: error: redefinition of 'const std::string NO'
   46 | const string NO = "No";
      |              ^~
a.cc:5:14: note: 'const std::string NO' previously declared here
    5 | const string NO = "No";
      |              ^~
a.cc:79:5: error: redefinition of 'int main()'
   79 | int main() {
      |     ^~~~
a.cc:48:5: note: 'int main()' previously defined here
   48 | int main(){
      |     ^~~~
Language: C++

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<iostream>
using namespace std;
using i32 = int_fast32_t;
using i64 = int_fast64_t;
#define rep(i, n) for (i32 i = 0; i < (i32)(n); i++)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
using P = pair<i64,i64>;

int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
i32 n;
cin >> n;
if(n < 4 && n != 2){
    cout << "Yes" << endl;
    if(n == 1){
        cout << 2 << endl;
        cout << "2 1 1" << endl;
        cout << "2 1 1" << endl;
    }else if(n == 3){
        cout << 3 << endl;
        cout << "2 1 2" << endl;
        cout << "2 3 1" << endl;
        cout << "2 2 3" << endl;

    }
}else{
    cout << "No" << endl;
}

Compiler output:
a.cc:6:13: error: 'int_fast32_t' does not name a type
    6 | using i32 = int_fast32_t;
      |             ^~~~~~~~~~~~
a.cc:7:13: error: 'int_fast64_t' does not name a type
    7 | using i64 = int_fast64_t;
      |             ^~~~~~~~~~~~
a.cc:11:16: error: 'i64' was not declared in this scope
   11 | using P = pair<i64,i64>;
      |                ^~~
a.cc:11:20: error: 'i64' was not declared in this scope
   11 | using P = pair<i64,i64>;
      |                    ^~~
a.cc:11:23: error: template argument 1 is invalid
   11 | using P = pair<i64,i64>;
      |                       ^
a.cc:11:23: error: template argument 2 is invalid
a.cc: In function 'int main()':
a.cc:16:1: error: 'i32' was not declared in this scope
   16 | i32 n;
      | ^~~
a.cc:17:8: error: 'n' was not declared in this scope
   17 | cin >> n;
      |        ^
a.cc:33:2: error: expected '}' at end of input
   33 | }
      |  ^
a.cc:13:11: note: to match this '{'
   13 | int main(){
      |           ^
Language: C++

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<iostream>
using namespace std;
using i32 = int_fast32_t;
using i64 = int_fast64_t;
#define rep(i, n) for (i32 i = 0; i < (i32)(n); i++)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
using P = pair<i64,i64>;

int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
i32 n;
cin >> n;
if(n < 4 && n != 2){
    cout << "Yes" << endl;
    if(n == 1){
        cout << 2 << endl;
        cout << "2 1 1" << endl;
        cout << "2 1 1" << endl;
    }
    }else if(n == 3){
        cout << 3 << endl;
        cout << "2 1 2" << endl;
        cout << "2 3 1" << endl;
        cout << "2 2 3" << endl;
        
    }
}else{
    cout << "No" << endl;
}

Compiler output:
a.cc:6:13: error: 'int_fast32_t' does not name a type
    6 | using i32 = int_fast32_t;
      |             ^~~~~~~~~~~~
a.cc:7:13: error: 'int_fast64_t' does not name a type
    7 | using i64 = int_fast64_t;
      |             ^~~~~~~~~~~~
a.cc:11:16: error: 'i64' was not declared in this scope
   11 | using P = pair<i64,i64>;
      |                ^~~
a.cc:11:20: error: 'i64' was not declared in this scope
   11 | using P = pair<i64,i64>;
      |                    ^~~
a.cc:11:23: error: template argument 1 is invalid
   11 | using P = pair<i64,i64>;
      |                       ^
a.cc:11:23: error: template argument 2 is invalid
a.cc: In function 'int main()':
a.cc:16:1: error: 'i32' was not declared in this scope
   16 | i32 n;
      | ^~~
a.cc:17:8: error: 'n' was not declared in this scope
   17 | cin >> n;
      |        ^
a.cc: At global scope:
a.cc:32:2: error: expected unqualified-id before 'else'
   32 | }else{
      |  ^~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;
using ll = long long;


int main()
{
    if(n == 1) {
        cout << "Yes" << endl;
        cout << 1  << " " << 1 << endl;
        cout << 1  << " " << 1 << endl;
    }
    else if(n == 3) {
        cout << "Yes" << endl;
        cout << 2 << " " << 1 << " " << 2 << endl;
        cout << 2 << " " << 3 << " " << 1 << endl;
        cout << 2 << " " << 2 << " " << 3 << endl;
    } else {
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: 'n' was not declared in this scope; did you mean 'yn'?
    9 |     if(n == 1) {
      |        ^
      |        yn
Language: C++

#include <stdio.h>
#include <stdlib.h>

int main(void) {
	int N;
	int nodeNum;
	int i, j;
	int** edges;
	int* edgeCount;
	int edgeId;
	if (scanf("%d", &N) != 1) return 1;
	if(N < 1) {
		puts("No");
		return 0;
	}
	for (nodeNum = 2; ; nodeNum++) {
		int edgeNum = nodeNum * (nodeNum - 1) / 2;
		if (edgeNum > N) {
			puts("No");
			return 0;
		}
		if (edgeNum == N) break;
	}

	edges = malloc(sizeof(*edges) * nodeNum);
	if (edges == NULL) return 2;
	for (i = 0; i < nodeNum; i++) {
		edges[i] = malloc(sizeof(edges[i][0]) * (nodeNum - 1));
		if (edges[i] == NULL) return 2;
	}
	edgeCount = calloc(nodeNum, sizeof(*edgeCount));
	if (edgeCount == NULL) return 2;

	edgeId = 1;
	for (i = 0; i < nodeNum; i++) {
		for (j = i + 1; j < nodeNum; j++) {
			edges[i][edgeCount[i]++] = edgeId;
			edges[j][edgeCount[j]++] = edgeId;
			edgeId++;
		}
	}

	puts("Yes");
	printf("%d\n", nodeNum);
	for (i = 0; i < nodeNum; i++) {
		printf("%d", edgeCount[i]);
		for (j = 0; j < edgeCount[i]; j++) {
			printf(" %d", edges[i][j]);
		}
		putchar('\n');
		free(edges[i]);
	}

	free(edges);
	free(edgeCount);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:23: error: invalid conversion from 'void*' to 'int**' [-fpermissive]
   25 |         edges = malloc(sizeof(*edges) * nodeNum);
      |                 ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                       |
      |                       void*
a.cc:28:34: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
   28 |                 edges[i] = malloc(sizeof(edges[i][0]) * (nodeNum - 1));
      |                            ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                  |
      |                                  void*
a.cc:31:27: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
   31 |         edgeCount = calloc(nodeNum, sizeof(*edgeCount));
      |                     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                           |
      |                           void*
Language: C++

#include <bits/stdc++.h>
#define SZ(x) ((int)(x).size())
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REP1(i,a,b) for (int i = a; i <= (int)(b); i++)
#define ALL(c) (c).begin(), (c).end()
#define RALL(c) (c).rbegin(), (c).rend()
#define PB push_back
#define MP make_pair
using namespace std;
typedef long long LL;
typedef vector<int> VI;
typedef pair<int,int> PII;

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

int main() {
  int n;
  cin >> n;
  if (ni>3||n%2==0 ) {
    cout << "No" << '\n';
    return 0;
  }
  cout << "Yes" << '\n';
  cout << (n+1)/2+1 << '\n';
  cout << (n+1)/2;
  for ( int i=1; i<=(n+1)/2; i++ ) {
    cout << ' ' << i;
  } cout << '\n';
  cout << (n + 1) / 2;
  for (int i = (n+1)/2; i <= n; i++)
  {
    cout << ' ' << i;
  }
  cout << '\n';
  for ( int i=1; i<=n/2; i++ ) {
    cout << 2 << ' ' << i << ' ' << n-i+1 << '\n';
  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:20:7: error: 'ni' was not declared in this scope; did you mean 'n'?
   20 |   if (ni>3||n%2==0 ) {
      |       ^~
      |       n
Language: C++

#include <bits/stdc++.h>
#define SZ(x) ((int)(x).size())
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REP1(i,a,b) for (int i = a; i <= (int)(b); i++)
#define ALL(c) (c).begin(), (c).end()
#define RALL(c) (c).rbegin(), (c).rend()
#define PB push_back
#define MP make_pair
using namespace std;
typedef long long LL;
typedef vector<int> VI;
typedef pair<int,int> PII;

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

int main() {
  int n;
  cin >> n;
  if ( i>3||n%2==0 ) {
    cout << "No" << '\n';
    return 0;
  }
  cout << "Yes" << '\n';
  cout << (n+1)/2+1 << '\n';
  cout << (n+1)/2;
  for ( int i=1; i<=(n+1)/2; i++ ) {
    cout << ' ' << i;
  } cout << '\n';
  cout << (n + 1) / 2;
  for (int i = (n+1)/2; i <= n; i++)
  {
    cout << ' ' << i;
  }
  cout << '\n';
  for ( int i=1; i<=n/2; i++ ) {
    cout << 2 << ' ' << i << ' ' << n-i+1 << '\n';
  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:20:8: error: 'i' was not declared in this scope
   20 |   if ( i>3||n%2==0 ) {
      |        ^
Language: C++

#include<bits//stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0;i < n;i++)
#define req(i,n) for(int i = 1;i <=n;i++)
typedef long long ll;
ll n, m, k, y, x, d, w = -1, num, sum, ans = INF; string s;
vector<vector<pair<int,int>>> Gragh;
int main(void) {
	cin >> n;
	for(int i = 0;i*(i-1)/2 <= n;i++)  {
		if (i * (i - 1) / 2 == n) {
			w = i;
			break;
		}
	}if (w == -1) cout << "No" << endl;
	else {
		cout << "Yes" << endl;
		vector<vector<int>> S(w);
		num = 1;
		rep(i, w) {
			for (int j = i + 1; j < w; j++) {
				S[i].push_back(num);
				S[j].push_back(num);
				num++;
			}
		}
		cout << w << endl;
		rep(i, w) {
			cout << S[i].size();
			rep(j, S[i].size()) cout << ' ' << S[i][j];
			cout << endl;
		}
	}
}

Compiler output:
a.cc:6:46: error: 'INF' was not declared in this scope
    6 | ll n, m, k, y, x, d, w = -1, num, sum, ans = INF; string s;
      |                                              ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N;
  cin>>N;
  int k+1;
  for(int i=0;i*i<=2*N;i++)
    k=i;
  if(k*(k-1)!=2*N)
    cout<<"No"<<endl;
  else{
     int ans=1;
    vector<vector<int>>A(k);
    for(int i=0;i<k-1;i++){
    for(int j=i+1;j<k;j++){
      A.at(i).push_back(ans);
      A.at(j).push_back(ans);
      ans++;
    
    }
    }for(int i=0;i<k;i++){
      cout<<k-1<<" ";
      for(int j=0;j<k-1;j++)
        cout<<A.at(i).at(j)<<" ";
      cout<<endl;
    
    
    }
  }
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:8: error: expected initializer before '+' token
    6 |   int k+1;
      |        ^
a.cc:8:5: error: 'k' was not declared in this scope
    8 |     k=i;
      |     ^
a.cc:9:6: error: 'k' was not declared in this scope
    9 |   if(k*(k-1)!=2*N)
      |      ^
Language: C++

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

const long long INF = 1LL << 60;
int MOD = 1000000007;
double PI = 3.14159265358979323846;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define For(i,s,n) for (int i=s;i<(int)(n);i++)
#define vi vector<int>
#define vii vector< vector<int> >
#define vs vector<string>
#define All(c) (c).begin(), (c).end()
#define Print(x) cout<<(x)<<"\n"
#define Sort(c) sort(c.begin(), c.end())


//D

int N;

int main() {

	cin >> N;
	int k = 1;
	while (k * (k - 1) / 2 < N) k++;
	if (k * (k - 1) / 2 != N) {
		cout << "No" << endl;
		return 0;
	}

	vii A(k);
	int s = 1;
	rep(i, k) {
		for (int j = i + 1; j < k; j++) {
			A[i].push_back(s);
			A[j].push_back(s);
			s++;
		}
	}

	cout << "Yes" << endl;
	rep(i, k) {
		cout << k - 1 << ' ';
		rep(j, k - 1) {
			cout << A[i][j] << ' ';
		}
		cout << endl;
	}

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

#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#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) (int)(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>;
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll n;
  cin>>n;
  ll k=0;
  for(int i=1;i<n;i++){
    if(i*(i-1)==n*2) {
      k=i;
      break;
    }
  }
  if(k==0){
    COUT("No");
    return 0;
  }
  COUT("Yes");
  COUT(k);
  vvll ans(k,nll(0));
  ll cu=1;
  ll i=0;
  ll kk=k-1;
  ll j=1;
  while(cu<=n){
    if(sz(ans[i])-i==k-i-1){
      i++;
      j=i+1;
    }
    ans[i].pb(cu);
    ans[j].pb(cu);
    j++;
    cu++;
  }
  rep(i,k){
    cout<<sz(ans[i])<<" ";
    rep(j,sz(ans[i])){
      cout<<ans[i][j]<<" ";
    }
    cout<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:14: error: 'nll' was not declared in this scope; did you mean 'vll'?
   58 |   vvll ans(k,nll(0));
      |              ^~~
      |              vll
Language: C++

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

int main() {
    int N;
    cin>>N;
    int k = -1;
    int tmp = 0;
    vector<vector<int> > ansarr;
    vector<int>tmparr;;
    for(int i=1;i<=N;++i){
        tmp += i;
        for(int j=tmp-i+1;j<=tmp;++j){
            tmparr.push_back(j);
        }
        ansarr.push_back(tmparr);
        tmparr.clear();
        if(N==tmp){
            k = i;
            break;
        }
        if(N < tmp) {
            break;
        }
    }
    reverse(ansarr.begin(), ansarr.end());
    /**
    for(int i=0;i<ansarr.size();++i){
        for(int j=0;j<ansarr[i].size();++j){
            cout<<ansarr[i][j]<<" ";
        }
        cout<<endl;
    }
    cout<<endl;
    **/
    if(k==-1){
        cout<<"No"<<endl;
    }
    else {
        for(int i=0;i<k;++i){
            cout<<k<<" ";
            for(int j=0;j<=i;++j){
                if(j!=i){
                    cout<<ansarr[j][i-j-1]<<" ";
                }
                else {
                    for(int k=0;k<ansarr[j].size();++k){
                        cout<<ansarr[j][k]<<" ";
                    }
                }
            }
            cout<<endl;
        }
        cout<<k<<" ";
        for(int i=0;i<k;++i){
            cout<<ansarr[i][ansarr[i].size()-1]<<" ";
        }
        cout<<endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:5: error: 'reverse' was not declared in this scope
   27 |     reverse(ansarr.begin(), ansarr.end());
      |     ^~~~~~~
Language: C

int n;
ans[555][555];
id[555];
main()
{
	scanf("%d",&n);
	int k=1;
	for(;k*(k-1)<n*2;k++);
	if(k*(k-1)!=n*2)
	{
		puts("No");
		return 0;
	}
	printf("Yes\n%d\n",k);
	vector<vector<int> >ans(k);
	int p=0,q=1;
	for(int i=1;i<=n;i++)
	{
		ans[p][id[p]++]=i;
		ans[q][id[q]++]=i;
		q++;
		if(q>=k)p++,q=p+1;
	}
	for(int i=0;i<k;i++)
	{
		printf("%d",k-1);
		for(int j=0;j<k-1;j++)printf(" %d",ans[i][j]);
		puts("");
	}
}

Compiler output:
main.c:2:1: warning: data definition has no type or storage class
    2 | ans[555][555];
      | ^~~
main.c:2:1: error: type defaults to 'int' in declaration of 'ans' [-Wimplicit-int]
main.c:3:1: warning: data definition has no type or storage class
    3 | id[555];
      | ^~
main.c:3:1: error: type defaults to 'int' in declaration of 'id' [-Wimplicit-int]
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main()
      | ^~~~
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    6 |         scanf("%d",&n);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int n;
main.c:6:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    6 |         scanf("%d",&n);
      |         ^~~~~
main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:11:17: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
   11 |                 puts("No");
      |                 ^~~~
main.c:11:17: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:14:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   14 |         printf("Yes\n%d\n",k);
      |         ^~~~~~
main.c:14:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:14:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:14:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:15:9: error: 'vector' undeclared (first use in this function)
   15 |         vector<vector<int> >ans(k);
      |         ^~~~~~
main.c:15:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:23: error: expected expression before 'int'
   15 |         vector<vector<int> >ans(k);
      |                       ^~~
Language: C++

#include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <numeric>
#include <algorithm>

using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constexpr lint LINF = 1LL << 60;

template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
	for (const auto &e : vec) os << e << (&e == &vec.back() ? "\n" : " ");
	return os;
}

#ifdef _DEBUG
template <class T>
void dump(const char* str, T &&h) { cerr << str << " = " << h << "\n"; };
template <class Head, class... Tail>
void dump(const char* str, Head &&h, Tail &&... t) {
	while (*str != ',') cerr << *str++; cerr << " = " << h << "\n";
	dump(str + (*(str + 1) == ' ' ? 2 : 1), t...);
}
#define DMP(...) dump(#__VA_ARGS__, __VA_ARGS__)
#else 
#define DMP(...) ((void)0)
#endif

int main() {

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

	int k;
	cin >> k;

	if (k == 3) {
		cout << "Yes\n";
		cout << "3\n";
		cout << "2 1 2\n";
		cout << "2 3 1\n";
		cout << "2 2 3\n";
	}
	else {

		int num = 0;
		for (int i = 0; i * i < 2 * k; i++) {
			if (i * (i + 1) == k * 2) {
				num = i;
				break;
			}
		}

		if (num == 0) cout << "No" << "\n";
		else {
			
			cout << "Yes" << "\n";
			vector<vector<int>> ans(num, vector<int>(num));
			int cnt = 1;
			for (int i = 0; i < num; i++) {
				for (int j = 0; j < num - i; j++) {
					ans[i][j] = ans[num - j - 1][num - i - 1] = cnt++;
				}
			}

			for (int i = 0; i < num; i++) {
				cout << num<< " ";
				for (int j = 0; j < num; j++) {
					cout << ans[i][j] << " ";
				}
				cout << "\n";
			}
			v
			for (int i = 0; i < num; i++) cout << ans[i][num - i - 1] << " ";
			cout << "\n";

		}

	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:82:25: error: 'v' was not declared in this scope
   82 |                         v
      |                         ^
a.cc:83:41: error: 'i' was not declared in this scope
   83 |                         for (int i = 0; i < num; i++) cout << ans[i][num - i - 1] << " ";
      |                                         ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

int main(){
  int N; cin >> N;
  
  for(int k = 0; k <= 1e3; k++){ 
    if( k*(k+1) == 2*N){ 
      vector<vector<int>> S(k+2);
      int cnt = 1; 
      for(int i = 1; i <= k; i++){
        for(int j = 0; j < i; j++){
          S[i-1].push_back(cnt); cnt++;
        }
      }
      
      for(int m = 0; m < k; m++){ 
        S[k].push_back( ((m*(m+1))/2)+1);
      }
      for(int m = 1; m <= k; m++){
        S[k+1].push_back( (m*(m+1))/2);
      }
      
      cout << "Yes" << endl;
      
      for(int i = 0; i <= k+1; i++){
        cout << S[i].size() << " ";
        for(int j = 0; j < S[i].size(); j++){
          cout << S[i][j] << " ";
        }
       cout << endl;
      }
      
      return 0;
          
    }
  }
  


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

import java.util.*;

public class Main {
    static Sanner scanner = new Scanner(System.in);

    public static void main(String[] args) {
        int n = scanner.nextInt();
        if (n == 3) {
            System.out.println("Yes");
            System.out.println("3");
            System.out.println("2 1 2");
            System.out.println("2 3 1");
            System.out.println("2 2 3");
        } else {
            System.out.println("No");
        }
    }
}

Compiler output:
Main.java:4: error: cannot find symbol
    static Sanner scanner = new Scanner(System.in);
           ^
  symbol:   class Sanner
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main {
    static Sanner scanner = new Scanner(System.in);

    public static void main(String[] args) {
        int n = scanner.nextInt();
        if (n == 3) {
            System.out.println("Yes");
            System.out.println("3");
            System.out.println("2 1 2");
            System.out.println("2 3 1");
            System.out.println("2 2 3")
        } else {
            System.out.println("No");
        }
    }
}

Compiler output:
Main.java:13: error: ';' expected
            System.out.println("2 2 3")
                                       ^
1 error
Language: C++

https://atcoder.jp/contests/tenka1-2018-beginner/standings#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;
const int inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;

int N;

int main()
{
    cin >> N;
    int sum = 0, inx = 0;
    for (int i = 1; sum < N; i++)
    {
        sum += i;
        inx = i;
    }
    if (sum > N)
    {
        cout << "No" << endl;
    }
    else
    {
        cout << "Yes" << endl;
        int k = inx + 1, now = 1;
        cout << k << endl;
        vector<vector<int>> v(k);
        for (int i = 1; i < k; i++)
        {
            for (int j = 0; j < i; j++)
            {
                v[j].push_back(now);
                v[i].push_back(now);
                now++;
            }
        }
        for (int i = 0; i < k; i++)
        {
            cout << v[i].size() << " ";
            for (int j = 0; j < v[i].size(); j++)
            {
                cout << v[i][j] << (j == v[i].size() - 1 ? "\n" : " ");
            }
        }
    }
}

Compiler output:
a.cc:1:1: error: 'https' does not name a type
    1 | https://atcoder.jp/contests/tenka1-2018-beginner/standings#include <bits/stdc++.h>
      | ^~~~~
a.cc: In function 'int main()':
a.cc:12:5: error: 'cin' was not declared in this scope
   12 |     cin >> N;
      |     ^~~
a.cc:21:9: error: 'cout' was not declared in this scope
   21 |         cout << "No" << endl;
      |         ^~~~
a.cc:21:25: error: 'endl' was not declared in this scope
   21 |         cout << "No" << endl;
      |                         ^~~~
a.cc:25:9: error: 'cout' was not declared in this scope
   25 |         cout << "Yes" << endl;
      |         ^~~~
a.cc:25:26: error: 'endl' was not declared in this scope
   25 |         cout << "Yes" << endl;
      |                          ^~~~
a.cc:28:9: error: 'vector' was not declared in this scope
   28 |         vector<vector<int>> v(k);
      |         ^~~~~~
a.cc:28:23: error: expected primary-expression before 'int'
   28 |         vector<vector<int>> v(k);
      |                       ^~~
a.cc:33:17: error: 'v' was not declared in this scope
   33 |                 v[j].push_back(now);
      |                 ^
a.cc:40:21: error: 'v' was not declared in this scope
   40 |             cout << v[i].size() << " ";
      |                     ^
Language: C++

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

int main(){
  int N;cin>>N;
  int k=0;
  for (int i=1;i*i<=N;++i){
    if((i*(i-1))/2==N){k=i;break;}
  }
  if(k==0){cout << "No"<< endl;}
  else{
    cout << "Yes" << endl;
    cout << k << endl;

    vi ans[k+1];
    int count=0:
    for (int i=1;i<k;++i){
      for (int j=i+1;j<=k;++j){
        count++;
        ans[i].push_back(count);
        ans[j].push_back(count);
      }
    }

    for (int i=1;i<=k;++i){
      cout << k-1 << ' ';
      for (int j=0;j<k-1;++j){
        cout << ans[i][j] << ' ';
      }
      cout << endl;
    }
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:16: error: expected ',' or ';' before ':' token
   17 |     int count=0:
      |                ^
a.cc:18:18: error: 'i' was not declared in this scope
   18 |     for (int i=1;i<k;++i){
      |                  ^
Language: C++

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

int main(){
  int N;cin>>N;
  int k=0;
  for (int i=1;i*i<=N;++i){
    if((i(i-1))/2==N){k=i;break;}
  }
  if(k==0){cout << "No"<< endl;}
  else{
    cout << "Yes" << endl;
    cout << k << endl;

    vi ans[k+1];
    int count=0:
    for (int i=1;i<k;++i){
      for (int j=i+1;j<=k;++j){
        count++;
        ans[i].push_back(count);
        ans[j].push_back(count);
      }
    }

    for (int i=1;i<=k;++i){
      cout << k-1 << ' ';
      for (int j=0;j<k-1;++j){
        cout << ans[i][j] << ' ';
      }
      cout << endl;
    }
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: 'i' cannot be used as a function
    9 |     if((i(i-1))/2==N){k=i;break;}
      |         ~^~~~~
a.cc:17:16: error: expected ',' or ';' before ':' token
   17 |     int count=0:
      |                ^
a.cc:18:18: error: 'i' was not declared in this scope
   18 |     for (int i=1;i<k;++i){
      |                  ^
Language: C++

#include <iostream>
#include <cstring>
#include <cstdlib>
#include <set>
#include <vector>
#include <map>
#include <cstdio>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <cassert>
#include <climits>
using namespace std;
typedef long long ll;
#define DEBUG
#ifdef DEBUG
	#define debug printf
#else
	#define debug(...)
#endif
const int maxn = 1e3 + 5;
int a[maxn][maxn];
int main(int argc, char const *argv[])
{
	int flag = 0;
	int n,k = 0;
	cin>>n;
	for(int i = 1;i * (i - 1) <= 2 * n && flag == 0; ++i,flag = (2 * n == (i * (i - 1)) ? i : 0));
	for(int i = 1;i <= flag && k <= n; ++i)
	{
		for(int j = i;j < d && k <= n; ++j)
		{
			a[i][j] = a[j + 1][i] = k++;
		}
	}
	if(flag)
	{
		printf("Yes\n%d\n",n);
		for(int i = 1;i <= n; ++i)
		{
			printf("%d ",flag - 1);
			for(int j = 1;j < flag; ++j)
			{
				printf("%d ",a[i][j]);
			}
			printf("\n");
		}
	}
	else
	{
		printf("No\n");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:33:35: error: 'd' was not declared in this scope
   33 |                 for(int j = i;j < d && k <= n; ++j)
      |                                   ^
Language: C++

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

#define rep(i, n) for(int (i)=0; (i)<(n); (i)++) 
#define reps(i, A, n) for(int (i)=(A); (i)<(n); (i)++)
using LL = long long;

const LL MOD = 1e9+7;
 
int N;
int K;
vector<int> S[114514];

int main() {
  scanf("%d", &N);
  reps(k, 1, N+1) {
    if (k*(k-1) > 2*N) {
      puts("No");
      return 0;
    }
    
    if (k*(k-1) == 2*N) {
      K = k;
    }
  }
  
  int cnt = 0;
  rep(i, K) {
    reps(j, i+1, K) {
      ++cnt;
      S[i].pb(cnt);
      S[j].pb(cnt);
    }
  }
  
  printf("Yes\n%d\n", K);
  rep(i, K) {
    printf("%d", (int)S[i].size());
    for (int v : S[i]) {
      printf(" %d", v);
    }
    puts("");
  }
}
      
    
    


Compiler output:
a.cc: In function 'int main()':
a.cc:31:12: error: 'class std::vector<int>' has no member named 'pb'
   31 |       S[i].pb(cnt);
      |            ^~
a.cc:32:12: error: 'class std::vector<int>' has no member named 'pb'
   32 |       S[j].pb(cnt);
      |            ^~
Language: C++

#include<iostream>
using namespace std;

int main(){
	int N;
	cin >> N;
	int i = 1;
	while(N-i>0){
		N = N - i;
		i++;
	}
	int ans[100000][100000];
	int num = 1;
	if(N==(i*(i+1)/2)){
		cout << "Yes" << endl;
		for(int j=0;j<i;j++){
			for(int k=j;k<i;k++){
				ans[j][k] = num;
				num++;
			}
		}
		for(int l=0;l<i;l++){
			for(int m=l+1;m<i+1;m++){
				ans[m][l] = ans[l][m-1];
			}
		}
		for(int s=0;s<i+1;s++){
			for(int t=-1;t<i;t++){
				if(t==-1){
					cout << i << " ";
				}else if(t==i-1){
					cout << ans[s][t] << endl;
				}else{
					cout << ans[s][t] << " ";
				}
	}else{
		cout << "No" << endl;
	}
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:36:10: error: 'else' without a previous 'if'
   36 |         }else{
      |          ^~~~
a.cc:39:2: error: expected '}' at end of input
   39 | }
      |  ^
a.cc:14:27: note: to match this '{'
   14 |         if(N==(i*(i+1)/2)){
      |                           ^
a.cc:39:2: error: expected '}' at end of input
   39 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: Java

import java.util.Scanner;
public class Main {

	public static void main(String[] args)throws Exception {
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int a[][]=new int[200][200];
		int z=1,y=0,x=1;
		int key=0;
		while(true) {
			if(z*(z+1)/2==N) {
				key=z;
				break;
			}
			if(z*(z+1)>N)
				break;
			z++;
		}z=0;
		if(key==0)
			System.out.println("No");
		else {
			while(z<key) {
				while(y<key) {
					a[z][y]=x;
					a[y+1][z]=x;
					x++;y++;
				}
				z++;
				y=z;
			}z=0;y=0;x=0;
			System.out.println("Yes");
			System.out.println(key+1);
			while(z<key+1) {
				while(y<key) {
					System.out.print(key);
					System.out.print(a[z][y]);
					y++;
				}y=0;
				System.out.println();
				z++;
			}
		}
	}

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


#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <functional>
#include <algorithm>
#include <cmath>

using namespace std;

#define in(x) cin >> x
#define out(x) cout << x << endl

#define PI acos(-1)
#define pp push_back

#define Yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define No cout << "No" << endl
#define NO cout << "NO" << endl

#define vec2(type) vector<vector<type>>
#define vec3(type) vector<vector<vector<type>>>

#define For(i, n) for(int i = 0; i < n; i++)

template<typename T> void sort(vector<T> &ary){
	sort(ary.begin(), ary.end());
}

template<typename T> void rsort(vector<T> &ary){
	sort(ary.rbegin(), ary.rend());
}

void rstring(string &str){
	string temp = str;

	For(i, (int)str.size()){
		str[i] = temp[(str.size() - 1) - i];
	}
}

int main(){

	int n, k;
	int num;

	cin(n);

	if(n == 2){
		No;
		return 0;
	}

	for(k = 1; k <= n; k++){
		if((long long)k * (k - 1) / 2 == n){
			break;
		}
		else if((long long)k * (k - 1) / 2 > n){
			No;
			return 0;
		}
	}

	Yes;

	out(k);
	for(int i = 1; i <= k; i++){
		cout << k - 1 << " ";
		num = 0;

		for(int j = 1; j <= i - 1; j++){
			num += k - j;
			cout << num - (k - i) << " ";
		}

		for(int j = i; j <= k - 1; j++){
			num++;
			cout << num << " ";
		}
		cout << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:12: error: no match for call to '(std::istream {aka std::basic_istream<char>}) (int&)'
   52 |         cin(n);
      |         ~~~^~~
Language: C++

#include <bits/stdc++.h>

#define ll long long
#define inf 0x3f3f3f3f 
#define il inline 

#define in1(a) a=read()
#define in2(a,b) in1(a),in1(b)
#define in3(a,b,c) in2(a,b),in1(c)
#define in4(a,b,c,d) in2(a,b),in2(c,d)
#define out(a) printf( "%d" , a ) 
#define out_(a) printf( " %d" , a )
#define outn(a) out(a),putchar('\n')

#define I_int int 
inline I_int read() {

    I_int x = 0 , f = 1 ; char c = getchar() ;
    while( c < '0' || c > '9' ) {
        if( c == '-' ) f = -1 ;
        c = getchar() ;
    }
    while( c >= '0' && c <= '9' ) {
        x = (x << 1) + (x << 3) + c - 48 ;
        c = getchar() ;
    }
    return x * f ;
}
#undef I_int

using namespace std ;

int n , k ;
vector<int>s[N]; 

int main() {
	in1( n ) ;
	k = -1 ;
	for( int i = 1 ; i <= n ; i ++ ) {
		if( i * ( i - 1 ) / 2 == n ) {
			k = i ;
			break ;
		}
	}
	if( k == -1 ) { return puts("No"),0; }
	int x = 0 ;
	for( int i = 0 ; i < k ; i ++ ) {
		for( int j = i + 1 ; j < k ; j ++ ) {
			x ++ ;
			s[ i ].push_back( x ) ;
			s[ j ].push_back( x ) ;
		}
	}
	puts("Yes"); outn(k);
	for( int i = 0 ; i < k ; i ++ ) {
		out((int)s[i].size());
		int len = s[ i ].size();
		for( int j = 0 ; j < len ; j ++ ) {
			out_(s[i][j]);
		}
		putchar('\n');
	}
	return 0 ;
}

Compiler output:
a.cc:34:14: error: 'N' was not declared in this scope
   34 | vector<int>s[N];
      |              ^
a.cc: In function 'int main()':
a.cc:50:25: error: 's' was not declared in this scope
   50 |                         s[ i ].push_back( x ) ;
      |                         ^
a.cc:56:26: error: 's' was not declared in this scope
   56 |                 out((int)s[i].size());
      |                          ^
a.cc:11:31: note: in definition of macro 'out'
   11 | #define out(a) printf( "%d" , a )
      |                               ^