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

// acdart
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cctype>
#include <string>
#include <queue>
#include <vector>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <cstdlib>
#include <list>
#include <limits.h>
#include <utility>
#include <functional>
#include <deque>
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define X first
#define Y second
#define F first
#define S second
#define MOD9 1000000009ll
#define MOD7 1000000007ll
#define MOD
#define INF  1023456789ll
#define INF16 10000000000000000ll
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define SZ(x) ((int)(x).size())
#define MAXN 10010
#define MAXM
#define ALL(x) ((x).begin()),((x).end())
#define RESET(a,b) memset(a,b, sizeof a)
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define LEN(X) strlen(X)
#define FI(a,b,c) for(int a=b; a<c; a++)
#define FD(a,b,c) for(int a=b; a>c; a--)
using namespace std;
typedef long long ll;
typedef long long LL;
typedef double db;
typedef double D;
typedef long double ld;
typedef long double LD;
/*********default*********/
#define maxn 100010
#define maxm 200010
#define inf 0x3f3f3f3f
struct Edge {
    int to, next, val;
} edge[maxm];
int tot, n;
int head[maxn];
int vis[maxn];
int cnt[maxn];
int d[maxn][maxn];
int col[maxn];
void init() {
    tot = 0;
    memset(head, -1, sizeof head);
}
void add(int u, int v) {
    edge[tot].to = v;
    edge[tot].val = 1;
    edge[tot].next = head[u];
    head[u] = tot++;
}
bool spfa(int s) {
    queue<int> q;
    memset(d[s], 0x3f, sizeof d[s]);
    memset(vis, 0, sizeof vis);
    memset(cnt, 0, sizeof cnt);
    q.push(s);
    d[s][s] = 0;
    cnt[s] = vis[s] = 1;
    while (!q.empty()) {
        int u = q.front();
        q.pop();
        vis[u] = 0;
        for (int i = head[u]; i != -1; i = edge[i].next) {
            int v = edge[i].to;
            int w = edge[i].val;
            if (d[s][u] + w < d[s][v]) {
                d[s][v] = d[s][u] + w;
                if (!vis[v]) {
                    vis[v] = 1;
                    if (++cnt[v] > n) {
                        return false;
                    }
                    q.push(v);
                }
            }
        }
    }
    return true;
}
int main()
{
	int x, y, z, q, m;
	
	init();
	scanf("%d%d", &n, &m);
	for (int i = 0; i < m; i++) {
		scanf("%d%d", &x, &y);
		add(x, y);
		add(y, x);
	}
	scanf("%d", &q);
	for (int i = 1; i <= n; i++) {
		spfa(i);
	}
	while (q--) {
		scanf("%d%d%d", &x, &y, &z);
		for (int i = 1; i <= n; i++) {
			if (d[x][i] <= y) {
				col[i] = z;
			}
		}
	}
	for (int i = 1; i <= n; i++) {
		printf("%d\n", col[i]);
	}
}

Compiler output:
/tmp/ccRmaETt.o: in function `main':
a.cc:(.text+0x5a7): relocation truncated to fit: R_X86_64_PC32 against symbol `col' defined in .bss section in /tmp/ccRmaETt.o
a.cc:(.text+0x5ec): relocation truncated to fit: R_X86_64_PC32 against symbol `col' defined in .bss section in /tmp/ccRmaETt.o
collect2: error: ld returned 1 exit status
Language: C

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
using namespace std;

#define ll long long
#define INF (1 << 30)
#define INFLL (1LL << 60)

#define FOR(i,a,b) for(int i = (a);i<(b);i++)
#define REP(i,a) FOR(i,0,(a))
#define MP make_pair

#define MAX_N 100001

int n, m;
int ab[MAX_N][MAX_N];
int color[MAX_N];

void ika(int v, int d, int c);

int main() {
    cin >> n >> m;
    REP(i, m) {
        int a, b;
        cin >> a >> b;
        ab[a-1][b-1] = 1;
        ab[b-1][a-1] = 1;
    }

//    REP(i, n) {
//        REP(j, n) {
//            cout << ab[i][j] << ' ';
//        }
//        cout << endl;
//    }

    int q;
    cin >> q;
    REP(i, q) {
        int v, d, c;
        cin >> v >> d >> c;

        ika(v, d, c);
    }

    REP(i, n) {
        cout << color[i] << endl;
    }

    return 0;
}

void ika(int v, int d, int c) {
    color[v-1] = c;

    if (d == 0) {
        return;
    }

    REP(i, n) {
        if (ab[v-1][i] == 1) {
            ika(i+1, d-1, c);
        }
        if (ab[i][v-1] == 1) {
            ika(i+1, d-1, c);
        }
    }
}

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

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class A{

	static final Scanner	s	=new Scanner(System.in);

	static int				n, m, q;
	static boolean			checked[];
	static Node				nodes[];

	public static void main(String args[]){
		n=s.nextInt();
		m=s.nextInt();
		if(n>2000||m>2000||q>2000)// judge reject
			return;

		checked=new boolean[n];

		nodes=new Node[n];
		for(int i=0; i<n; i++)
			nodes[i]=new Node(i);
		int bufa, bufb;
		for(int i=0; i<m; i++){
			bufa=s.nextInt()-1;
			bufb=s.nextInt()-1;
			nodes[bufa].edge.add(nodes[bufb]);
			nodes[bufb].edge.add(nodes[bufa]);
		}

		q=s.nextInt();

		int v,d,c;
		for(int i=0;i<q;i++) {
			v=s.nextInt()-1;
			d=s.nextInt();
			c=s.nextInt();

			Arrays.fill(checked,false);
			checked[v]=true;
			function(nodes[v],0,d,c);
		}
		Arrays.stream(nodes).forEach(n->System.out.println(n.color));
	}

	static Node buf;
	static void function(Node n,int curDepth,int maxDepth,int color) {
		n.color=color;
		if(curDepth==maxDepth)
			return;
		for(int i=0;i<n.edge.size();i++) {
			buf=n.edge.get(i);
			if(!checked[buf.no]) {
				checked[buf.no]=true;
				function(buf,curDepth+1,maxDepth,color);
			}
		}
	}
}

class Node{

	int				no, color=0;
	ArrayList<Node>	edge=new ArrayList<>();

	Node(int no){
		this.no=no;
	}
}


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

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
using namespace std;

#define ll long long
#define INF (1 << 30)
#define INFLL (1LL << 60)

#define FOR(i,a,b) for(int i = (a);i<(b);i++)
#define REP(i,a) FOR(i,0,(a))
#define MP make_pair

#define MAX_N 100001

int n, m;
int ab[MAX_N][MAX_N];
int color[MAX_N];

void ika(int v, int d, int c) {
    color[v-1] = c;

    if (d == 0) {
        return;
    }

    REP(i, n) {
        if (ab[v-1][i] == 1) {
            ika(i+1, d-1, c);
        }
        if (ab[i][v-1] == 1) {
            ika(i+1, d-1, c);
        }
    }
}

int main() {
    cin >> n >> m;
    REP(i, m) {
        int a, b;
        cin >> a >> b;
        ab[a-1][b-1] = 1;
        ab[b-1][a-1] = 1;
    }

//    REP(i, n) {
//        REP(j, n) {
//            cout << ab[i][j] << ' ';
//        }
//        cout << endl;
//    }

    int q;
    cin >> q;
    REP(i, q) {
        int v, d, c;
        cin >> v >> d >> c;

        ika(v, d, c);
    }

    REP(i, n) {
        cout << color[i] << endl;
    }

    return 0;
}

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

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
using namespace std;

#define ll long long
#define INF (1 << 30)
#define INFLL (1LL << 60)

#define FOR(i,a,b) for(int i = (a);i<(b);i++)
#define REP(i,a) FOR(i,0,(a))
#define MP make_pair

#define MAX_N 100001

int n, m;
int ab[MAX_N][MAX_N];
int color[MAX_N];

void ika(int v, int d, int c) {
    color[v-1] = c;

    if (d == 0) {
        return;
    }

    REP(i, n) {
        if (ab[v-1][i] == 1) {
            ika(i+1, d-1, c);
        }
        if (ab[i][v-1] == 1) {
            ika(i+1, d-1, c);
        }
    }
}

int main() {
    cin >> n >> m;
    REP(i, m) {
        int a, b;
        cin >> a >> b;
        ab[a-1][b-1] = 1;
        ab[b-1][a-1] = 1;
    }

//    REP(i, n) {
//        REP(j, n) {
//            cout << ab[i][j] << ' ';
//        }
//        cout << endl;
//    }

    int q;
    cin >> q;
    REP(i, q) {
        int v, d, c;
        cin >> v >> d >> c;

        ika(v, d, c);
    }

    REP(i, n) {
        cout << color[i] << endl;
    }

    return 0;
}

Compiler output:
/tmp/cc2eUc2J.o: in function `ika(int, int, int)':
a.cc:(.text+0x24): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc2eUc2J.o
/tmp/cc2eUc2J.o: in function `main':
a.cc:(.text+0x259): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc2eUc2J.o
collect2: error: ld returned 1 exit status
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
using namespace std;

#define ll long long
#define INF (1 << 30)
#define INFLL (1LL << 60)

#define FOR(i,a,b) for(ll i = (a);i<(b);i++)
#define REP(i,a) FOR(i,0,(a))
#define MP make_pair

#define MAX_N 100001

int n, m;
int ab[MAX_N][MAX_N];
int color[MAX_N];

void ika(int v, int d, int c) {
    color[v-1] = c;

    if (d == 0) {
        return;
    }

    REP(i, n) {
        if (ab[v-1][i] == 1) {
            ika(i+1, d-1, c);
        }
        if (ab[i][v-1] == 1) {
            ika(i+1, d-1, c);
        }
    }
}

int main() {
    cin >> n >> m;
    REP(i, m) {
        int a, b;
        cin >> a >> b;
        ab[a-1][b-1] = 1;
        ab[b-1][a-1] = 1;
    }

//    REP(i, n) {
//        REP(j, n) {
//            cout << ab[i][j] << ' ';
//        }
//        cout << endl;
//    }

    int q;
    cin >> q;
    REP(i, q) {
        int v, d, c;
        cin >> v >> d >> c;

        ika(v, d, c);
    }

    REP(i, n) {
        cout << color[i] << endl;
    }

    return 0;
}

Compiler output:
/tmp/ccXzUMl0.o: in function `ika(int, int, int)':
a.cc:(.text+0x24): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccXzUMl0.o
/tmp/ccXzUMl0.o: in function `main':
a.cc:(.text+0x26a): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccXzUMl0.o
collect2: error: ld returned 1 exit status
Language: C++

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

#define rep(n) for(int i=0;i<n;i++)
#define repp(j, n) for(int j=0;j<n;j++)
#define reppp(i, m, n) for(int i=m;i<=n;i++)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define MOD 1000000007
#define MAX 1000000001
#define INF 1410065408
#define EPS 1e-9
 
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
struct edge{int from, to; ll cost;};

vector<ll> es[1000000];
vector<ll> color(1000000, 0);

void dfs(ll v, ll d, ll c, ll depth, vector<bool> use){
	color[v] = c;
	use[v] = true;
	if(d == depth) return;
	for(ll to : es[v]){
		if(!use[to]) dfs(to, d, c, depth+1);
	}
}

signed main(){
	ll N, M, Q;
	cin >> N >> M;
	rep(M){
		ll tmp1, tmp2;
		cin >> tmp1 >> tmp2;
		es[tmp1].push_back(tmp2);
		es[tmp2].push_back(tmp1);
	}
	cin >> Q;
	rep(Q){
		ll v, d, c;
		cin >> v >> d >> c;
		dfs(v, d, c, 0, vector<bool>(N+1, false));
	}
	rep(N){
		cout << color[i+1] << endl;
	}
}


Compiler output:
a.cc: In function 'void dfs(ll, ll, ll, ll, std::vector<bool>)':
a.cc:36:33: error: too few arguments to function 'void dfs(ll, ll, ll, ll, std::vector<bool>)'
   36 |                 if(!use[to]) dfs(to, d, c, depth+1);
      |                              ~~~^~~~~~~~~~~~~~~~~~~
a.cc:31:6: note: declared here
   31 | void dfs(ll v, ll d, ll c, ll depth, vector<bool> use){
      |      ^~~
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<cstdlib>
#include<cmath>
#include<cstring>
using namespace std;
#define maxn 1001000
#define llg int 
#define yyj(a) freopen(a".in","r",stdin),freopen(a".out","w",stdout);
llg n,m,c[maxn],Q;
vector<llg>a[maxn];

struct node
{
	llg po,dis,col;
}ask[maxn];

inline int getint()
{
       int w=0,q=0; char c=getchar();
       while((c<'0' || c>'9') && c!='-') c=getchar(); if(c=='-') q=1,c=getchar(); 
       while (c>='0' && c<='9') w=w*10+c-'0', c=getchar(); return q ? -w : w;
}


void init()
{
	cin>>n>>m;
	for (llg i=1;i<=m;i++)
	{
		llg x=getint(),y=getint();
		a[x].push_back(y),a[y].push_back(x);
	}
	cin>>Q;
	for (llg i=1;i<=Q;i++) ask[i].po=getint(),ask[i].dis=getint(),ask[i].col=getint();
}

void dfs(llg x,llg dis,llg col)
{
//	if (c[x]) return ;
	c[x]=col;
	if (dis==0) return ;
	llg w=a[x].size();
	for (llg i=0;i<w;i++)
	{
		llg v=a[x][i];
		dfs(v,dis-1,col);
	}
}

int main()
{
//	yyj("B");
	init();
	for (llg i=1;i<=Q;i++) dfs(ask[i].po,ask[i].dis,ask[i].col);
	for (llg i=1;i<=n;i++) printf("%d\n",c[i]);y
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:52: error: 'y' was not declared in this scope; did you mean 'yn'?
   58 |         for (llg i=1;i<=n;i++) printf("%d\n",c[i]);y
      |                                                    ^
      |                                                    yn
Language: C++

#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<functional>
#include<algorithm>
#include<queue>
using namespace std;

int ans[100000];
vector<int>rinsetu[100000];
int mincost[100000];
signed main() {
	int a, b;
	cin >> a >> b;
	if (a > 2000 || b > 2000)return 0;
	for (int c = 0; c < b; c++) {
		int d, e; scanf("%d%d", &d, &e); d--; e--;
		rinsetu[d].push_back(e);
		rinsetu[e].push_back(d);
	}
	int c; cin >> c;
	if (c > 2000)return 0;
	for (int d = 0; d < c; d++) {
		int e, f, g; scanf("%d%d%d", &e, &f, &g);
		e--;
		memset(mincost, -1, sizeof(mincost));
		mincost[e] = 0;
		queue<int>Q;
		Q.push(e);
		while (Q.size()) {
			int i = Q.front(); Q.pop();
			if (mincost[i] <= f)ans[i] = g;
			for (int j : rinsetu[i]) {
				if (mincost[j] == -1) {
					mincost[j] = mincost[i] + 1;
					Q.push(j);
				}
			}
		}
	}
	for (int i = 0; i < a; i++) {
		printf("%d\n", ans[i]);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:17: error: 'memset' was not declared in this scope
   27 |                 memset(mincost, -1, sizeof(mincost));
      |                 ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include<queue>
  +++ |+#include <cstring>
    8 | using namespace std;
Language: C++

#include<stdio.h>
#include<vector>
using namespace std;
#define ran 111111
int n,q;
vector<int> e[ran];
int vert[ran],query_dis[ran],query_col[ran];
int col[ran];
int dis[ran];

int que[ran],op,cl;
int inq[ran],T;

int main(){
	int m;
	scanf("%d%d",&n,&m);
	while(m--){
		int x,y;
		scanf("%d%d",&x,&y);
		e[x].push_back(y);
		e[y].push_back(x);
	}
	scanf("%d",&q);
	for(int i=0; i<q; i++)
		scanf("%d%d%d",&vert[i],&query_dis[i],&query_col[i]);
	memset(dis,-1,sizeof(dis));
	while(q--){
		int V = vert[q], D = query_dis[q], C = query_col[q];

		if(dis[V] >= D)continue;

		++T;
		op=cl=0;
		que[op++] = V;
		if(dis[V] == -1)
			col[V] = C;
		dis[V] = D;
		inq[V] = T;

		while(cl<op){
			V = que[cl++];
			D = dis[V];
			if(D == 0)continue;
			--D;
			for(vector<int>::iterator it = e[V].begin(); it!=e[V].end(); it++){
				int y = *it;
				if(inq[y] == T)continue;
				if(dis[y] >= D)continue;
				if(dis[y] == -1)
					col[y] = C;
				dis[y] = D;
				inq[y] = T;
				que[op++] = y;
			}
		}
	}
	for(int i=1; i<=n; i++)
		printf("%d\n",col[i]);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:9: error: 'memset' was not declared in this scope
   26 |         memset(dis,-1,sizeof(dis));
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<vector>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include <cstdio>
#include <vector> 
int main() {
	long long n;
	scanf("%lld", &n);
	int all = 100;
	
	std::vector <int> p, q;
	while(n > 1) {
		if(n & 1) {
			p.push_back(all--);
			n--;
		}
		else {
			q.push_back(all--);
			n >>= 1;
		}
	}
	
	int sz = p.size() + q.size();
	printf("%d\n", sz + 100);
	for(int x: p)
		printf("%d ", x);
	std::reverse(q.begin(), q.end());
	for(int x: q)
		printf("%d ", x);
	for(int i = 1; i <= 100; i++)
		printf("%d ", i);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:14: error: 'reverse' is not a member of 'std'
   24 |         std::reverse(q.begin(), q.end());
      |              ^~~~~~~
Language: C++

#include <cstdio>
#include <vector> 
int main() {
	long long n;
	scanf("%lld", &n);
	int all = 100;
	
	std::vector <int> p, q;
	while(n > 1) {
		if(n & 1) {
			p.push_back(all--);
			n--;
		}
		else {
			q.push_back(all--);
			n >>= 1;
		}
	}
	
	int sz = p.size() + q.size();
	printf("%d\n", sz + 100);
	for(int x: p)
		printf("%d ", x);
	reverse(q.begin(), q.end());
	for(int x: q)
		printf("%d ", x);
	for(int i = 1; i <= 100; i++)
		printf("%d ", i);
	return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
 
int p[202], q[202], cnt;
long long n;
     
void solve(long long n){
	if (!n) return;
   	if (~n & 1) 
		q[++q[0]] = cnt++, solve(n - 1);
   	else
   		p[++p[0]] = cnt++, solve(n >> 1);
}
    
int main(){
  	scanf("%lld", &n), solve(v), printf("%d\n", cnt + 100);
  	for (int i = 1; i <= q[0]; ++i) printf("%d ", cnt - q[i]);
  	for (int i = p[0]; i; --i) printf("%d ", cnt - p[i]);
   	for (int i = 1; i <= 100; ++i) printf("%d ", i);
 	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:34: error: 'v' was not declared in this scope
   16 |         scanf("%lld", &n), solve(v), printf("%d\n", cnt + 100);
      |                                  ^
Language: C++

#include <cmath>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <list>
#include <time.h>
#include <math.h>
#include <random>
#include <deque>
#include <queue>
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>
#include <sstream>
#include <chrono>
#include <cstring>

using namespace std;

typedef long long ll;

#ifdef iq
  mt19937 rnd(228);
#else
  mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif

int main() {
#ifdef iq
  freopen("a.in", "r", stdin);
#endif
  ios::sync_with_stdio(0);
  cin.tie(0);
  ll k;
  cin >> k;
  k++;
  function<vector<int>(ll)> solve = [&] (ll k) {
    if (k == 1) {
      return vector<int>{};
    } else if (k % 2 == 0) {
      auto a = solve(k / 2);
      int ids = a.size();
      a.push_back(ids);
      return a;
    } else {
      auto a = solve(k - 1);
      int ids = a.size();
      a.insert(a.begin(), ids);
      return a;
    }
  };
  auto ok = solve(k);
  cout << 2 * ok.size() << '\n';
  for (int i = 0; i < (int) ok.size(); i++) cout << i + 1 << ' ';
  for (int x : ok) cout << x + 1 << ' ';
  cout << '\n';
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:3: error: 'function' was not declared in this scope
   42 |   function<vector<int>(ll)> solve = [&] (ll k) {
      |   ^~~~~~~~
a.cc:22:1: note: 'std::function' is defined in header '<functional>'; this is probably fixable by adding '#include <functional>'
   21 | #include <cstring>
  +++ |+#include <functional>
   22 | 
a.cc:42:23: error: expected primary-expression before '(' token
   42 |   function<vector<int>(ll)> solve = [&] (ll k) {
      |                       ^
a.cc:42:26: error: expected primary-expression before ')' token
   42 |   function<vector<int>(ll)> solve = [&] (ll k) {
      |                          ^
a.cc:42:29: error: 'solve' was not declared in this scope
   42 |   function<vector<int>(ll)> solve = [&] (ll k) {
      |                             ^~~~~
Language: C++

#include<iostream>

using namespace std;

long long N,M;
int i,j;
long long a[105];
long long b[105];

void solver(long long n){
	if(n==1){
		I ++;
		b[I] = M--;
		return ;
	}
	if(n&1) {
		i++;
		b[i]=M--;
		solver(n>>=1);
		
	}
	else{
		j++;
		a[j]=M--;
		solver(n-1);
	}
}

int main()
{
	long long N;
	cin>>N;
	M=100;
	solver(N);
	cout<<2*(i+j)<<endl;
	for(int m=1;m<=j;m++){
		cout<<a[m]<<" ";
	}
	for(int m=i;m>=1;m--){
		cout<<b[m]<<" ";
	}
	
	for(int m=101-i-j;m<=100;m++){
		cout<<m<<" ";
	}
	return 0;
}


Compiler output:
a.cc: In function 'void solver(long long int)':
a.cc:12:17: error: 'I' was not declared in this scope
   12 |                 I ++;
      |                 ^
Language: C++

#include <iostream>
#include<stdio.h>
using namespace std;
int a[102];
int b[102];
int main()
{
	long long n;
	int p1 = 0, p2 = 0, m = 100;
	scanf_s("%lld", &n);
	n++;
	while (n > 1)
	{
		if (n & 1)
		{
			a[++p1] = m--;
			n--;
		}
		else
		{
			b[++p2] = m--;
			n >>= 1;
		}
	}
	printf("%d\n", p1 + p2 << 1);
	for (int i = 1; i <= p1; i++)
		printf("%d ", a[i]);
	for (int i = p2; i >= 1; i--)
		printf("%d ", b[i]);
	for (int i = 101 - p1 - p2; i <= 100; ++i)
		printf("%d ", i);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   10 |         scanf_s("%lld", &n);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <stdio.h>
#include <iostream> 
using namespace std;
const int maxn=105;
int odd[maxn],even[maxn]；
long long n;
int main(){
    int i,num=1;
    scanf("%lld",&n);n++;
    while(n>1){
        if(n&1)odd[++odd[0]]=num++,n--;
        else even[++even[0]]=num++,n/=2;
    }
    printf("%d\n",odd[0]+even[0]<<1);
    for(i=1;i<=odd[0];i++)printf("%d ",odd[i]);
    for(i=even[0];i>=1;i--)printf("%d ",even[i]);
    for(i=odd[0]+even[0];i>=1;i--)printf("%d ",i);
    return 0;
}

Compiler output:
a.cc:5:25: error: expected initializer before '\U0000ff1b'
    5 | int odd[maxn],even[maxn]；
      |                         ^~
a.cc: In function 'int main()':
a.cc:9:19: error: 'n' was not declared in this scope
    9 |     scanf("%lld",&n);n++;
      |                   ^
a.cc:12:14: error: 'even' was not declared in this scope
   12 |         else even[++even[0]]=num++,n/=2;
      |              ^~~~
a.cc:14:26: error: 'even' was not declared in this scope
   14 |     printf("%d\n",odd[0]+even[0]<<1);
      |                          ^~~~
Language: C++

#include <bits/stdc++.h>


using namespace std;





int main() {
  tread x;
  return 0;
}

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

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



void read(int &x) {
    x=0;int f=1;char ch=getchar();
    for(;!isdigit(ch);ch=getchar()) if(ch=='-') f=-f;
    for(;isdigit(ch);ch=getchar()) x=x*10+ch-'0';x*=f;
}

void print(int x) {
    if(x<0) putchar('-'),x=-x;
    if(!x) return ;print(x/10),putchar(x%10+48);
}
void write(int x) {if(!x) putchar('0');else print(x);putchar('\n');}

#define lf double
#define ll long long 
#define pb push_back

const long long maxn = 1e5+10;
const long long inf = 1e9;
const lf eps = 1e-8;
long long n;

vector<int > s,t;

signed main() {
    read(n);long long p=101;n++;
    while(n>1) {if(n&1) t.pb(--p),n--;else s.pb(--p),n>>=1;}
    int m=s.size()+t.size();printf("%lld\n",m<<1);
    for(int i=0;i<(int)t.size();i++) printf("%lld ",t[i]);
    for(int i=s.size()-1;~i;i--) printf("%lld ",s[i]);
    for(int i=100-m+1;i<=100;i++) printf("%lld ",i);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:10: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'long long int'
   30 |     read(n);long long p=101;n++;
      |          ^
a.cc:6:16: note:   initializing argument 1 of 'void read(int&)'
    6 | void read(int &x) {
      |           ~~~~~^
Language: C++

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



void read(int &x) {
    x=0;int f=1;char ch=getchar();
    for(;!isdigit(ch);ch=getchar()) if(ch=='-') f=-f;
    for(;isdigit(ch);ch=getchar()) x=x*10+ch-'0';x*=f;
}

void print(int x) {
    if(x<0) putchar('-'),x=-x;
    if(!x) return ;print(x/10),putchar(x%10+48);
}
void write(int x) {if(!x) putchar('0');else print(x);putchar('\n');}

#define lf double
#define ll long long 
#define pb push_back

const int maxn = 1e5+10;
const int inf = 1e9;
const lf eps = 1e-8;
long long n;

vector<int > s,t;

signed main() {
    read(n);long long p=101;n++;
    while(n>1) {if(n&1) t.pb(--p),n--;else s.pb(--p),n>>=1;}
    int m=s.size()+t.size();printf("%lld\n",m<<1);
    for(int i=0;i<(int)t.size();i++) printf("%lld ",t[i]);
    for(int i=s.size()-1;~i;i--) printf("%lld ",s[i]);
    for(int i=100-m+1;i<=100;i++) printf("%lld ",i);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:10: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'long long int'
   30 |     read(n);long long p=101;n++;
      |          ^
a.cc:6:16: note:   initializing argument 1 of 'void read(int&)'
    6 | void read(int &x) {
      |           ~~~~~^
Language: C++

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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;
string ans;
ll N;
ll moji[205];
void f(int in) {
    cout << in << endl;
    //char out = (char)('0' + in);
    string now;
    for(int i = 1; i <= 200; i++) {
        if(moji[i] > N) {
            N -= moji[i - 1];
            break;
        }
        ans.push_back(out);
    }
    //return now;
    return;
}

int main() {
    //cout.precision(10);
    cin >> N;
    moji[0] = 0;
    moji[1] = 1;
    for(int i = 2; i <= 50; i++) {
        moji[i] = moji[i - 1] * 2;
    }
    for(int i = 1; i <= 50; i++) {
        moji[i]--;
    }
    for(int i = 1; i <= 10000; i++) {
        if(N == 0) break;
        //ans = ans + f(i % 100 + 1);
        f(i % 90 + 1);
    }
    //cout << ans << endl;
    cout << ans.size() << endl;
    for(int i = 0; i < ans.size(); i++) {
        cout << ans[i];
        if(i + 1 < ans.size()) cout << " ";
    }
    cout << endl;
    return 0;
}


Compiler output:
a.cc: In function 'void f(int)':
a.cc:21:23: error: 'out' was not declared in this scope
   21 |         ans.push_back(out);
      |                       ^~~
Language: C++

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

inline char get(void) {
	static char buf[100000], *S = buf, *T = buf;
	if (S == T) {
		T = (S = buf) + fread(buf, 1, 100000, stdin);
		if(S == T) return EOF;
	}
	return *S++;
}
template<typename T>
inline void read(T &x) {
	static char c; x = 0; int sgn = 0;
	for (c = get(); c < '0' || c > '9'; c = get()) if (c == '-') sgn = 1;
	for (; c >= '0' && c <= '9'; c = get()) x = x * 10 + c - '0';
	if (sgn) x = -x;
}

const int N = 101010;

int a[N << 2];
int n;
long long sum;

int main(void) {
	read(n);
	for (int i = 0; i < n * 3; i++) {
		read(a[i]); a[i] = -a[i];
	}
	sort(a, a + n * 3);
	for (int i = 0; i < n; i++) sum -= a[i << 1 | 1];
	print(%d,sum);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:15: error: expected primary-expression before '%' token
   35 |         print(%d,sum);
      |               ^
a.cc:35:16: error: 'd' was not declared in this scope
   35 |         print(%d,sum);
      |                ^
a.cc:35:9: error: 'print' was not declared in this scope; did you mean 'printf'?
   35 |         print(%d,sum);
      |         ^~~~~
      |         printf
Language: C++

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

inline char get(void) {
	static char buf[100000], *S = buf, *T = buf;
	if (S == T) {
		T = (S = buf) + fread(buf, 1, 100000, stdin);
		if(S == T) return EOF;
	}
	return *S++;
}
template<typename T>
inline void read(T &x) {
	static char c; x = 0; int sgn = 0;
	for (c = get(); c < '0' || c > '9'; c = get()) if (c == '-') sgn = 1;
	for (; c >= '0' && c <= '9'; c = get()) x = x * 10 + c - '0';
	if (sgn) x = -x;
}

const int N = 101010;

int a[N << 2];
int n;
long long sum;

int main(void) {
	read(n);
	for (int i = 0; i < n * 3; i++) {
		read(a[i]); a[i] = -a[i];
	}
	sort(a, a + n * 3);
	for (int i = 0; i < n; i++) sum -= a[i << 1 | 1];
	print(%d,&sum);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:15: error: expected primary-expression before '%' token
   35 |         print(%d,&sum);
      |               ^
a.cc:35:16: error: 'd' was not declared in this scope
   35 |         print(%d,&sum);
      |                ^
a.cc:35:9: error: 'print' was not declared in this scope; did you mean 'printf'?
   35 |         print(%d,&sum);
      |         ^~~~~
      |         printf
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using P=pair<ll,ll>;
#define MOD 1000000007ll
#define INF 1000000000ll
#define EPS 1e-10
#define FOR(i,n,m) for(ll i=n;i<(ll)m;i++)
#define REP(i,n) FOR(i,0,n)
#define DUMP(a) REP(d,a.size()){cout<<a[d];if(d!=a.size()-1)cout<<" ";else cout<<endl;}
#define ALL(v) v.begin(),v.end()
#define UNIQUE(v) sort(ALL(v));v.erase(unique(ALL(v)),v.end());
#define pb push_back

ll cnt(string c) {
	ll ret=0;
	REP(i,(1<<(ll)c.size())) {
		bitset<64> bi(i);
		if(bi.count()%2) continue;
		string tmp;
		REP(j,c.size()) {
			if(bi[j]) tmp+=c[j];
		}
		if(tmp.substr(0,tmp.size()/2)==tmp.substr(tmp.size()/2,tmp.size()/2)) {
			if(tmp.size()!=0) ret++;
		}
	}
	return ret;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll n;
	cin>>n;
	vector<ll> v;
	ll _n=n;
	while(_n>0) {
		v.pb(_n);
		_n=(_n-1)/2;
	}
	reverse(ALL(v));
	string a="";
	string b="";
	ll tmp=0;
	if(v[0]==1) {
		a="1";
		b="1";
		tmp=2;
	} else {
		a="21";
		b="21";
		tmp=3;
	}
	FOR(j,1,v.size()) {
		if(v[j]==v[j-1]*2+1) {
			a+=to_string(tmp-1);
		} else {
			a+=to_string(tmp);
			b+=to_string(tmp);
			tmp++;
		}
		//cout<<a+b<<":"<<cnt(a+b)<<endl;
	}
	cout<<a.size()+b.size()<<endl;Y
	REP(i,a.size()) {
		cout<<a[i]<<" ";
	}
	REP(i,b.size()) {
		cout<<b[i];
		if(i==(ll)b.size()-1) cout<<endl;
		else cout<<" ";
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:66:39: error: 'Y' was not declared in this scope
   66 |         cout<<a.size()+b.size()<<endl;Y
      |                                       ^
a.cc:67:13: error: 'i' was not declared in this scope
   67 |         REP(i,a.size()) {
      |             ^
a.cc:9:31: note: in definition of macro 'FOR'
    9 | #define FOR(i,n,m) for(ll i=n;i<(ll)m;i++)
      |                               ^
a.cc:67:9: note: in expansion of macro 'REP'
   67 |         REP(i,a.size()) {
      |         ^~~
Language: C++

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

typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define ALL(c) (c).begin(),(c).end()

int main() {
	ll N;
	cin >> N;
	++N;

	vi ans;
	for (int i = 1; i <= 100; ++i) {
		ans.pb(i);
	}

	vi nums, vec;

	int mn = -1, mx = -1;

	while (N) {
		if (N & 1) {
			vec.pb(1);
			--N;
		}

		if (N == 2) {
			mn = mx = 0;
			nums.pb(0);
			break;
		}

		vec.pb(0);
		N /= 2;
	}

	reverse(ALL(vec));

	for (int f : vec) {
		if (mn == -1 && mx == -1) {
			mn = mx = 0;
			nums.pb(0);
			continue;
		}

		if (f == 0) {
			nums.pb(mx + 1);
			++mx;
		} else {
			nums.pb(mn - 1);
			--mn;
		}
	}

	if (p) {
		nums.pb(mn - 1);
		--mn;
	}

	for (int x : nums) {
		ans.pb(x - mn + 1);
	}

	cout << ans.size() << endl;
	rep(i, ans.size()) cout << ans[i] << (i + 1 == ans.size() ? '\n' : ' ');

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:13: error: 'p' was not declared in this scope
   65 |         if (p) {
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define sqr(x) ((x)*(x))
#define mp make_pair
#define uint unsigned
#define PI pair<int,int>
inline char gc(){
    static char buf[100000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
inline int read(){
	int x = 0; char ch = gc(); bool positive = 1;
	for (; !isdigit(ch); ch = gc())	if (ch == '-')	positive = 0;
	for (; isdigit(ch); ch = gc())	x = x * 10 + ch - '0';
	return positive ? x : -x;
}
inline void write(int a){
    if(a<0){
    	a=-a; putchar('-');
	}
    if(a>=10)write(a/10);
    putchar('0'+a%10);
}
inline void writeln(int a){
    if(a<0){
    	a=-a; putchar('-');
	}
	write(a); puts("");
}
inline int rnd(int x){
	return (rand()<<16|rand())%x;
}
ll n;
deque<int> ans;
void solve(ll n,int id){
	if(n==1)return; 
	if(n&1){
		solve(n-1,id+1); fro.push_front(id); bac.push_back(id);
	}else{
		solve(n>>1,id+1); fro.push_back(id);  bac.push_back(id);
	}
}

int main(){
	cin>>n; n++;
	solve(n,1);
	cout<<fro.size()*2<<endl;
	while(fro.size()){
		cout<<fro.front()<<" "; fro.pop_front();
	}
	while(bac.size()){
		cout<<bac.front()<<" "; bac.pop_front();
	}
}

Compiler output:
a.cc: In function 'void solve(ll, int)':
a.cc:40:34: error: 'fro' was not declared in this scope
   40 |                 solve(n-1,id+1); fro.push_front(id); bac.push_back(id);
      |                                  ^~~
a.cc:40:54: error: 'bac' was not declared in this scope
   40 |                 solve(n-1,id+1); fro.push_front(id); bac.push_back(id);
      |                                                      ^~~
a.cc:42:35: error: 'fro' was not declared in this scope
   42 |                 solve(n>>1,id+1); fro.push_back(id);  bac.push_back(id);
      |                                   ^~~
a.cc:42:55: error: 'bac' was not declared in this scope
   42 |                 solve(n>>1,id+1); fro.push_back(id);  bac.push_back(id);
      |                                                       ^~~
a.cc: In function 'int main()':
a.cc:49:15: error: 'fro' was not declared in this scope
   49 |         cout<<fro.size()*2<<endl;
      |               ^~~
a.cc:53:15: error: 'bac' was not declared in this scope
   53 |         while(bac.size()){
      |               ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <climits>
#include <deque>
using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    long long N;
    cin >> N;
    N++;
    int A, B;
    vector<int> ops;
    while(N != 1){
        if(N % 2 == 1){
            ops.push_back(0);
            N--;


Compiler output:
a.cc: In function 'int main()':
a.cc:23:17: error: expected '}' at end of input
   23 |             N--;
      |                 ^
a.cc:21:23: note: to match this '{'
   21 |         if(N % 2 == 1){
      |                       ^
a.cc:23:17: error: expected '}' at end of input
   23 |             N--;
      |                 ^
a.cc:20:18: note: to match this '{'
   20 |     while(N != 1){
      |                  ^
a.cc:23:17: error: expected '}' at end of input
   23 |             N--;
      |                 ^
a.cc:12:11: note: to match this '{'
   12 | int main(){
      |           ^
Language: C++

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

typedef long long ll;

ll N;

int main()
{
    scanf("%lld",&N);
    ll now = 2;
    for(ll i = 63; i >= 2; i--)
    {
        ll num = pow(2,i - 1) - 1;
        while(N >= num)
        {
            for(int j = 0; j < i; j++)
            {
                printf("%d ",now);
            }
            N -= num;
            now++;
        }
    }
    printf("1\n");
    return 0;
}


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

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int main(){
    ll n;
    cin >> n;
    n++;
    VI a;
    while (n){
        a.push_back(n%2);
        n /= 2;
    }
    reverse(ALL(a));
    // int m = a.size();
    // REP(i,m) cout << a[i];
    // cout << endl;
    deque<int> ans;
    int x = 1;
    FOR(i,1,m-1){
        ans.push_back(x++);
        if (a[i]) ans.push_front(x++);
    }

    cout << ans.size() * 2 << endl;
    FOR(i,1,ans.size()) cout << i << " ";
    while (!ans.empty()){
        cout << ans.front() << " ";
        ans.pop_front();
    }
    cout << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:13: error: 'm' was not declared in this scope
   43 |     FOR(i,1,m-1){
      |             ^
a.cc:16:36: note: in definition of macro 'FOR'
   16 | #define FOR(i,a,b) for(int i=a; i<=b; ++i)
      |                                    ^
Language: Java

public class Main{

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long[] c = new long[200];
        int[] result = new int[200];
        int sum = 0;
        int num = 1;
        while(N!=0) {
            long pos = 0x0000000000000001L;
            int posi = 63;
            String s = "";
            while (pos != 0) {
                if ((N & pos) == 0) {
                    s += "0";
                } else {
                    s += "1";
                }
                pos = pos << 1;
            }
            int i = s.lastIndexOf("1") + 1;
            int j = s.lastIndexOf("0", i - 1) + 1;
            int x = j;
            int y = i - j;
            if (x < y) {
                y = i / 2;
                x = i - y;
            }
            for(int a=0;a<x+1;a++){
                for(int b=0;b<y;b++){
                    result[sum]=num+b;
                    sum++;
                }
            }
            num+=y;

            N-=(Math.pow(2,x)-1)*(Math.pow(2,y)-1);
            if(N==1){
                result[sum]=num;
                sum++;
                result[sum]=num;
                sum++;
                break;
            }
        }

        System.out.println(sum);
        for(int i=0;i<sum;i++){
            System.out.print(result[i]+" ");
        }

    }
}

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


public class Main{

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long[] c = new long[200];
        int[] result = new int[200];
        int sum = 0;
        int num = 1;
        while(N!=0) {
            long pos = 0x0000000000000001L;
            int posi = 63;
            String s = "";
            while (pos != 0) {
                if ((N & pos) == 0) {
                    s += "0";
                } else {
                    s += "1";
                }
                pos = pos << 1;
            }
            int i = s.lastIndexOf("1") + 1;
            int j = s.lastIndexOf("0", i - 1) + 1;
            int x = j;
            int y = i - j;
            if (x < y) {
                y = i / 2;
                x = i - y;
            }
            for(int a=0;a<x;a++){
                for(int b=0;b<y;b++){
                    result[sum]=num+b;
                    sum++;
                }
            }
            num+=y;

            N-=(Math.pow(2,x)-1)*(Math.pow(2,y)-1);
            if(N==1){
                break;
            }
        }
        System.out.println(sum);
        for(int i=0;i<sum;i++){
            System.out.print(result[i]+" ");
        }

    }
}

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++

// Template {{{
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(int)(n); ++i)
using namespace std;
typedef long long LL;

#ifdef LOCAL
#include "contest.h"
#else
#define error(args...) 
#endif

const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
inline bool valid(int x, int w) { return 0 <= x && x < w; }

void iostream_init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.setf(ios::fixed);
    cout.precision(12);
}
//}}}

int eval(LL N, int rest=0) {
    if(rest == 0) {
        int res = 0;
        while(N > 0) {
            for(int i = 1; i < 50; i++) {
                LL nx = (1L<<(i+1)) - 1;
                if(N < nx) {
                    LL x = (1L<<i) - 1;
                    res += i;
                    N -= x;
                    break;
                }
            }
        }
        return res;
    } else {
        int res = INT_MAX;
        for(int i = 1; i < 50; i++) {
            LL x = (1L<<i) - 1;
            if(N - x >= 0) {
                res = min(res, eval(N - x, rest-1) + i);
            }
        }
    }
}

vector<int> solve(LL N) {
    vector<int> ans;
    int cnt = 0;
    while(N > 0) {
        vector<pair<int, int>> ps;
        for(int i = 1; i < 50; i++) {
            LL x = (1L<<i) - 1;
            if(N - x >= 0) {
                ps.push_back(make_pair(eval(N - x) + i, i));
            }
        }
        sort(ps.begin(), ps.end());
        assert(ps.size() > 0);
        int idx = ps[0].second;
        REP(i, idx) ans.push_back(cnt);
        cnt++;
        N -= ((1L<<(idx))-1);
    }
    assert(N == 0);
    return ans;
}
int main(){
    LL test = 549755813887LL;
    iostream_init();
    LL N;
    cin >> N;
    auto v = solve(N);
    assert(v.size() <= 200);
    cout << v.size() << endl;
    REP(i, v.size()) {
        cout << v[i];
        if(i+1 == v.size()) {
            cout << endl;
        } else {
            cout << " ":
        }
    }
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:85:24: error: expected ';' before ':' token
   85 |             cout << " ":
      |                        ^
      |                        ;
a.cc: In function 'int eval(LL, int)':
a.cc:49:1: warning: control reaches end of non-void function [-Wreturn-type]
   49 | }
      | ^
Language: C++

def nCr(a,b):
	tmp=1
	for i in range(a,a-b,-1):tmp*=i
	for i in range(1,b+1,1):tmp//=i
	return tmp

n=int(input())
out=[]
co=1
coo=0
while n>0:
	t=2
	while True:
		sum1=0
		for j in range(2,t+1,2):
			sum1+=nCr(t,j)
#		print(n,sum)
		if n<sum1:
			t-=1
#			n-=rco
			break
		rco=sum1
		t+=1
	ad=[co for _ in range(t)]
	sum1=rco
	ma=sum1
#	print(ma)
	for toa in range(1,4):
		for tob in range(1,4):
			CO=0
			for r in range(1,min(toa,tob)+1):
				CO+=nCr(toa,r)*nCr(tob,r)
		
			for a in range(1,t):
				sum2=sum1+((2**(toa+tob-1))-1)
				for b in range(1,a+1):
					sum2+=nCr(a,b)*nCr(t-a,b)*CO
				if sum2>n:continue
				if ma<sum2:
					ma=sum2
					ad=[co for _ in range(a)]
					for _ in range(toa):ad.append(100-coo)
					for _ in range(t-a):ad.append(co)
					for _ in range(tob):ad.append(100-coo)
	
#	print(ad,0,ma)
	for t in ad:out.append(t)
#	out.append(ad)
	n-=ma
	coo+=1
	co+=1
print(len(out))
print(*out)
			

Compiler output:
a.cc:17:17: error: invalid preprocessing directive #print
   17 | #               print(n,sum)
      |                 ^~~~~
a.cc:20:25: error: invalid preprocessing directive #n
   20 | #                       n-=rco
      |                         ^
a.cc:27:9: error: invalid preprocessing directive #print
   27 | #       print(ma)
      |         ^~~~~
a.cc:46:9: error: invalid preprocessing directive #print
   46 | #       print(ad,0,ma)
      |         ^~~~~
a.cc:48:9: error: invalid preprocessing directive #out
   48 | #       out.append(ad)
      |         ^~~
a.cc:1:1: error: 'def' does not name a type
    1 | def nCr(a,b):
      | ^~~
Language: Java



import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class IntersectingDates 
{

	
	public static void main(String[]args)throws Throwable
	{
		Scanner sc = new Scanner(System.in);
		
		long n = sc.nextLong();
		PrintWriter out = new PrintWriter(System.out);
		int len = 200;
		ArrayList<Integer> ans = new ArrayList();
		for(int i = 1 ; i <= 100 ; ++i)
		{
			long lst = 0;
			for(int j = 1 ; j <= len ; ++j)
			{
				if((1 << (j - 1)) - 1 > n)
					break;
				lst = j;
			}
			n -= (1 << lst) - 1;
			len -= lst;
			for(int k = 0 ; k < lst ; ++k)
				ans.add(i);
		}
		System.out.println(ans.size());
		for(Integer x : ans)
			System.out.print(x+" ");
		
	}
	static class Scanner
	{
		BufferedReader br;
		StringTokenizer st;


		Scanner(InputStream s)  { br = new BufferedReader(new InputStreamReader(s)); }

		String next() throws IOException
		{

			while(st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();

		}
		int nextInt() throws NumberFormatException, IOException { return Integer.parseInt(next()); }

		long nextLong() throws NumberFormatException, IOException { return Long.parseLong(next()); }


	}
}


Compiler output:
Main.java:14: error: class IntersectingDates is public, should be declared in a file named IntersectingDates.java
public class IntersectingDates 
       ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: C++

21 77 68
16 73
16 99
19 66
2 87
2 16
7 17
10 36
10 68
2 38
10 74
13 55
21 21
3 7
12 41
13 88
18 6
2 12
13 87
1 9
2 27
13 15

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 21 77 68
      | ^~