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


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


using namespace std;

class Puzzle
{
public:
	int N ,K;

	void input()
	{
		cin >> N >> K;
	}

	void play()
	{
		long long ans = 0;;

		int cnt_n = N / K;
		int cnt_h = 0;
		if (K % 2 == 0) {
			cnt_h = N / (K / 2) - cnt_n;
		}

		ans = pow(cnt_n, 3) + pow(cnt_h, 3);

		printf("%lld", ans);
	}


};

int main()
{

	Puzzle puz;

	puz.input();
	puz.play();

	return 0;
}



Compiler output:
a.cc: In member function 'void Puzzle::play()':
a.cc:29:23: error: 'pow' was not declared in this scope
   29 |                 ans = pow(cnt_n, 3) + pow(cnt_h, 3);
      |                       ^~~
Language: C++

#include <stack>
#include <queue>
#include <cstdio>
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <string>
 
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,n0,n) for(int i=n0;i<n;i++)
#define Com(i,j,n) for(int i=0;i<n-1;i++)for(int j=i+1;j<n;j++)
#define INF (1<<29)

int main (){
	int NN, KK;
	cin >> NN >> KK;
	int full=0,half=0;	
	Rep(i,1,NN+1){
		if(i%KK==0) full++;
		if(i%KK==KK/2　&& KK%2==0) half++;
	}
	if(KK%2==1) half=0;
	cout << full*full*full+half*half*half << endl;

	return 0;	
}


Compiler output:
a.cc:22:29: error: extended character 　 is not valid in an identifier
   22 |                 if(i%KK==KK/2　&& KK%2==0) half++;
      |                             ^
a.cc: In function 'int main()':
a.cc:22:29: error: unable to find numeric literal operator 'operator""\U00003000'
   22 |                 if(i%KK==KK/2　&& KK%2==0) half++;
      |                             ^~~
Language: C++

#include <iostream>
using namespace std;

int main()
{
	int N, K;
	cin >> N >> K;
	int ans = 0;
	if (K % 2 == 0) {
		int a = N / K;
		int b = N / (K/2) - a;
		ans = pow(a, 3) + pow(b, 3);
	}
	else {
		int a = N / K;
		ans = pow(a, 3);
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: 'pow' was not declared in this scope
   12 |                 ans = pow(a, 3) + pow(b, 3);
      |                       ^~~
a.cc:16:23: error: 'pow' was not declared in this scope
   16 |                 ans = pow(a, 3);
      |                       ^~~
Language: C++

#include <iostream>
using namespace std;

int main()
{
	int N, K;
	cin >> N >> K;
	int ans = 0;
	if (K % 2 == 0) {
		int a = N / K;
		int b = 2*N / K - a;
		ans = pow(a, 3) + pow(b, 3);
	}
	else {
		int a = N / K;
		ans = pow(a, 3);
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: 'pow' was not declared in this scope
   12 |                 ans = pow(a, 3) + pow(b, 3);
      |                       ^~~
a.cc:16:23: error: 'pow' was not declared in this scope
   16 |                 ans = pow(a, 3);
      |                       ^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;


int main(int argc, char const *argv[])
{
	int n, k;
	cin >> n >> k;
	
	int a, b, c;
	int ans = 0;
	for(a = 1; a <= n; a++)
	{
		for(b = 1; b <= n; b++)
		{
			if((a+b) % k != 0) continue;
			for(c = 1; c <= n; c++)
			{
				if(((b+c) % k == 0 && (a+c) % k == 0) {
					ans++;
				}

			}

		}

	}
	cout << ans;
		

	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:20:70: error: expected ')' before '{' token
   20 |                                 if(((b+c) % k == 0 && (a+c) % k == 0) {
      |                                   ~                                  ^~
      |                                                                      )
a.cc:24:25: error: expected primary-expression before '}' token
   24 |                         }
      |                         ^
Language: C++

#include <iostream>
using namespace std;
int abs(int s){
	if(s<0) s=-s;
	return s;
}
int main(){
	long long int n,k,sum1=0,sum2;
	cin >> n >> k;
	if(k%2==0){
		sum1 =(n - k/2)/k +1;
	}
	sum2 = n/k;
	cout << sum1*sum1*sum1+sum2*sum2*sum2;

Compiler output:
a.cc: In function 'int main()':
a.cc:14:47: error: expected '}' at end of input
   14 |         cout << sum1*sum1*sum1+sum2*sum2*sum2;
      |                                               ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

#include <stack>
#include <queue>
#include <cstdio>
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <string>
 
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,n0,n) for(int i=n0;i<n;i++)
#define Com(i,j,n) for(int i=0;i<n-1;i++)for(int j=i+1;j<n;j++)
#define INF (1<<29)

int main (){
	int NN, KK;
	int length = 0;
	int length2 = 0;
	int ans = 0;
	cin >> NN >> KK;

		NN=i;
		if (KK ==1){
			ans = NN * NN * NN;
		}else if(KK % 2 == 1){
			length = (NN-NN%KK)/KK;
			if(NN%KK == 0 && NN > KK) length --;
			ans = length * length * length;
		}else {
			length = (NN-NN%KK)/KK;
			length2 = (NN-NN%(KK/2))/(KK/2) - length ;
			if( NN%(KK/2) == 0 ) {
				length2 --;
			}
			ans = length * length * length + length2 * length2 * length2;


			cout  << ans << " " << anscount << endl;

	
	return 0;	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:20: error: 'i' was not declared in this scope
   23 |                 NN=i;
      |                    ^
a.cc:39:48: error: 'anscount' was not declared in this scope
   39 |                         cout  << ans << " " << anscount << endl;
      |                                                ^~~~~~~~
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
a.cc:16:12: note: to match this '{'
   16 | int main (){
      |            ^
Language: C++


#include<iostream>
using namespace std;
int main(){
  int n,k;
  cin>>n>>k;
  int ans;
  for(int a=0;a<n;a++){
    for(int b=0;b<n;b++){
      for(int c=0;c<n;c++){
       if((a+b)%k==0&&(b+c)%k==0&&(c+a)%k==0){
        ans++;
       }
      }
    }
   cout<<ans<<endl;
}

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

#include<stdio.h>
int main(void)
{
    int a,b,c=0
    
    scanf("%d %d",&a,&b);
    
    for(int i=1; i<=a;i++){
    for(int j=1; j<=a;j++){
    for(int k=1;k<=a;k++){
    if((i+j)%b==0 && (j+k)%b==0 && (i+k)%b==0){
    c=c+1
    }}}}
    printf("%d",c);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:5: error: expected ',' or ';' before 'scanf'
    6 |     scanf("%d %d",&a,&b);
      |     ^~~~~
main.c:12:10: error: expected ';' before '}' token
   12 |     c=c+1
      |          ^
      |          ;
   13 |     }}}}
      |     ~
Language: C

#include<stdio.h>
int main(void){

	int N,K;
	int i,j,k,m;
	int ans=0;
	
	scanf("%d%d",&N,&K);
	
	for(i=1;i<=N;i++){
		for(m=1;m*K<N;m++){
			j=m*K-i;//i+jを満たす
			k=m*K-j;//j+kがおｋ
			j+=K;
			while(j<=N){
				if((j+k)%K==0){
					while(j<=N && k<=N){
				if((i+k)%K==0)
					ans++;
			k+=K;
			j+=K;
		}}
	}
	printf("%d",ans);
	return 0;
}

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

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

int N,K;
int ans=0;
//int tmp[200010]={};

int main(){
  cin >> N >> K;
  for(int x=1;K*x<=N;++x){
    for(int z=1;z<=x;++z){
      for(int y=1;y<=z;++y){
        a=K*(x+z-y)/2;
        b=K*(x+y-z)/2;
        c=K*(y+z-x)/2;
        /*
        if((a+b)%K==0 && (b+c)%K==0 && (a+c)%K==0){
        */
          if(a==b && b==c && c==a){
            ans+=1;
            //tmp[a]+=1;
          }
          else if(a==b || b==c || c==a){
            ans+=3;
            //tmp[a]+=3;
          }
          else{
            ans+=6;
            //tmp[a]+=6;
          }
        }
      }
    }
  }

  /*for(int i=2;i*K<=N;++i){
    ans+=ans;
  }*/

  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'a' was not declared in this scope
   14 |         a=K*(x+z-y)/2;
      |         ^
a.cc:15:9: error: 'b' was not declared in this scope
   15 |         b=K*(x+y-z)/2;
      |         ^
a.cc:16:9: error: 'c' was not declared in this scope
   16 |         c=K*(y+z-x)/2;
      |         ^
a.cc: At global scope:
a.cc:41:3: error: 'cout' does not name a type
   41 |   cout << ans << endl;
      |   ^~~~
a.cc:42:1: error: expected declaration before '}' token
   42 | }
      | ^
Language: C++

#include<iostream>
using namespace std;

int main(){
	int N, K;
	int count = 0;
	int num = 0;
	cin >> N >> K;

	if(K%2 == 1){
		num = K;
	}else{
		num = K/2;
	}

	for(int a=i; a <= N; a += K){
		for(int b=i; b <= N; b += K){
			for(int c=i; c <= N; c += K){
				cout << a << " " << b << " " << c << "\n";
				count += 1;
			}
		}
	}

	cout << count;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:19: error: 'i' was not declared in this scope
   16 |         for(int a=i; a <= N; a += K){
      |                   ^
Language: Java

import java.util.*;
public class C {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		// スペース区切りの整数の入力
		int K = sc.nextInt();
		int cnt = 0;

	
		if(K%2==0){
			int tmp = N;
			for(int i=2;i<=K;i*=2){
				tmp = N;
				cnt+=(tmp/i);
			}
		}
		// 出力
		System.out.println(cnt);
	}
}

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

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

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

typedef long long LL;
const LL mod=1000000007;
#define MAX 10000
#define NIL -1
const double PI  = acos(-1.0);
const int INF = 1e9 + 7;
//-------------------------------------------


LL n,k;
bool syu;
LL cnt;

LL a,b,c;

LL std = 0;



int main(){

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

    cin >> n >> k;

    if( k % 2 == 0){ syu = true;}
    else{ syu = false;}

    std = k / 2;
    a = std;
    b = std;
    c = std;

    if( syu != 0){

        for(LL i = a; i <= n; i += k){
            for(LL j = b; j <= n; j += k){

                cnt += (n - std) /k + 1;
                //dump(i);
                //dump(j);
                //dump(cnt);

            }

        }

    }


    for(LL i = k; i <= n; i += k){
        for(LL j = k; j <= n; j += k){

            cnt += n / k;

        }
    }


    cout << cnt << endl;






    return 0;
}


Compiler output:
a.cc:45:4: error: 'LL std' redeclared as different kind of entity
   45 | LL std = 0;
      |    ^~~
In file included from /usr/include/c++/14/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:308:11: note: previous declaration 'namespace std { }'
  308 | namespace std
      |           ^~~
a.cc: In function 'int main()':
a.cc:59:9: error: expected primary-expression before '=' token
   59 |     std = k / 2;
      |         ^
a.cc:60:12: error: expected primary-expression before ';' token
   60 |     a = std;
      |            ^
a.cc:61:12: error: expected primary-expression before ';' token
   61 |     b = std;
      |            ^
a.cc:62:12: error: expected primary-expression before ';' token
   62 |     c = std;
      |            ^
a.cc:69:32: error: expected primary-expression before ')' token
   69 |                 cnt += (n - std) /k + 1;
      |                                ^
Language: C++

#include<iostream>
using namespace std;
int main(){
	int N,K;
	cin>>N>>K;

			int L=K/2;
			int J=(N/L)-(N/K);
			cout<<((N/K)*(N/K)*(N/K))+(J*J*J)<<endl;
			}

}

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

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

int main() {
int n,k;
cin >> n >> k;  
int a
int b[k];
int c;

int e;
for(int i = 1; i < n+1; i++){
   a = i % k;
   for(int j; j < k;j++){
     if(j == a){
       b[j] += 1;
     }
   }
}
for(int i = 0;i < k; i++){
  c = b[i];
  e += = c*c*c;

}
cout << e << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:1: error: expected initializer before 'int'
    8 | int b[k];
      | ^~~
a.cc:13:4: error: 'a' was not declared in this scope
   13 |    a = i % k;
      |    ^
a.cc:16:8: error: 'b' was not declared in this scope
   16 |        b[j] += 1;
      |        ^
a.cc:21:7: error: 'b' was not declared in this scope
   21 |   c = b[i];
      |       ^
a.cc:22:8: error: expected primary-expression before '=' token
   22 |   e += = c*c*c;
      |        ^
Language: C++

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

int main(){
    int N,K;
    cin >> N >> K;

    if(N<K/2){
        cout << 0 <<endl;
        return 0;
    }
    int n = 0;
    int k = N;
    while(k >= K){
        k -= K;        
        n++;
    }
    int ans = 0;
    if(K%2 == 1){
        ans = n*n*n;
    }else{
        ans = (((n+1)*2*2*2) + n*n*n;//n==0 -> ans=1
    }
    cout << ans << endl;

}
/*
a+b = kx
b+c = ky
c+a = kz
2(a+b+c)= k(x+y+z)
*/


Compiler output:
a.cc: In function 'int main()':
a.cc:24:37: error: expected ')' before ';' token
   24 |         ans = (((n+1)*2*2*2) + n*n*n;//n==0 -> ans=1
      |               ~                     ^
      |                                     )
Language: C++

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

int main(){
    int N,K;
    cin >> N >> K;

    if(N<K/2){
        cout << 0 <<endl;
        return 0;
    }
    int n = 0;
    int k = N;
    while(k >= K){
        k -= K;        
        n++;
    }
    int ans = 0;
    if(K%2 == 1){
        ans = n*n*n;
    }else{
        ans = ((n+1)/2)*2*2*2)*n + n*n*n;//n==0 -> ans=1
    }
    cout << ans << endl;

}
/*
a+b = kx
b+c = ky
c+a = kz
2(a+b+c)= k(x+y+z)
*/


Compiler output:
a.cc: In function 'int main()':
a.cc:24:30: error: expected ';' before ')' token
   24 |         ans = ((n+1)/2)*2*2*2)*n + n*n*n;//n==0 -> ans=1
      |                              ^
      |                              ;
Language: C++

#include <bits/stdc++.h>
 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define CLR(a) memset((a), 0 ,sizeof(a))
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vii;
typedef vector<string> vs;
typedef pair<int, int> pi;
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MKP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
const int INF = 999999;
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll MOD = 1000000007;

int N,K,ans=0;
int main(){   
    cin.tie(0);
	ios::sync_with_stdio(false);
    cin >> N >> K;
    for(int i = 1;i <=N; i++){
            for(int k = 1;k <=N; k++){
                if((i+k) % K == 0){
                    ans++;
                }
            }
        }
    }
	ans /= 3;
    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc:41:9: error: 'ans' does not name a type
   41 |         ans /= 3;
      |         ^~~
a.cc:42:5: error: 'cout' does not name a type
   42 |     cout << ans << endl;
      |     ^~~~
a.cc:44:5: error: expected unqualified-id before 'return'
   44 |     return 0;
      |     ^~~~~~
a.cc:45:1: error: expected declaration before '}' token
   45 | }
      | ^
Language: C++

#include <bits/stdc++.h>
 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define CLR(a) memset((a), 0 ,sizeof(a))
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vii;
typedef vector<string> vs;
typedef pair<int, int> pi;
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MKP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
const int INF = 999999;
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll MOD = 1000000007;

int N,K,ans=0;
int main(){   
    cin.tie(0);
	ios::sync_with_stdio(false);
    cin >> N >> K;
    for(int i = 1;i <=N; i++){
            for(int k = 1;k <=N; k++){
                if((i+k) % K == 0){
                    ans++;
                }
            }
        }
    }

    cout << ans/3 << endl;

    return 0;
}

Compiler output:
a.cc:42:5: error: 'cout' does not name a type
   42 |     cout << ans/3 << endl;
      |     ^~~~
a.cc:44:5: error: expected unqualified-id before 'return'
   44 |     return 0;
      |     ^~~~~~
a.cc:45:1: error: expected declaration before '}' token
   45 | }
      | ^
Language: C++

#include <bits/stdc++.h>
 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define CLR(a) memset((a), 0 ,sizeof(a))
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vii;
typedef vector<string> vs;
typedef pair<int, int> pi;
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MKP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
const int INF = 999999;
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll MOD = 1000000007;

int N,K,ans=0;
int main(){   
    cin.tie(0);
	ios::sync_with_stdio(false);
    cin >> N >> K;
    for(int i = 1;i <=N; i++){
            for(int k = 1;k <=N; k++){
                if((i+j) % K == 0 && (i+k) % K == 0 && (j + k) % K == 0){
                    ans++;
                }
            }
        }
    }

    cout << ans*3 << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:23: error: 'j' was not declared in this scope
   35 |                 if((i+j) % K == 0 && (i+k) % K == 0 && (j + k) % K == 0){
      |                       ^
a.cc: At global scope:
a.cc:42:5: error: 'cout' does not name a type
   42 |     cout << ans*3 << endl;
      |     ^~~~
a.cc:44:5: error: expected unqualified-id before 'return'
   44 |     return 0;
      |     ^~~~~~
a.cc:45:1: error: expected declaration before '}' token
   45 | }
      | ^
Language: C

#include <stdio.h>

int main(){
   int n,k,m,a,b,c,cn[200001],i;

   scanf("%d %d",&n,&k);
   for (i=1;i<=n;i++) cn[i]=-1;
   m=0;
   for (a=1;a<=n;a++) {
      b=k-(a%k);
      if (cn[b]>=0)
         m+=cn[b%k];
      else {
         i=0;
         for (c=k-b;c<=n;c+=k)
            if ((a+c)%k==0) i++;
         m+=(cn[b]=i);
      }
   printf("%d\n",m);
   return 0;
}


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

#include <iostream>
#include <algorithm>
#include <string>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
using namespace std;
typedef long int li;
typedef long long int lli;
typedef pair<lli, int> P;
const lli INF = 0xfffffffffff;
lli n, k, ans;
void solve() {
	if (k % 2 != 0) {
		ans = pow(((n / k) - 1) + 1, 3);
	}
	else {
		ans= pow(((n / k) -1), 3) + pow((((n-(k/2)) / k)+1 ), 3);
		cout << pow(((n - (k / 2)) / k) + 1, 3) << endl;
	}
}
int main(){
	cin >> n >> k;
	solve();
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:17:23: error: 'pow' was not declared in this scope
   17 |                 ans = pow(((n / k) - 1) + 1, 3);
      |                       ^~~
a.cc:20:22: error: 'pow' was not declared in this scope
   20 |                 ans= pow(((n / k) -1), 3) + pow((((n-(k/2)) / k)+1 ), 3);
      |                      ^~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

int main(){
    int n, k;
    cin >> n >> k;
    if(k%2 != 0){
        int x = n/k;
        cout << x*x*x << endl;
        return 0;
    /*}else{
        int y = 
    }*/
}

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

public class Main {

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

		int N = sc.nextInt();
		int K = sc.nextInt();

		int count = 0;

		for (int a=1;a<=N;a++) {
			int ax = a%K;
			int bs = K - ax;
			for (int b=bs;b<=N;b+=K) {
				int bx = b%K;
				int cs1 = K - bx;
				for (int c=cs1;c<=N;c+=K) {
					if ((a+c)%K==0){
						count ++;
					}
				}
			}
		}

		System.out.println(count);

	}

}

Compiler output:
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

import java.util.Scanner;

public class Main2 {

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

		int N = sc.nextInt();
		int K = sc.nextInt();

		int count = 0;

		for (int a=1;a<=N;a++) {
			int ax = a%K;
			int bs = K - ax;
			for (int b=bs;b<=N;b+=K) {
				int bx = b%K;
				int cs1 = K - bx;
				for (int c=cs1;c<=N;c+=K) {
//					if (((a+c)%K==0) && (b+c)%K==0){
						count ++;
//					}
				}
			}
		}

		System.out.println(count);

	}

}

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

#include <stdio.h>
int main(void) {
int n, k, a, b, j, y;
scanf("%d", &n);
scanf("%d", &k);
j = k % 2;
a = n % k;
b = (n - a) / k;
if (j == 1) printf("%d", b*b*b);
else {
y = k / 2;
if (a < y) printf("%d", 2 * b*b*b);
else printf("%d", b*b*b + (b + 1)*(b + 1)*(b + 1));
}

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

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();
int count = 0;
int count2=0,count3=0;

for(int a=1;a<=n;a++) {
	for(int b=a;b<=n;b++) {
		if((a+b)%k != 0) {
			continue;
		}
		for(int c=b;c<=n;c++) {
		if((a+c)%k != 0) {
			continue;
		}
		if((b+c)%k != 0) {
			continue;
		}
		count++;
		if(a==c) {count3++;}else
		if(a==b || b==c) {count2++;}
		}
	}
}

System.out.println((count*6)-(count2*3)-(count3*5));

sc.close();
	}

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

#include "iostream"
#include "vector"
#include "array"
#include "string"
#include "algorithm"
#include "functional"


using namespace std;
#define rep(p,q) for(int i = p;i < q;i++)

//C
int main(void) {
	double n, k;
	cin >> n >> k;
	int num =  floor(n / k);
	int n1 = 0, n2 = 0, n3 = 0;
	if ((int)k % 2 == 1) {
		if (num > 0) {
			n1 = num;
		}
		if (num > 1) {
			n2 = num * (num - 1) * 3;
		}
		if (num > 2) {
			n3 = num * (num - 1) * (num - 2);
		}
		cout << n1 + n2 + n3 << endl;
	}
	else {
		int amari = n - num;
		num = amari >= k / 2 ? num + 1 : num;
		if (num > 0) {
			n1 = num + floor(n / k);
		}
		if (num > 1) {
			n2 = num * (num - 1) * 3;
		}
		if (num > 2) {
			n3 = num * (num - 1) * (num - 2);
		}
		cout << n1 + n2 + n3 << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:20: error: 'floor' was not declared in this scope
   16 |         int num =  floor(n / k);
      |                    ^~~~~
Language: C++

#include <iostream>
#include <numeric>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <utility>
using namespace std;
#define INF 100000000
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define rep(i, n) for(int (i)=1; (i)<=(n); (i)++)
typedef pair<int, int> P;
typedef long long ll;

int main(){
    int N, K
    cin >> N >> K;
    /*int dp[200010][200010];
    for(int i=0; i<200010; i++){
        for(int j=0; j<200010; j++){
            dp[i][j] = 0;
        }
    }
    for(int i=1; i<=N; i++){
        for(int j=1; j<=K; j++){
            if( % j == 0)
            dp[i+1][j+1] = dp[i][j] + 1;
        }
    }*/

    int ans = 0;
    for(int a=1; a<=N; a++){
        for(int b=1; b<=N; b++){
            for(int c=1; c<=N; c++){
                if((a+b)%K==0 && (b+c)%K==0 && (c+a)%K==0)
                    ans++;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: expected initializer before 'cin'
   21 |     cin >> N >> K;
      |     ^~~
a.cc:39:26: error: 'K' was not declared in this scope
   39 |                 if((a+b)%K==0 && (b+c)%K==0 && (c+a)%K==0)
      |                          ^
Language: C++

#include "iostream"
#include "vector"
#include "array"
#include "string"
#include "algorithm"
#include "functional"


using namespace std;
#define rep(p,q) for(int i = p;i < q;i++)

//C
int main(void) {
	double n, k;
	cin >> n >> k;
	int num =  floor(n / k);
	int n1 = 0, n2 = 0, n3 = 0;
	if ((int)k % 2 == 1) {
		if (num > 0) {
			n1 = num;
		}
		if (num > 1) {
			n2 = num * (num - 1) * 3;
		}
		if (num > 2) {
			n3 = num * (num - 1) * (num - 2);
		}
		cout << n1 + n2 + n3 << endl;
	}
	else {
		int amari = n - num;
		num = amari >= k / 2 ? num + 1 : num;
		if (num > 0) {
			n1 = num + floor(n / k);
		}
		if (num > 1) {
			n2 = num * (num - 1) * 3;
		}
		if (num > 2) {
			n3 = num * (num - 1) * (num - 2);
		}
		cout << n1 + n2 + n3 << endl;
	}
	cin >> num;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:20: error: 'floor' was not declared in this scope
   16 |         int num =  floor(n / k);
      |                    ^~~~~
Language: C++

#include <iostream>

using namespace std;

int main()
{
  int N, K;
  cin >> N >> K;
  long s = N/K;
  if(K % 2 == 0){
    int k = K/2, long n = 1;
    for(int i = 0; K*(i+1) + k <= N; i++){
      n++;
    }
    cout << n*n*n + s*s*s;
  }else{
    cout << s*s*s;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:18: error: expected unqualified-id before 'long'
   11 |     int k = K/2, long n = 1;
      |                  ^~~~
a.cc:13:7: error: 'n' was not declared in this scope
   13 |       n++;
      |       ^
a.cc:15:13: error: 'n' was not declared in this scope
   15 |     cout << n*n*n + s*s*s;
      |             ^
Language: Java

public class Main {


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

		int count =0;
		boolean f1,f2,f3;

		for(int a = 1;a<=n;a++) {
			for(int b=1;b<=n;b++) {
				for(int c=1;c<=n;c++) {
					f1 = (a+b)%k==0;
					f2 = (b+c)%k==0;
					f3 = (c+a)%k==0;
					if(f1&&f2&&f3) {
						count++;
					}
				}
			}
		}
		System.out.println(count);
	}
}

Compiler output:
Main.java:5: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include<iostream>
#include <algorithm>
#include<string>
#include <bitset>
#include <vector>
#include <functional>
#include <climits>
#include <iomanip>
#include <utility>
#include <stack>
using namespace std;
using ll = long long;
int main()
{
	ll a, b = 0, c = 0, d = 0;
	char C;
	char s[1000];
	cin >> a;
	cin >> b;
	for (int i = 1; i <= a; i++)
	{
		if (b%2==0&&(i%b)==b/2)
		{
			c++;
		}
		if (i%b==0)
		{
			d++;
		}

	}
	c = pow(c, 3);
	d = pow(d, 3);

	cout << c+d<<endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:13: error: 'pow' was not declared in this scope
   32 |         c = pow(c, 3);
      |             ^~~
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int n,k；
int main(){
	register long long ans=0;
	scanf("%d%d",&n,&k);
	for(register int i=1;i<=n;i++){
		for(register int j=(i/k+1)*k-i;j<=n;j+=k){
			if(i%k!=j%k)continue;
			register int s=(j/k+1)*k-j;
			// for(s;s<=n;s+=k){
			// 	cout<<i<<' '<<j<<' '<<s<<endl;
			// }
			ans+=(n-s)/k+1;
		}
	}
	cout<<ans<<endl;
}

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



import java.util.Scanner;

public class Main2 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		int sum0 = 0;
		int sum1 = 0;
		for(int i=1; i<=N; ++i) {
			if(i % K == 0) {
				sum0++;
			}
			else if(i%K == (K/2) && K%2==0) {
				sum1++;
			}
		}
		long ans = sum0*sum0*sum0;
		ans += sum1*sum1*sum1;
		System.out.println(ans);
	}
}


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

#include <bits/stdc++.h>

#include <atcoder/all>

// #LIB#

using namespace std;
using namespace atcoder;
using ll = long long;
#define double long double
#define rep(i, n) for (long long i = 0; i < (n); ++i)
#define repr(i, a, b) for (auto i = (a); i < (b); ++i)
#define itr(x, c) for (auto&& x : (c))
#define updatemax(t, v) ((t) = std::max((t), (v)))
#define updatemin(t, v) ((t) = std::min((t), (v)))
#ifdef ONLINE_JUDGE
#define endl _endl
const char _endl = (cin.tie(0), cout.tie(0), ios::sync_with_stdio(0), cout.precision(16), '\n');
#endif

vector<ll> pl(ll n) {
  if (n <= 1) return {};
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      auto re = pl(n / i);
      re.push_back(i);
      return re;
    }
  }
  return {n};
};
int main() {
  ll l;
  cin >> l;
  auto ps = pl(l);
  vector<tuple<ll, ll, ll>> edges;
  ll k = 1;
  rep(i, ps.size()) {
    auto x = ps[i];
    rep(j, x) edges.emplace_back(i + 1, i + 2, k * j);
    k *= x;
  }
  cout << ps.size() << " " << edges.size() << endl;
  itr(e, edges) {
    auto [ea, eb, ec] = e;
    cout << ea << " " << eb << " " << ec << endl;
  }
}


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

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

#define rep(i, a, b) for ( int i = (a); i < (b); i++ )
#define per(i, a, b) for ( int i = (b)-1; i >= (a); i--)
#define pb push_back
#define mp make_pair
#define bg begin()
#define en end()
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define sz(v) (int)(v).size()
#define vi vector<int>

using namespace std;

typedef long long ll;
typedef long double ld;

using P = pair<int, int>;
template<typename T>
struct Edge {
    int u, v;
    T cost;
    Edge(int u, int v, T c) : u(u), v(v), cost(c) {}
    bool operator< (const Edge &e) const {return cost < e.cost;}
};

static const long long MOD = 1000000007;
static const long long LINF = (ll)(1e18+99);
static const int INF = 1e9+99;

ll ans;
vi U, V, W;
void add(int u, int v, int w) {
    U.pb(u); V.pb(v); W.pb(w);
}

int main(void) {
    int x;
    cin >> x;
    int N = __builtin_clz(1) - __builtin_clz(x-1) + 1;
    bitset<26> L(x-1), mask((1<<25)-1);
    for (int i=1; i<N; i++) {
        add(N-i, N-i+1, 1<<(i-1));
        add(N-i, N-i+1, 0);
    }

    if (L[0]==1) add(1, N, L.to_ullong()-1);
    add(1, N, L.to_ullong());


    for (int i=0; i<N-1; i++) {
        mask[i] = 0;
        if (L[i]==1) {
            bitset<26> t = L&mask;
            add(1, N-i, t.to_ullong());
        }
    }

    printf("%d %d\n", N, sz(U));
    rep(i, 0, sz(U)) printf("%d %d %d\n", U[i], V[i], W[i]);
    

    
    return 0;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:50:5: error: 'bitset' was not declared in this scope
   50 |     bitset<26> L(x-1), mask((1<<25)-1);
      |     ^~~~~~
a.cc:9:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
    8 | #include <map>
  +++ |+#include <bitset>
    9 | #include <string>
a.cc:50:16: error: 'L' was not declared in this scope
   50 |     bitset<26> L(x-1), mask((1<<25)-1);
      |                ^
a.cc:50:24: error: 'mask' was not declared in this scope
   50 |     bitset<26> L(x-1), mask((1<<25)-1);
      |                        ^~~~
a.cc:63:24: error: 't' was not declared in this scope
   63 |             bitset<26> t = L&mask;
      |                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
struct f{
	int a,b,c;
};
int main(){
	int o;
	cin>>o;
	vector<f> e;
	int r=log2(o);
	int n=r+1;
	for(int i=0;i<r;i++){
		e.push_back(f{i+1,i+2,0});
		e.push_back(f{i+1,i+2,1<<i});
	}
	int p=1<<r;
	for(int i=r;i>=1 && o-p>0;i--){
		int w=1<<(i-1);
		if(o-p>w){
			o-=w;
			e.push_back(f{i,n,o	});
		}
	}
	cout<<n<<' '<<e.size()<<endl;
	for(int i=0;i<e.size();i++)
	cout<<e.a<<' '<<e.b<<' '<<e.c<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: 'class std::vector<f>' has no member named 'a'; did you mean 'at'?
   26 |         cout<<e.a<<' '<<e.b<<' '<<e.c<<endl;
      |                 ^
      |                 at
a.cc:26:27: error: 'class std::vector<f>' has no member named 'b'
   26 |         cout<<e.a<<' '<<e.b<<' '<<e.c<<endl;
      |                           ^
a.cc:26:37: error: 'class std::vector<f>' has no member named 'c'
   26 |         cout<<e.a<<' '<<e.b<<' '<<e.c<<endl;
      |                                     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pint = pair<int,  int>;
using pll = pair<ll, ll>;
using edge = pair<int, ll>;
using Graph = vector<vector<int>>; 
using WeightedGraph = vector<vector<edge>>;
const ll INF = 1LL << 60;
const int INF32 = 1 << 29;
const ll MOD = 1000000007;

int main(){
  int n = 20;
  int L;cin >> L;
  WeightedGraph G(n);
  vector<int> sum(n);
  int M = 0;
  int n2 = 19;
  for(int i = 1; i < n; ++i){
    G[i-1].push_back({i,0});
    int beki = (1<<(i-1));
    sum[i]=sum[i-1]+beki;
    if(sum[i]<L){
      G[i-1].push_back({i,beki});
      M = 2*beki;
      ++n2;
    }
  }
  for(int i = n-1; i >= 0; --i){
    if(sum[i]+M<L){
      G[i].push_back({N-1,M});
      M += sum[i]+1;
      ++n2;
    }
  }
  cout << n << " " << n2 << endl;
  for(int i = 0; i < n; ++i){
    for(auto e : G[i]){
      cout << i+1 << " " << e.first+1 << " " << e.second << endl;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:23: error: 'N' was not declared in this scope
   33 |       G[i].push_back({N-1,M});
      |                       ^
a.cc:33:21: error: no matching function for call to 'std::vector<std::pair<int, long long int> >::push_back(<brace-enclosed initializer list>)'
   33 |       G[i].push_back({N-1,M});
      |       ~~~~~~~~~~~~~~^~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<int, long long int>; _Alloc = std::allocator<std::pair<int, long long int> >; value_type = std::pair<int, long long int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::vector<std::pair<int, long long int> >::value_type&' {aka 'const std::pair<int, long long int>&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<int, long long int>; _Alloc = std::allocator<std::pair<int, long long int> >; value_type = std::pair<int, long long int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<std::pair<int, long long int> >::value_type&&' {aka 'std::pair<int, long long int>&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(void) {
	int L;

	cin >> L;

	int N = 0;
	while (pow(2, N + 1) <= L) N++;

	int r = pow(2, N);

	vector<pair<int, int>> vec;
	for (int i = N - 1; i >= 0; i--) {
		if (L - pow(2, i) >= r) {
			vec.push_back(make_pair(i, L-pow(2, i)));
			L -= pow(2, i);
		}
	}

	cout << N << " " << 2 * N + vec.size() << endl;
	for (int i = 1; i <= N; i++) {
		cout << i << " " << i + 1 << " " << 0 << endl;
		cout << i << " " << i + 1 << " " << pow(2, i-1) << endl;
	}
	for (pair<int, int> p: vec) {
		cout << p.first << " " << N+1 << " " << p.second << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'pow' was not declared in this scope
   13 |         while (pow(2, N + 1) <= L) N++;
      |                ^~~
a.cc:15:17: error: 'pow' was not declared in this scope
   15 |         int r = pow(2, N);
      |                 ^~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(void) {
	int L;

	cin >> L;

	int N = 0;
	while (pow(2, N + 1) <= L) N++;

	int r = pow(2, N);

	vector<pair<int, int>> vec;
	for (int i = N - 1; i >= 0; i--) {
		if (L - pow(2, i) >= r) {
			vec.push_back(make_pair(i, L-pow(2, i)));
			L -= pow(2, i);
		}
	}

	cout << N << " " << 2 * N + vec.size() << endl;
	for (int i = 1; i <= N; i++) {
		cout << i << " " << i + 1 << " " << 0 << endl;
		cout << i << " " << i + 1 << " " << pow(2, i-1) << endl;
	}
	for (pair<int, int> p: vec) {
		cout << p.first << " " << N+1 << " " << p.second << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: 'pow' was not declared in this scope
   12 |         while (pow(2, N + 1) <= L) N++;
      |                ^~~
a.cc:14:17: error: 'pow' was not declared in this scope
   14 |         int r = pow(2, N);
      |                 ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
vector<int> g[21],d[21];
void solve(int x,int l){
	if(x==1)return;
  	if(l==0)return;
	if(l&1)g[1].push_back(x),d[1].push_back(l-1);
  	if(l/2==0)return;
	g[x-1].push_back(x);
	g[x-1].push_back(x);
	d[x-1].push_back(0);
	d[x-1].push_back(l/2);
	solve(x-1,l/2);
}
int main(){
	int l;
	scanf("%d",&l);
	solve(,l);
	int num=0;
	for(int i=1;i<21;i++)num+=g[i].size();
	printf("20 %d\n",num);
	for(int i=1;i<=20;i++){
		for(int j=0;j<g[i].size();j++){
			printf("%d %d %d\n",i,g[i][j],d[i][j]);
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:15: error: expected primary-expression before ',' token
   18 |         solve(,l);
      |               ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
#define _for(i,j,N) for(int i = (j);i < (N);i++)
#define _rep(i,j,N) for(int i = (j);i <= (N);i++)
#define ALL(x) x.begin(),x.end()
#define PB push_back
#define LL long long

template<typename T>
ostream& operator<<(ostream& os,const vector<T>& v) {
    _for(i,0,v.size()) os << v[i] << " ";
    return os;
}

template<typename T>
ostream& operator<<(ostream& os,const set<T>& v){
    for(typename set<T>::iterator it = v.begin();it != v.end();it++)
    os << *it <<" ";
    return os;
}


int main()
{
    int n = 1;
    int L;
    cin >> L;
    L--
    vector<int> A;
    vector<int> B;
    vector<int> C;
    vector<pair<int,int>> need;
    while(L > 3){
        int d = (L+1)/2;
        A.PB(n);A.PB(n);
        B.PB(n+1);B.PB(n+1);
        C.PB(d);C.PB(0);
        if(L%2 == 0){
            need.PB(make_pair(n,L));
            d++;
        }
        L-=d;
        n++;
    }

    if(L == 3){
        A.PB(n);A.PB(n);A.PB(n);A.PB(n);
        B.PB(n+1);B.PB(n+1);B.PB(n+1);B.PB(n+1);
        C.PB(3);C.PB(2);C.PB(1);C.PB(0);
    }
    else if(L == 2){
        A.PB(n);A.PB(n);A.PB(n);
        B.PB(n+1);B.PB(n+1);B.PB(n+1);
        C.PB(2);C.PB(1);C.PB(0);
    }
    else if(L == 1){
        A.PB(n);A.PB(n);
        B.PB(n+1);B.PB(n+1);
        C.PB(1);C.PB(0);

    }
    else{
        while(true);
    }
    printf("%d %d\n",n+1,(int)(A.size()+need.size()));
    _for(i,0,A.size()){
        printf("%d %d %d\n",A[i],B[i],C[i]);
    }
    _for(i,0,need.size()){
        printf("%d %d %d\n",need[i].first,n+1,need[i].second);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:8: error: expected ';' before 'vector'
   29 |     L--
      |        ^
      |        ;
   30 |     vector<int> A;
      |     ~~~~~~
a.cc:36:9: error: 'A' was not declared in this scope
   36 |         A.PB(n);A.PB(n);
      |         ^
a.cc:48:9: error: 'A' was not declared in this scope
   48 |         A.PB(n);A.PB(n);A.PB(n);A.PB(n);
      |         ^
a.cc:53:9: error: 'A' was not declared in this scope
   53 |         A.PB(n);A.PB(n);A.PB(n);
      |         ^
a.cc:58:9: error: 'A' was not declared in this scope
   58 |         A.PB(n);A.PB(n);
      |         ^
a.cc:66:32: error: 'A' was not declared in this scope
   66 |     printf("%d %d\n",n+1,(int)(A.size()+need.size()));
      |                                ^
Language: C++

#include "pch.h"
//sortは初期で昇順 greater<hoge>()で降順

#include <iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<cstring>
#include<string>
#include <set>
#include <cassert>
#include<cmath>
#include<climits>
#include<iomanip>
using namespace std;
#define MOD 1000000007
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ll long long
const long long INF = 1LL << 60;


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

class UnionFind {
	vector<int> data;
public:
	UnionFind(int size) : data(size, -1) { }
	bool unionSet(int x, int y) {
		x = root(x); y = root(y);
		if (x != y) {
			if (data[y] < data[x]) swap(x, y);
			data[x] += data[y]; data[y] = x;
		}
		return x != y;
	}
	bool findSet(int x, int y) {
		return root(x) == root(y);
	}
	int root(int x) {
		return data[x] < 0 ? x : data[x] = root(data[x]);
	}
	int size(int x) {
		return -data[root(x)];
	}
};

int find(vector<long long> &arr, long long obj) {
	if (arr[arr.size() - 1] < obj)return arr.size()-1;
	if (arr[0] > obj)return -1;

	int min = 0; int max = arr.size() - 1;
	for (int i = 0; i < arr.size(); i++) {
		if (arr[min+(max-min) / 2] > obj) {
			max = min + (max - min) / 2;
		}
		else {
			min = min + (max - min) / 2;
		}
		if (max - min == 1) {
			return min;
		}
	}


}

//約数求める //約数
void divisor(ll n,vector<ll> &ret) {
	for (ll i = 1; i * i <= n; i++) {
		if (n % i == 0) {
			ret.push_back(i);
			if (i * i != n) ret.push_back(n / i);
		}
	}
	sort(ret.begin(), ret.end());
	
}
//階乗
long long factorial(long long n, long long mod) {
	long long ret = 1;
	for (long long i = 1; i <= n; i++) {
		ret = (ret * i) % mod;
	}
	return ret;
}
//モジュラ逆数
long long inv_mod(long long n, long long mod) {
	long long a = n % mod, b = mod - 2, ret = 1;
	while (b > 0) {
		if (b & 1) ret = (ret * a) % mod;
		a = (a * a) % mod;
		b >>= 1;
	}
	return ret;
}

long long nPr(long long n, long long r, long long mod) {
	long long ret = 1;
	for (long long i = n; i >= n - r + 1; i--) {
		ret = ret * (i % mod) % mod;
	}
	return ret;
}

long long nCr(long long n, long long r, long long mod) {
	return nPr(n, r, mod) * inv_mod(factorial(r, mod), mod) % mod;
}

ll gcd(ll m, ll n){
	if (n == 0)return m;
	return gcd(n, m%n);
}//gcd



int main() {

	ll l;
	cin >> l;
	ll temp = 2;
	int n = 1;
	vector < pair<pair<ll, ll>, ll>> m;
	if (l == 2) {

	}
	else {
		while (temp - 1 <= l) {

			m.push_back(make_pair(make_pair(n, n + 1), temp/2));
			m.push_back(make_pair(make_pair(n, n + 1), 0));
			temp *= 2;
			n++;

		}
		temp /= 2;
	}
	ll now = temp - 1;
	for (int i = n - 2; i >= 0; i--) {
		if (l - now >= (ll)pow(2, i)) {
			m.push_back(make_pair(make_pair(i + 1, n), now + 1));
			now += (ll)pow(2, i);
		}
	}
	cout << n << ' ' << m.size() << endl;
	for (int i = 0; i < m.size(); i++) {
		cout << m[i].first.first << ' ' << m[i].first.second << ' ' << m[i].second << endl;
	}

	return 0;
}


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<vector>
#include<algorithm>
using namespace std;

int gl(int &cost,int n, vector <vector<int>> &g=vector<vector<int>>(1000,vector<int>(3,-1))){
	if(n==1){
		g[0][0]=1;
		g[0][1]=2;
		g[0][2]=0;
		cost=0;
	}
	else if(n==2){
		g[0][0]=1;
		g[0][1]=2;
		g[0][2]=0;
		g[1][0]=2;
		g[1][1]=3;
		g[1][2]=0;
		g[2][0]=1;
		g[2][1]=3;
		g[2][2]=1;
		cost=1;

	}
	else if(n%2==0){
		gl(cost,n/2,g);
		for(int i=0;g[i][0]!=-1;i++){
			g[i][2]*=2;
		}
		int cnt = 0;
		for(int i=0;g[i][0]!=-1;i++){
			cnt=i;
		}
		g[cnt+1][0]=g[cnt][1];
		g[cnt+1][1]=g[cnt][1]+1;
		g[cnt+1][2]=0;
		g[cnt+2][0]=g[cnt][1];
		g[cnt+2][1]=g[cnt][1]+1;
		g[cnt+2][2]=1;
		cost*=2;
		cost+=1;
	}
	else{
		gl(cost,n-1,g);
		int cnt = 0;
		for(int i=0;g[i][0]!=-1;i++){
			cnt=i;
		}
		g[cnt+1][0]=g[cnt][1];
		g[cnt+1][1]=g[cnt][1]+1;
		g[cnt+1][2]=0;
		g[cnt+2][0]=1;
		g[cnt+2][1]=g[cnt][1]+1;
		g[cnt+2][2]=cost+1;
		cost+=1;
	}
	return 0;
}

int main(){
	int l;
	vector <vector<int>> g;
	g=vector<vector<int>>(1000,vector<int>(3,-1));
	cin >> l;
	int cost;
	gl(cost,l,g);
	int cnt = 0;
	for(int i=0;g[i][0]!=-1;i++){
		cnt=i;
	}
	cout << g[cnt][1] << " " << cnt+1 << endl;
	for(int i=0;g[i][0]!=-1;i++){
		cout << g[i][0] << " " << g[i][1] << " " << g[i][2] << endl;
	}
	return 0;
}

Compiler output:
a.cc:6:49: error: cannot bind non-const lvalue reference of type 'std::vector<std::vector<int> >&' to an rvalue of type 'std::vector<std::vector<int> >'
    6 | int gl(int &cost,int n, vector <vector<int>> &g=vector<vector<int>>(1000,vector<int>(3,-1))){
      |                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~