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

int main() {
    int n,m;
    vector<pair<int,int>> v;
　//１つ目の時刻表
    cin>>n;
    rep(i,0,n){
        int h,m;
        cin>>h>>m;
        v.pb(make_pair(h,m));
    }
    //２つ目の時刻表
    cin>>m;
    rep(i,0,m){
        int h,m;
        cin>>h>>m;
        v.pb(make_pair(h,m));
    }
    Sort(v);
    //重複を消す
    v.erase(unique(v.begin(),v.end()),v.end());
    //時間は普通に、分は０埋め２桁で出力。
    rep(i,0,v.size()){
        if(i)cout<<" ";
        printf("%d:%02d",v[i].fi,v[i].se);
    }
    cout<<endl;
    return 0;
}



Compiler output:
a.cc:4:1: error: extended character 　 is not valid in an identifier
    4 | 　//１つ目の時刻表
      | ^
a.cc: In function 'int main()':
a.cc:3:5: error: 'vector' was not declared in this scope
    3 |     vector<pair<int,int>> v;
      |     ^~~~~~
a.cc:3:12: error: 'pair' was not declared in this scope
    3 |     vector<pair<int,int>> v;
      |            ^~~~
a.cc:3:17: error: expected primary-expression before 'int'
    3 |     vector<pair<int,int>> v;
      |                 ^~~
a.cc:4:1: error: '\U00003000' was not declared in this scope
    4 | 　//１つ目の時刻表
      | ^~
a.cc:6:9: error: 'i' was not declared in this scope
    6 |     rep(i,0,n){
      |         ^
a.cc:6:5: error: 'rep' was not declared in this scope
    6 |     rep(i,0,n){
      |     ^~~
a.cc:12:5: error: 'cin' was not declared in this scope
   12 |     cin>>m;
      |     ^~~
a.cc:18:10: error: 'v' was not declared in this scope
   18 |     Sort(v);
      |          ^
a.cc:18:5: error: 'Sort' was not declared in this scope
   18 |     Sort(v);
      |     ^~~~
a.cc:20:13: error: 'unique' was not declared in this scope
   20 |     v.erase(unique(v.begin(),v.end()),v.end());
      |             ^~~~~~
a.cc:26:5: error: 'cout' was not declared in this scope
   26 |     cout<<endl;
      |     ^~~~
a.cc:26:11: error: 'endl' was not declared in this scope
   26 |     cout<<endl;
      |           ^~~~
Language: C++

#include <vector>

int main() {
    int n,m;
    vector<pair<int,int>> v;
　//１つ目の時刻表
    cin>>n;
    rep(i,0,n){
        int h,m;
        cin>>h>>m;
        v.pb(make_pair(h,m));
    }
    //２つ目の時刻表
    cin>>m;
    rep(i,0,m){
        int h,m;
        cin>>h>>m;
        v.pb(make_pair(h,m));
    }
    Sort(v);
    //重複を消す
    v.erase(unique(v.begin(),v.end()),v.end());
    //時間は普通に、分は０埋め２桁で出力。
    rep(i,0,v.size()){
        if(i)cout<<" ";
        printf("%d:%02d",v[i].fi,v[i].se);
    }
    cout<<endl;
    return 0;
}



Compiler output:
a.cc:6:1: error: extended character 　 is not valid in an identifier
    6 | 　//１つ目の時刻表
      | ^
a.cc: In function 'int main()':
a.cc:5:5: error: 'vector' was not declared in this scope
    5 |     vector<pair<int,int>> v;
      |     ^~~~~~
a.cc:5:5: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:5:12: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
    5 |     vector<pair<int,int>> v;
      |            ^~~~
      |            std::pair
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/vector:62:
/usr/include/c++/14/bits/stl_pair.h:89:12: note: 'std::pair' declared here
   89 |     struct pair;
      |            ^~~~
a.cc:5:17: error: expected primary-expression before 'int'
    5 |     vector<pair<int,int>> v;
      |                 ^~~
a.cc:6:1: error: '\U00003000' was not declared in this scope
    6 | 　//１つ目の時刻表
      | ^~
a.cc:8:9: error: 'i' was not declared in this scope
    8 |     rep(i,0,n){
      |         ^
a.cc:8:5: error: 'rep' was not declared in this scope
    8 |     rep(i,0,n){
      |     ^~~
a.cc:14:5: error: 'cin' was not declared in this scope
   14 |     cin>>m;
      |     ^~~
a.cc:20:10: error: 'v' was not declared in this scope
   20 |     Sort(v);
      |          ^
a.cc:20:5: error: 'Sort' was not declared in this scope
   20 |     Sort(v);
      |     ^~~~
a.cc:22:13: error: 'unique' was not declared in this scope
   22 |     v.erase(unique(v.begin(),v.end()),v.end());
      |             ^~~~~~
a.cc:28:5: error: 'cout' was not declared in this scope
   28 |     cout<<endl;
      |     ^~~~
a.cc:28:11: error: 'endl' was not declared in this scope
   28 |     cout<<endl;
      |           ^~~~
Language: C++

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

int main(){
    int n,m,c,d,a[10000],b[1440],cnt;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>c>>d;
        b[c*60+d]=1;
    }
    cin>>m;
    for(int i =0;i<m;i++){
        cin>>c>>d;
        b[c*60+d]=1;
    }
    for(int i=0;i<1440;i++){
        if(b[i]==1){
            if(cnt){cout<<' ';
        }
        cnt++;
        cout<<i/60<<':';
        if(i%60<10){
            cout<<'0';
        }
    }
    cout<<endl;
    return 0;
}


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

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

int n,m,c,d,a[10000],b[1440],cnt;

int main(){
    
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>c>>d;
        b[c*60+d]=1;
    }
    cin>>m;
    for(int i =0;i<m;i++){
        cin>>c>>d;
        b[c*60+d]=1;
    }
    for(int i=0;i<1440;i++){
        if(b[i]==1){
            if(cnt){cout<<' ';
        }
        cnt++;
        cout<<i/60<<':';
        if(i%60<10){
            cout<<'0';
        }
    }
    cout<<endl;
    return 0;
}


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

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

int n,m,c,d,a[10000],b[1440],cnt;

int main(){
    
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>c>>d;
        b[c*60+d]=1;
    }
    cin>>m;
    for(int i =0;i<m;i++){
        cin>>c>>d;
        b[c*60+d]=1;
    }
    for(int i=0;i<1440;i++){
        if(b[i]==1){
            if(cnt){cout<<' ';
        cnt++;
        cout<<i/60<<':';
        if(i%60<10){
            cout<<'0';
        }
      }
    }
    cout<<endl;
    return 0;
}


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

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

public class main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int M = stdIn.nextInt();
		int p = stdIn.nextInt();
		int d[] = new int[M];
		for (int i = 0; i < M; i++) {
			int a = stdIn.nextInt();
			d[i] = (a - p + N) % N;
		}
		Arrays.sort(d);
		int b = 0;
		if (N - d[0] < d[M - 1]) {
			b = N - d[0];
		} else {
			b = d[M - 1];
		}
		for (int i = 0; i < M; i++) {
			if (i > 0) {
				int a = 2 * (N - d[i]) + d[i - 1];
				if (a < b) {
					b = a;
				}
				if (i < M - 1) {
					int c = 2 * d[i] + N - d[i + 1];
					if (c < b) {
						b = c;
					}
				}
			}
		}
		System.out.println(b * 100);
	}
}

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

#include<stdio.h>
void sort(void);
int right(int);
int left(int);
int min(int,int);
int N,M,p,cost=0;
int *d;

int right(int i)
{
	return d[i] - cost;
}

int left(int i)
{
	return N - d[i] + p;
}

int min(int x,int y)
{
	if(x < y)
		return x;
	else
		return y;
}

void sort(void)
{
	int i,j,T;
	for(i=0;i<M-1;i++){
		for(j=i+1;j<M;j++){
			if(d[i] > d[j]){
			T = d[i];
			d[i] = d[j];
			d[j] = T;
			}
		}
	}
}

int main(void)
{
	int i;
	scanf("%d %d %d",&N,&M,&p);
	d = new int[M];
	for(i=0;i<M;i++) scanf("%d",&d[i]);
	sort();
	for(i=0;i<M;i++) printf("%d ",d[i]);
	for(i=0;i<M;i++){
		cost = cost + min(right(i),left(i));
	}
	printf("%d\n",cost*100);	
}

Compiler output:
main.c: In function 'main':
main.c:45:13: error: 'new' undeclared (first use in this function)
   45 |         d = new int[M];
      |             ^~~
main.c:45:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:45:16: error: expected ';' before 'int'
   45 |         d = new int[M];
      |                ^~~~
      |                ;
Language: C

#include<cstdio>
#include<algorithm>
using namespace std;
int n,m,p;
int d[10001];
int dist(int i,int j){
    if(i==j) return 0;
    else if(i<j) return j-i;
    else return j+n-i;
}

void solve(){
    int ans=100000;

    for(int i=0;i<m;i++){
	ans=min(ans,dist(p,d[i])+dist(d[i+1%m],d[i]));
	ans=min(ans,dist(d[i],p)+dist(d[i],d[(i+m-1)%m]));
    }
    printf("%d\n",ans*100);
}
	

int main(void){

    scanf("%d%d%d",&n,&m,&p);
    d[0]=p;
    for(int i=1;i<=m;i++){
	scanf("%d",&d[i]);
	
    }
    m++;
    sort(d,d+m);

    solve();

    return 0;
}

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

#include<stdio.h>
int d[100000] = { 0 };
int main()
{
	int n, m, p, i, v, j, c = 0, z = 0, k = 0,  l;
	scanf_s("%d %d %d", &n, &m, &p);
	for (i = 0; i < m; i++) {
		scanf_s("%d", &v);
		d[v] = 1;
	}
	for (;;) {
		l = 0;
		z = 0;
		i = p;
		j = p;
		while(1){
			if (i > n-1) {
				i = 0;
			}
			if (j < 0) {
				j = n-1;
			}
			if (d[i] == 1) {
				c += l;
				d[i] = 2;
				p = i;
				break;
			}
			if (d[j] == 1) {
				c += l;
				d[j] = 2;
				p = j;
				break;
			}
			if (i == p&&j == p&&z > 0) {
				break;
			}
			if (i == p&&z > 0) {
				i--;
			}
			if (j == p&&z > 0) {
				j++;
			}
			z++;
			i++;
			j--;
			l++;
		}
		k = 0;
		for (i = 0; i < n; i++) {
			if (d[i] == 1) {
				k = 1;
			}
		}
		if (k == 0) {
			break;
		}
	}
	printf("%d\n", c*100);
	return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
int n,m,p,a[1<<17],i,r,V,W,X;
main(){
cin>>n>>m>>p;
for(i=0;i<m;i++){cin>>a[i];a[i]+=n-p;a[i]%=n;}
sort(a,a+m);
r=min(a[m-1],n-a[0]);
for(int i=0;i<m-1;i++){
V=a[i],W=n-a[i+1];if(V>W)swap(V,W);
X=2*V+W;r=min(ret,X);
}
cout<<r*100<<endl;
}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:11:15: error: 'ret' was not declared in this scope
   11 | X=2*V+W;r=min(ret,X);
      |               ^~~
Language: C++

#include <iostream>
using namespace std;
int main(){
	int N,M,p;
	cin>>N>>M>>p;
	int d[10001];
	d[0]=p;
	for(int i=0;i<M;i++)
		cin>>d[i];
	sort(d,d+M+1);
	
	int c_min=N-1;
	for(int i=0;i<M+1;i++){
		int q=d[i];
		int r1=d[(i-1+M+1)%(M+1)];
		int r2=d[(i+1)%(M+1)];
		int c1=((p-q+N)%N)*2+(p-r1+N)%N;
		int c1=((q-p+N)%N)*2+(r2-p+N)%N;
		c_min=min(c_min,min(c1,c2));
	}
	cout<<c_min*100<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |         sort(d,d+M+1);
      |         ^~~~
      |         short
a.cc:18:21: error: redeclaration of 'int c1'
   18 |                 int c1=((q-p+N)%N)*2+(r2-p+N)%N;
      |                     ^~
a.cc:17:21: note: 'int c1' previously declared here
   17 |                 int c1=((p-q+N)%N)*2+(p-r1+N)%N;
      |                     ^~
a.cc:19:40: error: 'c2' was not declared in this scope; did you mean 'c1'?
   19 |                 c_min=min(c_min,min(c1,c2));
      |                                        ^~
      |                                        c1
Language: C++

#include<iostream>
#include<algorithm>
#include<deque>
#include<queue>
using namespace std;
int main(){
	int a;
	int n=0;
	int m=0;
	int p=0;
	int i=0;
	int g=0;
	int j=0;
	int w[2];
	priority_queue<int,vector<int>,greater<int> > pq;
	deque<int> de;
	cin>>n>>m>>p;
	for(i=0;i<m;i++){
		cin>>a;
		if(a<p)a+=n;
		a-=p;
		pq.push(a);
	}
	while(!pq.empty()){
		de.push_back(pq.top());
		pq.pop();
	}
	for(i=0;i<m;i++){
		w[0]=de.front()-p;
		w[1]=n+p-de.back();
		if(w[0]>w[1]){
			
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:2: error: expected '}' at end of input
   33 | }
      |  ^
a.cc:28:25: note: to match this '{'
   28 |         for(i=0;i<m;i++){
      |                         ^
a.cc:33:2: error: expected '}' at end of input
   33 | }
      |  ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

//============================================================================
// Name        : AOJ.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

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

int main() {
	int N,M,p,D;
	int R=10000;
	cin>>N>>M>>p;
	for(int i=0;i<M;i++){
		cin>>D;
	}
	int solve(){
	if ( D.size() == 1 )
	return min(pdist(D[0], p), ndist(D[0], p));
	int ans= 2*N;
    for ( int i= 0; i< M; i++ ){
	int b = D[i];
	int e = D[(i+1)%M];
	int d = min(pdist(b, p), min(pdist(e, p), min(ndist(b, p), ndist(e,p))));
	ans= min(d + (N-pdist(b, e)), ans);
	}



	cout<<R<<endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:18: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   23 |         int solve(){
      |                  ^~
a.cc:23:18: note: remove parentheses to default-initialize a variable
   23 |         int solve(){
      |                  ^~
      |                  --
a.cc:23:18: note: or replace parentheses with braces to value-initialize a variable
a.cc:23:20: error: a function-definition is not allowed here before '{' token
   23 |         int solve(){
      |                    ^
a.cc:39:2: error: expected '}' at end of input
   39 | }
      |  ^
a.cc:16:12: note: to match this '{'
   16 | int main() {
      |            ^
Language: C++

//============================================================================
// Name        : AOJ.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

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

int N, M, p;
vector<int> D;
	int pdist(int s, int t){ return ( t >= s )?(t -s):((t+N) -s); }
	int ndist(int s, int t){ return pdist(t, s);}
	int solve(){
	if ( D.size() == 1 )
	return min(pdist(D[0], p), ndist(D[0], p));
	int ans= 2*N;
    for ( int i= 0; i< M; i++ ){
	int b = D[i];
	int e = D[(i+1)%M];
	int d = min(pdist(b, p), min(pdist(e, p), min(ndist(b, p), ndist(e,p))));
	ans= min(d + (N-pdist(b, e)), ans);
	}
	return ans;
int main() {
int k;
	cin>> N >> M >> p;
	for ( inti= 0; i< M; i++ ){
		cin>> k;
		D.push_back(k);
	}
	sort(D.begin(), D.end());
	cout<< 100*solve() << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int solve()':
a.cc:31:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   31 | int main() {
      |         ^~
a.cc:31:9: note: remove parentheses to default-initialize a variable
   31 | int main() {
      |         ^~
      |         --
a.cc:31:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:31:12: error: a function-definition is not allowed here before '{' token
   31 | int main() {
      |            ^
a.cc:42:2: error: expected '}' at end of input
   42 | }
      |  ^
a.cc:20:20: note: to match this '{'
   20 |         int solve(){
      |                    ^
Language: C++

//============================================================================
// Name        : AOJ.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

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

int N, M, p;
vector<int> D;
	int pdist(int s, int t){ return ( t >= s )?(t -s):((t+N) -s); }
	int ndist(int s, int t){ return pdist(t, s);}
	int solve(){
	if ( D.size() == 1 )
	return min(pdist(D[0], p), ndist(D[0], p));
	int ans= 2*N;
    for ( int i= 0; i< M; i++ ){
	int b = D[i];
	int e = D[(i+1)%M];
	int d = min(pdist(b, p), min(pdist(e, p), min(ndist(b, p), ndist(e,p))));
	ans= min(d + (N-pdist(b, e)), ans);
	}
	return ans;
	}
int main() {
	int k;
	cin>> N >> M >> p;
	for ( inti= 0; i< M; i++ ){
		cin>> k;
		D.push_back(k);
	}
	sort(D.begin(), D.end());
	cout<< 100*solve() << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:15: error: 'inti' was not declared in this scope; did you mean 'int'?
   35 |         for ( inti= 0; i< M; i++ ){
      |               ^~~~
      |               int
a.cc:35:24: error: 'i' was not declared in this scope
   35 |         for ( inti= 0; i< M; i++ ){
      |                        ^
Language: C++

#include<iostream>
#include<stack>
#include<algorithm>
using namespace std;
 
int Route(int* D,int m,int start,int n)
{
    int route;
 
    int min=n; int max=0;
    for(int i=0;i<m;i++){
        if(D[i]<=n/2&&max<D[i])
            max=D[i];
        if(D[i]>n/2&&min>D[i]||start>D[i]&&D[i]!=n/2)
            min=D[i];
    }
 
    int r=start; int l=start;
    int route1=0; int route2=0;
 
    stack<int> s1; s1.push(r);
     
    while(max!=start){
        if(r+1==n){
            r=0;
            s1.push(r);
        }
        else if(r!=n/2+1||start==n/2+1){
            r++;
            s1.push(r);
        }
        else{
            break;
        }
        if(s1.top()==max){
            route1=s1.size()-1;
            break;
        }
    }
 
    stack<int> s2; s2.push(l);
         
    while(min!=n){
        if(l-1==-1){
            l=n-1;
            s2.push(l);
        }
        else if(l!=n/2){
            l--;
            s2.push(l);
        }
        else{
            break;
        }
        if(s2.top()==min){
            route2=s2.size()-1;
            break;
        }
    }
     
    if(route1<=route2)
        route=2*route1+route2;
    else if(route1>route2)
        route=2*route2+route1;
    else if(route2==0)
        route=route1;
    else if(route1==0)
        route=route2;
 
 
    if(D[0]<=n/2&&D[m-1]>=n/2){
        if(D[m-1]>=start){
            if(D[m-1]-start<route)
                route=D[m-1]-start;
        }
        else{
            if(start-D[0]<route)
                route=start-D[0];
        }
    }
 
    return route;
}
 
 
int main(){
    int N,M;
    cin>>N>>M;
 
    int p;
    cin>>p;
     
    int d[100000];
    for(int i=0;i<M;i++)
        cin>>d[i];
 
    sort(d,d+M);
 
    cout<<Route(d,M,p,N)*100<<endl;
 
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:101:14: error: expected '}' at end of input
  101 |     return 0;
      |              ^
a.cc:86:11: note: to match this '{'
   86 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;

int main(){
	int N,M,p;
	cin>>N>>M>>p;
	int d[10001];
	d[0]=p;
	for(int i=1;i<=M;i++){
		cin>>d[i];
	}
	sort(d,d+M+1);
	int c_min=N-1;
	for(int i=0;i<M+1;i++){
		int q=d[i];
		int r1=d[(i-1+M+1)%(M+1)];
		int r2=d[(i+1)%(M+1)];
		int c1=((p-q+N)*2+(r1-p+N)%N;
		int c2=((q-p+N)*2+(p-r2+N)%N;
		c_min=min(c_min,min(c1,c2));
	}
	cout<<c_min*100<<endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |         sort(d,d+M+1);
      |         ^~~~
      |         short
a.cc:18:45: error: expected ')' before ';' token
   18 |                 int c1=((p-q+N)*2+(r1-p+N)%N;
      |                        ~                    ^
      |                                             )
a.cc:19:45: error: expected ')' before ';' token
   19 |                 int c2=((q-p+N)*2+(p-r2+N)%N;
      |                        ~                    ^
      |                                             )
Language: C++

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

int int main() {
int N,M,p;
cin>>N>>M>>p;
int d[10001];
d[0]=p;

for (int i = 1; i < M; i++) {
  cin>>d[i];
}
sort(d,d+M+1);
int c_min =N-1;
for (int i = 0; i < M+1; i++) {
  int q =d[i];
  int r1 =d[(i-1+M+1)%(M+1)];
  int r2 =d[(i+1)%(M+1)];

  int c1 =((p-q+N)%N)*2+(r1-p+N)%N;
  int c2 =((p-q+N)%N)*2+(p-r2+N)%N;

c_min =min(c_min,min(c1,c2));

}
cout <<c_min*100 << endl;
  return 0;
}

Compiler output:
a.cc:5:1: error: two or more data types in declaration of 'main'
    5 | int int main() {
      | ^~~
Language: C++

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

int main(){
 int N,M,p = 0;
 cin >> N >> M >> p;

 int d[M+1];
 d[0] = p;

 for(int i=1; i<=M; i++){
  cin >> d[i];
 }

 sort(d, d+M+1);

 int money = N-1;
 for(int i=0; i<M+1; i++){
  int q = d[i];
  int r1 = d[(i-1+M+1)%(M+1)];
  int r2 = d[(i+1)%(M+1)];
  int c1 = ((p-q+N)%N)*2+(r1-p+N)%N;
  int c2 = ((q-p+N)%N)*2+(p-r2+N)%N;
  money = min(money, min(c1,c2));
 }
 cout << money*100 << endl;
 return 0;
}
~                 

Compiler output:
a.cc:30:2: error: expected class-name at end of input
   30 | ~
      |  ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int n, m, p ;
int d[10010];

int main(){
	cin >> n >> m >> p;
	for (int i = 0; i < m; i++)
	{
		cin >> d[i];
		d[i] -= p;
		if (d[i] < 0)d[i] += n;
	}

	sort(&d[0], &d[m]);
	int ans = 0;
	ans=d[m - 1] * 100;
	ans = min(ans, (n - d[0]) * 100);                                                                                                                                                                                                                                                            )
	for (int i = 0; i < M - 1; i++){
		int c1 = 2 * (d[i] * 100);
		int c2 = (N - d[i + 1]) * 100;
		ans = min(ans, c1 + c2);
	}
	for (int i = M - 1; i > 0; i--){
		int c1 = 2 * ((N - d[i]) * 100);
		int c2 = d[i - 1] * 100;
		ans = min(ans, c1 + c2);
	}
	cout << ans << endl;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:294: error: expected primary-expression before ')' token
   19 |         ans = min(ans, (n - d[0]) * 100);                                                                                                                                                                                                                                                            )
      |                                                                                                                                                                                                                                                                                                      ^
a.cc:20:25: error: 'i' was not declared in this scope
   20 |         for (int i = 0; i < M - 1; i++){
      |                         ^
a.cc:20:29: error: 'M' was not declared in this scope
   20 |         for (int i = 0; i < M - 1; i++){
      |                             ^
a.cc:26:32: error: 'N' was not declared in this scope
   26 |                 int c1 = 2 * ((N - d[i]) * 100);
      |                                ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int n, m, p ;
int d[10010];

int main(){
	cin >> n >> m >> p;
	for (int i = 0; i < m; i++)
	{
		cin >> d[i];
		d[i] -= p;
		if (d[i] < 0)d[i] += n;
	}

	sort(&d[0], &d[m]);
	int ans = 0;
	ans=d[m - 1] * 100;
	ans = min(ans, (n - d[0]) * 100);
	for (int i = 0; i < M - 1; i++){
		int c1 = 2 * (d[i] * 100);
		int c2 = (N - d[i + 1]) * 100;
		ans = min(ans, c1 + c2);
	}
	for (int i = M - 1; i > 0; i--){
		int c1 = 2 * ((N - d[i]) * 100);
		int c2 = d[i - 1] * 100;
		ans = min(ans, c1 + c2);
	}
	cout << ans << endl;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:20:29: error: 'M' was not declared in this scope
   20 |         for (int i = 0; i < M - 1; i++){
      |                             ^
a.cc:22:27: error: 'N' was not declared in this scope
   22 |                 int c2 = (N - d[i + 1]) * 100;
      |                           ^
a.cc:25:22: error: 'M' was not declared in this scope
   25 |         for (int i = M - 1; i > 0; i--){
      |                      ^
a.cc:26:32: error: 'N' was not declared in this scope
   26 |                 int c1 = 2 * ((N - d[i]) * 100);
      |                                ^
Language: C++

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

int main(void){
    int i,j,k,d[100005],n,m,s;
    cin>>n>>m>>s;
    for(i=0;i<m;i++)cin>>d[i];
    d[m]=s;
    int ans,left,right;
    ans = 21000000;
    sort(d,d+m+1)=d[0];
    for(i=0;i<=m;i++){
        left = d[i]-s;
        if(left<0)left +=n;
        right = s-d[i+1];
        if(right<0)right+=n;
        ans = min(ans,right*2 + left);
        ans= min(ans,left*2 + right);
    }
    cout<<ans*100<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: invalid use of 'void'
   11 |     sort(d,d+m+1)=d[0];
      |     ~~~~^~~~~~~~~
Language: C++

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

const int b[7] = {0,9,12,15,18,21,30};
inline bool check(const vector<int> &c){
  for(int x=0;x<6;x++){
    for(int i=b[x];i<b[x+1]-1;i++)if(c[i]!=c[i+1])return false;
  }
  return true;
}

inline void rot(vector<int> &c, int d){
  if(d == 0){
    swap(c[0],c[23]); swap(c[3],c[26]); swap(c[6],c[29]);
    swap(c[15],c[17]); swap(c[9],c[20]);
  }
  if(d == 1){
    swap(c[6],c[21]); swap(c[7],c[22]); swap(c[8],c[23]);
    swap(c[9],c[11]); swap(c[12],c[17]);
  }
  if(d == 2){
    swap(c[2],c[21]); swap(c[5],c[24]); swap(c[8],c[27]);
    swap(c[12],c[14]); swap(c[11],c[18]);
  }
  if(d == 3){
    swap(c[0],c[27]); swap(c[1],c[28]); swap(c[2],c[29]);
    swap(c[18],c[20]); swap(c[14],c[15]);
  }
}

int rec(int d, vector<int> &c){
  if(check(c))return d;
  if(d>=8)return 8;

  int res = 8;
  for(int i=0;i<4;i++){
    rot(c,i);
    res = min(res, rec(d+1,c));
    if(res==d)break;
    rot(c,i);
  }
  return res;
}

int main(){
  int t;
  scanf("%d",&t);
  while(t--){
    vector<int> p(30);
    for(int i=0;i<30;i++)scanf("%d\n",&p[i]);
    cout << rec(0,p) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:5: error: 'cout' was not declared in this scope
   52 |     cout << rec(0,p) << endl;
      |     ^~~~
a.cc:3:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<vector>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:52:25: error: 'endl' was not declared in this scope
   52 |     cout << rec(0,p) << endl;
      |                         ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include<vector>
  +++ |+#include <ostream>
    3 | using namespace std;
Language: C++

#include<cmath> 
#include<algorithm> 
#include<string> 
#include<vector> 
#include<map> 
using namespace std; 
//aからbに向かう,true=右回りfalse=左回り 
int get(int a,int b,int n,bool f){ 
    if(f){ 
    if(a>b)return b+n-a; 
    else return b-a; 
    } 
    else{ 
    if(a>b)return a-b; 
    else return a+n-b; 
    } 
} 
int main(){ 
	int n,m,p,t[120000],ans; 
	int a=0,b=0; 
	cin>>n>>m>>p; 
	ans=n; 
    	for(int i=0;i<m;i++)cin>>t[i]; 
   	 sort(t,t+m); 
   	 for(int i=0;i<m;i++){ 
   	 a=max(a,get(p,t[i],n,1)); 
    	} 
   	 for(int i=0;i<m;i++){ 
   	 b=max(b,get(p,t[i],n,0)); 
   	 } 
    	if(a<b)ans=a; 
	else ans=b; 

    for(int i=0;i<m;i++){ 
    ans=min(ans,get(p,t[i],n,true)*2+get(p,t[i+1],n,0)); 
    if(i==m-1)ans=min(ans,get(p,t[i],n,1)*2+get(p,t[0],n,0)); 
    } 

    for(int i=m-1;i>=0;i--){ 
    if(i!=0)ans=min(ans,get(p,t[i],n,0)*2+get(p,t[i-1],n,1)); 
    else ans=min(ans,get(p,t[i],n,0)*2+get(p,t[m-1],n,1)); 
    } 

    if(m==1)cout<<min(get(p,t[0],n,1),get(p,t[0],n,0))*100<<endl; 
    else cout<<ans*100<<endl; 
    return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'cin' was not declared in this scope
   21 |         cin>>n>>m>>p;
      |         ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #include<map>
  +++ |+#include <iostream>
    6 | using namespace std;
a.cc:44:13: error: 'cout' was not declared in this scope
   44 |     if(m==1)cout<<min(get(p,t[0],n,1),get(p,t[0],n,0))*100<<endl;
      |             ^~~~
a.cc:44:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:44:61: error: 'endl' was not declared in this scope
   44 |     if(m==1)cout<<min(get(p,t[0],n,1),get(p,t[0],n,0))*100<<endl;
      |                                                             ^~~~
a.cc:6:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    5 | #include<map>
  +++ |+#include <ostream>
    6 | using namespace std;
a.cc:45:10: error: 'cout' was not declared in this scope
   45 |     else cout<<ans*100<<endl;
      |          ^~~~
a.cc:45:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:45:25: error: 'endl' was not declared in this scope
   45 |     else cout<<ans*100<<endl;
      |                         ^~~~
a.cc:45:25: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <iostream>

using namespace std;

static int p_index[4][5] = {
    {15, 0, 3, 6, 9},
    {18, 2, 1, 0, 15},
    {12, 8, 5, 2, 18},
    {9, 6, 7, 8, 12}
};
static int n_index[4][5] = {
    {17, 23, 26, 29, 20},
    {20, 29, 28, 27, 14},
    {14, 27, 24, 21, 11},
    {11, 21, 22, 23, 17}
};

bool complete(int floppy_cube[]) {
    for (int i = 1; i < 9; i++) {
        if (floppy_cube[i - 1] != floppy_cube[i]) {
            return false;
        }
    }

    for (int i = 10; i < 12; i++) {
        if (floppy_cube[i - 1] != floppy_cube[i]) {
            return false;
        }
    }

    for (int i = 13; i < 15; i++) {
        if (floppy_cube[i - 1] != floppy_cube[i]) {
            return false;
        }
    }

    for (int i = 16; i < 18; i++) {
        if (floppy_cube[i - 1] != floppy_cube[i]) {
            return false;
        }
    }

    for (int i = 19; i < 21; i++) {
        if (floppy_cube[i - 1] != floppy_cube[i]) {
            return false;
        }
    }

    for (int i = 22; i < 30; i++) {
        if (floppy_cube[i - 1] != floppy_cube[i]) {
            return false;
        }
    }

    return true;
}

void rotate(int floppy_cube[30], int direction) {
    for (int i = 0; i < 5; i++) {
        swap(floppy_cube[p_index[direction][i]], floppy_cube[n_index[direction][i]]);
    }
}

int dfs(int floppy_cube[30], int depth = 0) {
    if (depth > 8) {
        return INT_MAX;
    }
    if (complete(floppy_cube)) {
        return depth;
    }

    int res = INT_MAX;

    int clone[30];
    memcpy(clone, floppy_cube, sizeof(int) * 30);
    for (int i = 0; i < 5; i++) {
        rotate(floppy_cube, i);
        res = min(res, dfs(floppy_cube, depth + 1));    
        memcpy(floppy_cube, clone, sizeof(int) * 30);
    }

    return res;
}

int main() {
    int n;
    cin >> n;
    while (n--) {
        int floppy_cube[30];
        for (int i = 0; i < 30; i++) {
            cin >> floppy_cube[i]; 
        }
        cout << dfs(floppy_cube) << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int dfs(int*, int)':
a.cc:66:16: error: 'INT_MAX' was not declared in this scope
   66 |         return INT_MAX;
      |                ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include <iostream>
  +++ |+#include <climits>
    2 | 
a.cc:72:15: error: 'INT_MAX' was not declared in this scope
   72 |     int res = INT_MAX;
      |               ^~~~~~~
a.cc:72:15: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
a.cc:75:5: error: 'memcpy' was not declared in this scope
   75 |     memcpy(clone, floppy_cube, sizeof(int) * 30);
      |     ^~~~~~
a.cc:2:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 |
Language: C++

#define INF 1000000000;

#include <iostream>

using namespace std;

static int p_index[4][5] = {
    {15, 0, 3, 6, 9},
    {18, 2, 1, 0, 15},
    {12, 8, 5, 2, 18},
    {9, 6, 7, 8, 12}
};
static int n_index[4][5] = {
    {17, 23, 26, 29, 20},
    {20, 29, 28, 27, 14},
    {14, 27, 24, 21, 11},
    {11, 21, 22, 23, 17}
};

bool complete(int floppy_cube[]) {
    for (int i = 1; i < 9; i++) {
        if (floppy_cube[i - 1] != floppy_cube[i]) {
            return false;
        }
    }

    for (int i = 10; i < 12; i++) {
        if (floppy_cube[i - 1] != floppy_cube[i]) {
            return false;
        }
    }

    for (int i = 13; i < 15; i++) {
        if (floppy_cube[i - 1] != floppy_cube[i]) {
            return false;
        }
    }

    for (int i = 16; i < 18; i++) {
        if (floppy_cube[i - 1] != floppy_cube[i]) {
            return false;
        }
    }

    for (int i = 19; i < 21; i++) {
        if (floppy_cube[i - 1] != floppy_cube[i]) {
            return false;
        }
    }

    for (int i = 22; i < 30; i++) {
        if (floppy_cube[i - 1] != floppy_cube[i]) {
            return false;
        }
    }

    return true;
}

void rotate(int floppy_cube[30], int direction) {
    for (int i = 0; i < 5; i++) {
        swap(floppy_cube[p_index[direction][i]], floppy_cube[n_index[direction][i]]);
    }
}

int dfs(int floppy_cube[30], int depth = 0) {
    if (depth > 8) {
        return INF;
    }
    if (complete(floppy_cube)) {
        return depth;
    }

    int res = INF;

    int clone[30];
    memcpy(clone, floppy_cube, sizeof(int) * 30);
    for (int i = 0; i < 5; i++) {
        rotate(floppy_cube, i);
        res = min(res, dfs(floppy_cube, depth + 1));    
        memcpy(floppy_cube, clone, sizeof(int) * 30);
    }

    return res;
}

int main() {
    int n;
    cin >> n;
    while (n--) {
        int floppy_cube[30];
        for (int i = 0; i < 30; i++) {
            cin >> floppy_cube[i]; 
        }
        cout << dfs(floppy_cube) << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int dfs(int*, int)':
a.cc:77:5: error: 'memcpy' was not declared in this scope
   77 |     memcpy(clone, floppy_cube, sizeof(int) * 30);
      |     ^~~~~~
a.cc:4:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <iostream>
  +++ |+#include <cstring>
    4 |
Language: C++

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

void solve();
bool hantei(int *m,int s,int e)

int main(){
	int n;
	while(n--) solve();
	return 0;
}


void solve(){
	int i,j,tmp;
	int men[30],m[30];
	int ans=8;
	
	for(i=0;i<30;i++) cin>>men[30];
	
	for(i=0;i<65536;i++){
		for(j=0;j<30;j++) m[j]=men[j];
		tmp=i;
		for(j=1;j<=8;j++){
			switch(tmp%4){
			case 0:
			swap(m[0],m[27]);swap(m[1],m[28]);swap(m[2],m[29]);
			swap(m[14],m[15]);swap(m[18],m[20]);
			break;
			case 1:
			swap(m[6],m[21]);swap(m[7],m[22]);swap(m[8],m[23]);
			swap(m[12],m[17]);swap(m[9],m[11]);
			break;
			case 2:
			swap(m[2],m[21]);swap(m[5],m[24]);swap(m[8],m[27]);
			swap(m[11],m[18]);swap(m[12],m[14]);
			break;
			case 3:
			swap(m[0],m[23]);swap(m[3],m[26]);swap(m[6],m[29]);
			swap(m[9],m[20]);swap(m[15],m[17]);
			break;
			}
			tmp/=4;
			
			if(hantei(m,0,8) && hantei(m,9,11) && hantei(m,12,14) && hantei(m,15,17) && hantei(m,18,20) && hantei(m,21,29))
				ans=min(ans,j);
		}
	}
	cout<<ans<<endl;
}

bool hantei(int *m,int s,int e){
	int i;
	for(i=s+1;i<=e;i++){
		if(m[i]!=m[s]) return false;
	}
	return true;
}

Compiler output:
a.cc:8:1: error: expected initializer before 'int'
    8 | int main(){
      | ^~~
a.cc: In function 'void solve()':
a.cc:46:28: error: 'hantei' was not declared in this scope
   46 |                         if(hantei(m,0,8) && hantei(m,9,11) && hantei(m,12,14) && hantei(m,15,17) && hantei(m,18,20) && hantei(m,21,29))
      |                            ^~~~~~
Language: C++

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

class FC{
public:
	int p[31];
	int n;

	bool is_over(){
		return p[1]==p[2]&&p[2]==p[3]&&p[3]==p[4]&&p[4]==p[5]
			&&p[5]==p[6]&&p[6]==p[7]&&p[7]==p[8]&&p[8]==p[9]
			&&p[10]==p[11]&&p[11]==p[12]
			&&p[13]==p[14]&&p[14]==p[15]
			&&p[16]==p[17]&&p[17]==p[18]
			&&p[19]==p[20]&&p[20]==p[21]
			&&p[22]==p[23]&&p[23]==p[24]&&p[24]==p[25]&&p[25]==p[26]
			&&p[26]==p[27]&&p[27]==p[28]&&p[28]==p[29]&&p[29]==p[30]
	}
	void rot1(){
		swap(p[7],p[22]);swap(p[8],p[23]);swap(p[9],p[24]);
		swap(p[13],p[18]);swap(p[10].p[12]);
	}
	void rot2(){
		swap(p[1],p[28]);swap(p[2],p[29]);swap(p[3],p[30]);
		swap(p[15],p[16]);swap(p[19].p[21]);
	}
	void rot3(){
		swap(p[1],p[24]);swap(p[4],p[27]);swap(p[7],p[30]);
		swap(p[10],p[21]);swap(p[16].p[18]);
	}
	void rot4(){
		swap(p[3],p[22]);swap(p[6],p[25]);swap(p[9],p[28]);
		swap(p[12],p[19]);swap(p[13].p[15]);
	}
};

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

	for(int i=0;i<N;i++){
		FC now;
		for(int j=1;j<=30;j++)
			cin>>nom.p[j];
		now.n=0;

		queue<FC> que;
		que.push(now);
	
	      	while(!que.empty()){
			now=que.front();
			que.pop();

			if(now.is_over()){
				cout<<now.n<<endl;
				break;
			}
			
			FC nex1=now; nex1.rot1(); nex1.n++; que.push(nex1);
			FC nex2=now; nex2.rot2(); nex2.n++; que.push(nex2);
			FC nex3=now; nex3.rot3(); nex3.n++; que.push(nex3);
			FC nex4=now; nex4.rot4(); nex4.n++; que.push(nex4);
		}
	}

	return 0;
}

Compiler output:
a.cc: In member function 'bool FC::is_over()':
a.cc:20:9: error: expected ';' before '}' token
   20 |         }
      |         ^
a.cc: In member function 'void FC::rot1()':
a.cc:23:46: error: request for member 'p' in '((FC*)this)->FC::p[10]', which is of non-class type 'int'
   23 |                 swap(p[13],p[18]);swap(p[10].p[12]);
      |                                              ^
a.cc: In member function 'void FC::rot2()':
a.cc:27:46: error: request for member 'p' in '((FC*)this)->FC::p[19]', which is of non-class type 'int'
   27 |                 swap(p[15],p[16]);swap(p[19].p[21]);
      |                                              ^
a.cc: In member function 'void FC::rot3()':
a.cc:31:46: error: request for member 'p' in '((FC*)this)->FC::p[16]', which is of non-class type 'int'
   31 |                 swap(p[10],p[21]);swap(p[16].p[18]);
      |                                              ^
a.cc: In member function 'void FC::rot4()':
a.cc:35:46: error: request for member 'p' in '((FC*)this)->FC::p[13]', which is of non-class type 'int'
   35 |                 swap(p[12],p[19]);swap(p[13].p[15]);
      |                                              ^
a.cc: In function 'int main()':
a.cc:46:30: error: 'nom' was not declared in this scope; did you mean 'now'?
   46 |                         cin>>nom.p[j];
      |                              ^~~
      |                              now
Language: C++

int main()
{
    int N;
    cin >> N;
 
    for(int i=0; i<N; i++){
        FC now;
        for(int j=1; j<=30; j++){
            cin >> now.p[j];
        }
        now.n = 0;
 
        queue<FC> que;
        que.push(now);
 
        while(!que.empty()){
            now = que.front();
            que.pop();
 
            if(now.is_over()){
                cout << now.n << endl;
                break;
            }
 
            FC nex1 = now;  nex1.rot1();  nex1.n++;  que.push(nex1);
            FC nex2 = now;  nex2.rot2();  nex2.n++;  que.push(nex2);
            FC nex3 = now;  nex3.rot3();  nex3.n++;  que.push(nex3);
            FC nex4 = now;  nex4.rot4();  nex4.n++;  que.push(nex4);
        }
    }
 
    return 0;
}  

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin >> N;
      |     ^~~
a.cc:7:9: error: 'FC' was not declared in this scope
    7 |         FC now;
      |         ^~
a.cc:9:20: error: 'now' was not declared in this scope
    9 |             cin >> now.p[j];
      |                    ^~~
a.cc:11:9: error: 'now' was not declared in this scope
   11 |         now.n = 0;
      |         ^~~
a.cc:13:9: error: 'queue' was not declared in this scope
   13 |         queue<FC> que;
      |         ^~~~~
a.cc:13:19: error: 'que' was not declared in this scope
   13 |         queue<FC> que;
      |                   ^~~
a.cc:21:17: error: 'cout' was not declared in this scope
   21 |                 cout << now.n << endl;
      |                 ^~~~
a.cc:21:34: error: 'endl' was not declared in this scope
   21 |                 cout << now.n << endl;
      |                                  ^~~~
a.cc:25:15: error: expected ';' before 'nex1'
   25 |             FC nex1 = now;  nex1.rot1();  nex1.n++;  que.push(nex1);
      |               ^~~~~
      |               ;
a.cc:25:29: error: 'nex1' was not declared in this scope
   25 |             FC nex1 = now;  nex1.rot1();  nex1.n++;  que.push(nex1);
      |                             ^~~~
a.cc:26:15: error: expected ';' before 'nex2'
   26 |             FC nex2 = now;  nex2.rot2();  nex2.n++;  que.push(nex2);
      |               ^~~~~
      |               ;
a.cc:26:29: error: 'nex2' was not declared in this scope
   26 |             FC nex2 = now;  nex2.rot2();  nex2.n++;  que.push(nex2);
      |                             ^~~~
a.cc:27:15: error: expected ';' before 'nex3'
   27 |             FC nex3 = now;  nex3.rot3();  nex3.n++;  que.push(nex3);
      |               ^~~~~
      |               ;
a.cc:27:29: error: 'nex3' was not declared in this scope
   27 |             FC nex3 = now;  nex3.rot3();  nex3.n++;  que.push(nex3);
      |                             ^~~~
a.cc:28:15: error: expected ';' before 'nex4'
   28 |             FC nex4 = now;  nex4.rot4();  nex4.n++;  que.push(nex4);
      |               ^~~~~
      |               ;
a.cc:28:29: error: 'nex4' was not declared in this scope
   28 |             FC nex4 = now;  nex4.rot4();  nex4.n++;  que.push(nex4);
      |                             ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
using namespace std;
int n;
int dfs(int x[30],d){
    if(x[0]==x[1]&&x[1]==x[2]&&x[3]==x[4]&&x[4]==x[5]&&x[5]==x[6]&&x[6]==x[7]&&x[7]==x[8])return d;
    if(d==8)return 8;
    int res=8;
    swap(x[6],x[21]);
    swap(x[7],x[22]);
    swap(x[8],x[23]);
    swap(x[9],x[11]);
    swap(x[12],x[17]);
    res=min(res,dfs(x,d+1));
    swap(x[6],x[21]);
    swap(x[7],x[22]);
    swap(x[8],x[23]);
    swap(x[9],x[11]);
    swap(x[12],x[17]);
    swap(x[0],x[29]);
    swap(x[1],x[28]);
    swap(x[2],x[27]);
    swap(x[14],x[15]);
    swap(x[18],x[20]);
    res=min(res,dfs(x,d+1));
    swap(x[0],x[29]);
    swap(x[1],x[28]);
    swap(x[2],x[27]);
    swap(x[14],x[15]);
    swap(x[18],x[20]);
    swap(x[0],x[29]);
    swap(x[3],x[26]);
    swap(x[6],x[23]);
    swap(x[17],x[15]);
    swap(x[9],x[20]);
    res=min(res,dfs(x,d+1));
    swap(x[0],x[29]);
    swap(x[3],x[26]);
    swap(x[6],x[23]);
    swap(x[17],x[15]);
    swap(x[9],x[20]);
    swap(x[2],x[27]);
    swap(x[5],x[24]);
    swap(x[8],x[21]);
    swap(x[11],x[18]);
    swap(x[12],x[14]);
    res=min(res,dfs(x,d+1));
    return res;
}
int main(void){
    cin>>n;
    while(n){
        int r[30];
        for(int i=0;i<30;i++)cin>>r[i];
        cout<<dfs(r,0)<<endl;
        n--;
    }
}



Compiler output:
a.cc:7:19: error: 'd' has not been declared
    7 | int dfs(int x[30],d){
      |                   ^
a.cc: In function 'int dfs(int*, int)':
a.cc:8:98: error: 'd' was not declared in this scope
    8 |     if(x[0]==x[1]&&x[1]==x[2]&&x[3]==x[4]&&x[4]==x[5]&&x[5]==x[6]&&x[6]==x[7]&&x[7]==x[8])return d;
      |                                                                                                  ^
a.cc:9:8: error: 'd' was not declared in this scope
    9 |     if(d==8)return 8;
      |        ^
a.cc:16:23: error: 'd' was not declared in this scope
   16 |     res=min(res,dfs(x,d+1));
      |                       ^
Language: C

#define rep(i,n) for(i=0;i<n;++i) a[1<<18],v[1<<18][3],n,m,q,c,i,j;main(){scanf("%d%d%d",&n,&m,&q);rep(i,n)rep(j,2)v[i][j]=(i+n+1-2*j)%n;rep(i,m){scanf("%d",a+i);rep(j,a[i])c=v[c][a[i]&1];v[c][2]=1;rep(j,2)v[v[c][j^1]][j]=v[c][j];c=v[c][0];}rep(i,q)scanf("%d",&c),printf("%d\n",1-v[c][2]);exit(0);}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <set>
#include <stdio.h>
#include <iterator>
using namespace std;
int main(){
    int n,m,q,temp;
    set<int>s;
    set<int>::iterator now;
    scanf("%d%d%d",&n,&m,&q);
    for(int i=0;i<n;i++)s.insert(i);
    now=s.find(0);
    for(int i=0;i<m;i++){
        scanf("%d",&temp);
        if(temp&1){
            while(temp){
                 while(now!=s.end()){
                    now++;
                    temp--;
                }
                if(now==s.end())now=s.begin();
            }
        }
        else{
            while(temp){
                while(now!=s.begin()){
                    now--;
                    temp--;
                }
                if(now==s.begin())now=s.end();
            }
            if(now=s.end());
            now=s.begin();
        }
        temp=*now;
        s.erase(now);
        now=s.lower_bound(temp);
    }
    while(q--){
        scanf("%d",&temp);
        if(s.find(temp)==s.end())printf("0\n");
        else printf("1\n");
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:19: error: could not convert '(now = s.std::set<int>::end())' from 'std::set<int>::iterator' {aka 'std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator'} to 'bool'
   31 |             if(now=s.end());
      |                ~~~^~~~~~~~
      |                   |
      |                   std::set<int>::iterator {aka std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator}
Language: C++

#include <cstdio>
#include <iostream>
#include <stdlib.h>
#include <iomanip>
#include <string> 
#include <sstream>  
#include <vector> 
using namespace std;

int main(){
    int N,M,Q;
    cin >> N >> M >> Q;
    int player[N + 1],anser = 0;
    for(int i = 0;N > i;i++){player[i] = 1;}
    for(int i = 0;M > i;i++){
        //cout << "[anser]" << anser << endl;
        int a,c = 0;
        cin >> a;
        int daturakusya;
        if(a % 2 == 0){
            while(a > 0){               
                while(true){
                    anser++;
                    if(anser > N - 1){anser = 0;}
                    if(player[anser] == 1){daturakusya = anser;break;}h
                }
                a--;
            }
        }else{
            while(a > 0){          
                while(true){
                    anser--;  
                    if(anser < 0){anser = N - 1;}
                    if(player[anser] == 1){daturakusya = anser;break;}     
                }
                a--;
            }
        }
        player[daturakusya] = 0;
        //cout << "[daturakusya]" << daturakusya << endl;

        while(true){
            daturakusya++;
            if(daturakusya > N - 1){daturakusya = 0;}
            if(player[daturakusya] == 1){
                anser = daturakusya; 
                break;  
            }
        }
        
    }
    for(int i = 0;Q > i;i++){
        int q;
        cin >> q;
        cout << player[q] << endl;
    }
}  

Compiler output:
a.cc: In function 'int main()':
a.cc:25:71: error: 'h' was not declared in this scope
   25 |                     if(player[anser] == 1){daturakusya = anser;break;}h
      |                                                                       ^