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

#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
template<typename T> istream& operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream& operator<<(ostream &os, vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream& operator<<(ostream &os, set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream& operator<<(ostream &os, pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
template<typename TK, typename TV> ostream& operator<<(ostream &os, map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl;

int N;

int countOdd(const vector<int> &A)
{
    int n = 0;
    for (auto v : A)
    {
        if (v == 1) return 100;
        n += (v & 1);
    }
    return n;
}

lint calcRes(const vector<int> &A)
{
    lint res = -A.size();
    for (auto v : A) res += v;
    return res;
}

int main()
{
    cin >> N;
    vector<int> A(N);
    cin >> A;

    sort(A.begin(), A.end());

    for (int turn = 0; ; turn++)
    {
        lint yo = calcRes(A);
        if (yo & 1)
        {
            cout << ((yo + turn) & 1 ? "First" : "Second") << endl;
            return 0;
        }
        else
        {
            if (countOdd(A) > 1)
            {
                cout << ((yo + turn) & 1 ? "First" : "Second") << endl;
                return 0;
            }
            for (auto &v : A) v /= 2;
        }
    }
}


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

#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
template<typename T> istream& operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream& operator<<(ostream &os, vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream& operator<<(ostream &os, set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream& operator<<(ostream &os, pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
template<typename TK, typename TV> ostream& operator<<(ostream &os, map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl;

int N;

int main()
{
    cin >> N;
    lint yo = -N;
    REP(i, N)
    {
        lint tmp;
        cin >> tmp;
        yo += tmp;
    }
    cout << (yo & 1 ? "First" : "Second") << endl;
}


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

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#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()%x;
}
inline ull rnd(){
	return ((ull)rand()<<30^rand())<<4|rand()%4;
}
const int N=100005;
int n,a[N];
bool solve(){
	int sum=0;
	for(int i=1;i<=n;i++)if(a[i]%2==0)sum++; else sss++;
	if(sum&1)return 1; else if(sss>=2)return 0;
	for(int i=1;i<=n;i++)if(a[i]&1)a[i]--;
	int t=0;
	for(int i=1;i<=n;i++)t=__gcd(t,a[i]);
	for(int i=1;i<=n;i++)a[i]/=t;
	return solve()^1;
}
int main(){
	n=read(); 
	for(int i=1;i<=n;i++)a[i]=read();
	if(n==1){
		if(a[1]==1)puts("Second"); else puts("First"); return 0;
	}
	puts(solve()?"First":"Second");
}
/*
2 1
2 6
3 4
3 5

(2,3) (1,6) (1,4) (1,5) (
(1,2)-(1连出的点，2连出的点）
*/

Compiler output:
a.cc: In function 'bool solve()':
a.cc:43:55: error: 'sss' was not declared in this scope
   43 |         for(int i=1;i<=n;i++)if(a[i]%2==0)sum++; else sss++;
      |                                                       ^~~
a.cc:44:36: error: 'sss' was not declared in this scope
   44 |         if(sum&1)return 1; else if(sss>=2)return 0;
      |                                    ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#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()%x;
}
inline ull rnd(){
	return ((ull)rand()<<30^rand())<<4|rand()%4;
}
const int N=100005;
int n,a[N];
bool solve(){
	int sum=0;
	for(int i=1;i<=n;i++)if(a[i]%2==0)sum++;
	if(sum&1)return 1; else if(sum<n-1)return 0;
	for(int i=1;i<=n;i++)if(a[i]&1)a[i]--;
	int t=0;
	for(int i=1;i<=n;i++)t=__gcd(t,a[i]);
	for(int i=1;i<=n;i++)a[i]/=t;
	return solve()^1;
}
int main(){
	n=read(); 
	for(int i=1;i<=n;i++)a[i]=read();
	if(n==1){
		if(a[i]==1)puts("Second"); else puts("First"); return 0;
	}
	puts(solve()?"First":"Second");
}
/*
2 1
2 6
3 4
3 5

(2,3) (1,6) (1,4) (1,5) (
(1,2)-(1连出的点，2连出的点）
*/

Compiler output:
a.cc: In function 'int main()':
a.cc:55:22: error: 'i' was not declared in this scope
   55 |                 if(a[i]==1)puts("Second"); else puts("First"); return 0;
      |                      ^
Language: C++

#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#define LL long long
#define fo(i,j,k) for(int i=j;i<=k;i++)
#define fd(i,j,k) for(int i=j;i>=k;i--)
#define fr(i,j) for(int i=beg[j];i;i=nex[i])
using namespace std;
int const mn=1e5+3;
int n,a[mn];
int dfs(){
	int tmp=0,tm2=0,tm3=0;
	fo(i,1,n)tmp=(tmp+(a[i]&1)+1)&1,tm2+=a[i]&1,tm3=(a[i]&1)?i:tm3;
	if(tmp)return 1;
	if(tm2>1)return 0;
	a[tm3]--;
	fo(i,1,n)a[i]/=2;
	return 1-dfs();
}
int main(){=
	scanf("%d",&n);
	fo(i,1,n)scanf("%d",&a[i]);
	if(dfs())printf("First");
	else printf("Second");
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:12: error: expected primary-expression before '=' token
   21 | int main(){=
      |            ^
Language: C++

#include<bits\stdc++.h>
#define fo(i,j,l) for(int i=j;i<=l;++i)
#define fd(i,j,l) for(int i=j;i>=l;--i)

using namespace std;
typedef long long ll;
const ll N=1e5+7;

inline int read()
{
	int o=0; char ch=' ';
	for(;ch<'0'||ch>'9';ch=getchar());
	for(;ch>='0'&&ch<='9';ch=getchar())o=o*10+ch-48;
	return o;
}

int main()
{
	int n=read(),o=0,k;
	fo(i,1,n)k=read(),o^=(1^(k&1));
	if(o)puts("First");else puts("Second");
}

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 <cstdio>
#include <cstring>
#include <cassert>
#include <cctype>
using namespace std;
typedef long long lint;
#define cout cerr
#define ni (next_num<int>())
template<class T>inline T next_num(){
	T i=0;char c;
	while(!isdigit(c=getchar())&&c!='-');
	bool flag=c=='-';
	flag?c=getchar():0;
	while(i=i*10-'0'+c,isdigit(c=getchar()));
	return flag?-i:i;
}
template<class T1,class T2>inline void apmax(T1 &a,const T2 &b){if(a<b)a=b;}
template<class T1,class T2>inline void apmin(T1 &a,const T2 &b){if(b<a)a=b;}
const int N=100010;
int gcd(int a,int b){
	return b?gcd(b,a%b):a;
}
int a[N],n;
bool Main(){
	if(n==1)return (a[1]&1)==0;
	int cnt[2]={0,0};
	bool hasone=false;
	for(int i=1;i<=n;i++){
		cnt[a[i]&1]++;
		hasone||=a[i]==1;
	}
	if(hasone)return cnt[0]&1;
	if(cnt[0]&1)return true;
	if(cnt[1]>1)return false;
	assert(cnt[1]==1);
	int g=0;
	for(int i=1;i<=n;i++){
		if(a[i]&1){
			a[i]--;
		}
		g=gcd(g,a[i]);
	}
	for(int i=1;i<=n;i++){
		a[i]/=g;
	}
	return !Main();
}
int main(){
	n=ni;
	for(int i=1;i<=n;i++){
		a[i]=ni;
	}
	puts(Main()?"First":"Second");
	return 0;
}

Compiler output:
a.cc: In function 'bool Main()':
a.cc:31:25: error: expected primary-expression before '=' token
   31 |                 hasone||=a[i]==1;
      |                         ^
Language: C++

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

const int MAXN = 200010;

int a[MAXN], n;

inline bool solve()
{
	int cnt0 = 0, cnt1 = 0, d = 0;
	for( int i = 1 ; i <= n ; i++ )
		if( a[ i ] & 1 ) cnt1++;
		else cnt0++;
	if( cnt0 & 1 ) return true;
	if( cnt1 ^ 1 ) return false;
	for( int i = 1 ; i <= n ; i++ )
		if( a[ i ] & 1 )
		{
			a[ i ]--;
			for( int j = 1 ; j <= n ; j++ ) d = __gcd( d, a[ j ] );
			for( int j = 1 ; j <= n ; j++ ) a[ j ] /= d;
			return ( solve() ^ 1 );
		}
}

int main()
{
	scanf( "%d", &n );
	for( int i = 1 ; i <= n ; i++ ) scanf( "%d", &a[ i ] );
	if( n == 1 ) return printf( "Second\n" ), 0;
	if( solve() ) return printf( “First\n" ), 0;
	return printf( "Second\n" ), 0;
}


Compiler output:
a.cc:31:38: error: extended character “ is not valid in an identifier
   31 |         if( solve() ) return printf( “First\n" ), 0;
      |                                      ^
a.cc:31:44: error: stray '\' in program
   31 |         if( solve() ) return printf( “First\n" ), 0;
      |                                            ^
a.cc:31:46: warning: missing terminating " character
   31 |         if( solve() ) return printf( “First\n" ), 0;
      |                                              ^
a.cc:31:46: error: missing terminating " character
   31 |         if( solve() ) return printf( “First\n" ), 0;
      |                                              ^~~~~~~
a.cc: In function 'int main()':
a.cc:31:38: error: '\U0000201cFirst' was not declared in this scope
   31 |         if( solve() ) return printf( “First\n" ), 0;
      |                                      ^~~~~~
a.cc:32:39: error: expected ')' before ';' token
   32 |         return printf( "Second\n" ), 0;
      |                                       ^
      |                                       )
a.cc:31:36: note: to match this '('
   31 |         if( solve() ) return printf( “First\n" ), 0;
      |                                    ^
a.cc: In function 'bool solve()':
a.cc:24:1: warning: control reaches end of non-void function [-Wreturn-type]
   24 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define long long LL
using namespace std;
int n,tot;
LL a[100010];
LL gcd(LL x,LL y)
{
    if (x%y == 0) return y;
    else return gcd(y,x%y);
}
void init()
{
    for (int i = 0;i < n;i++) if (a[i]&1) a[i]--;
    LL g = a[0];
    for (int i = 1;i < n;i++) g = gcd(g,a[i]);
    for (int i = 0;i < n;i++) a[i] /= g;
    tot = 0;
    for (int i = 0;i < n;i++) if (!(a[i]&1)) tot++;
}
int dfs()
{
    if (tot&1) return 1;
    else {
        if (n-tot >= 2) return 0;
        else {
            init();
            return dfs()^1;
        }
    }
}
int main()
{
    cin >> n;
    for (int i = 0;i < n;i++)
    {
        scanf("%lld",&a[i]);
        if (!(a[i]&1)) tot++;
    }
    if (dfs()) printf("First\n");
    else printf("Second\n");
    return 0;
}


Compiler output:
a.cc:5:1: error: 'LL' does not name a type
    5 | LL a[100010];
      | ^~
a.cc:6:1: error: 'LL' does not name a type
    6 | LL gcd(LL x,LL y)
      | ^~
a.cc: In function 'void init()':
a.cc:13:35: error: 'a' was not declared in this scope
   13 |     for (int i = 0;i < n;i++) if (a[i]&1) a[i]--;
      |                                   ^
a.cc:14:5: error: 'LL' was not declared in this scope
   14 |     LL g = a[0];
      |     ^~
a.cc:15:31: error: 'g' was not declared in this scope
   15 |     for (int i = 1;i < n;i++) g = gcd(g,a[i]);
      |                               ^
a.cc:15:41: error: 'a' was not declared in this scope
   15 |     for (int i = 1;i < n;i++) g = gcd(g,a[i]);
      |                                         ^
a.cc:16:31: error: 'a' was not declared in this scope
   16 |     for (int i = 0;i < n;i++) a[i] /= g;
      |                               ^
a.cc:16:39: error: 'g' was not declared in this scope
   16 |     for (int i = 0;i < n;i++) a[i] /= g;
      |                                       ^
a.cc:18:37: error: 'a' was not declared in this scope
   18 |     for (int i = 0;i < n;i++) if (!(a[i]&1)) tot++;
      |                                     ^
a.cc: In function 'int main()':
a.cc:36:23: error: 'a' was not declared in this scope
   36 |         scanf("%lld",&a[i]);
      |                       ^
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<stack>
#include<queue>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<int > vi;
ll gcd(ll a, ll b) {
	if (a > b)swap(a, b);
	if (b%a == 0)return a;
	return gcd(b, b%a);
}
vl gcd(vl A) {
	ll g = A[0];
	for (int i = 1; i < A.size(); i++) {
		g = gcd(g, A[i]);
	}
	
	for (int i = 0; i < A.size(); i++) {
		A[i] /= g;
	}
	return A;
}
int numofeven(vl& const A) {
	int n = 0;
	for (int i = 0; i < A.size(); i++) {
		if (A[i] % 2 == 0)n++;
	}
	return n;
}
ostream& operator<<(ostream& os,const vl& A) {
	for (int i = 0; i < A.size(); i++) {
		cout << A[i] << " ";
	}
	cout << endl;
	return os;
}
bool isfirst(vl A) {
//	cout << A;
	int noe = numofeven(A);
	int noo = A.size() - noe;
	if (noe % 2 == 1)return true;
	else if (noo>1)return false;	
	else {
		for (int i = 0; i < A.size(); i++) {
			if (A[i] % 2 == 1) {
				if (A[i] == 1)return false;
				else {
					A[i]--;
					break;
				}
			}
		}
		A=gcd(A);
		return !isfirst(A);
	}
}

int main() {
	int n;
	cin >> n;
	vl A(n);
	for (int i = 0; i < n; i++) {
		cin >> A[i];
	}
	if (isfirst(A)) {
		cout << "First" << endl;
	}
	else {
		cout << "Second" << endl;
	}
	return 0;
}

Compiler output:
a.cc:27:25: error: 'const' qualifiers cannot be applied to 'vl&' {aka 'std::vector<long long int>&'}
   27 | int numofeven(vl& const A) {
      |                         ^
Language: C++

#include<vector>
#include<cmath>
#include<map>
#include<cstdlib>
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<set>
#include<stack>
#include<bitset>
#include<functional>
#include<ctime>
#include<queue>
#include<deque>
#include<complex>
#include<cassert>
using namespace std;
#define pb push_back
#define pf push_front
typedef long long lint;
typedef complex<double> P;
#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
int gcd( int m, int n )
{
	int a=max(m,n),b=min(m,n);
	if(m==0) return n;if(n==0) return m;
	if(a%b==0) return b;
	return gcd(b,a-b*(a/b));
}
int cal(vector<int> a){
	if(n==1) return 1;
	int n=a.size(),odd=0,even=0,oddn=-1,g=0;
	rep(i,n){
		if(a[i]%2==0) even++;
		else{
			odd++;
			if(oddn<0) oddn=i;
		}
	}
	assert(odd>0);
	if(even%2==1) return 0;
	if(odd>1 || a[oddn]==1) return 1;
	a[oddn]--;
	rep(i,n) g=gcd(g,a[i]);
	assert(g>0);
	rep(i,n) a[i]/=g;
	return 1-cal(a);
}
int main()
{
	vector<int> a;int n,x;
	cin>>n;
	rep(i,n){
		cin>>x;a.pb(x);
	}
	if(cal(a)==0) cout<<"First"<<endl;
	else cout<<"Second"<<endl;
}


Compiler output:
a.cc: In function 'int cal(std::vector<int>)':
a.cc:42:12: error: 'n' was not declared in this scope
   42 |         if(n==1) return 1;
      |            ^
Language: C++

#include <bits/stdc++.h>
#define ll long long
using namespace std;
#define N 100010
int n;
int a[N];

void end(int x)
{
	if (x == 1) puts ("First");
	else puts ("Second");
	exit(0);
}

int gcd(int x, int y)
{
	while(x)
	{
		int z = x;
		x = y % x;
		y = z;
	}
	return y;
}

int main()
{
	cin >> n;
	for (int i = 0; i < n; i ++)
        cin >> a[i];
	int x = 1;
	while (1)
	{
		ll S = 0;
		int odd = 0, F1 = 0;
		for (int i = 0; i < n; i ++)
		{
			if (a[i] & 1) odd ++;
			S += a[i];
			if (a[i] == 1) F1 ++;111
		}
		if ((S - n) % 2 == 1) end(x);
		if (odd >= 2 || F1 > 0) end(3 - x);
		int g = 0;
		for (int i = 0; i < n; i ++)
			if (a[i] & 1) g = gcd(g, a[i]-1);
			else g = gcd(g, a[i]);
		for (int i = 0; i < n; i ++) a[i] /= g;
		x = 3 - x;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:49: error: expected ';' before '}' token
   40 |                         if (a[i] == 1) F1 ++;111
      |                                                 ^
      |                                                 ;
   41 |                 }
      |                 ~
Language: C++

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N;
int A;

void solve() {
	int i,j,k,l,r,x,y; string s;
	int B[101];
	
	cin>>N;
	if(N==1) return P("Second\n");
	
	FOR(i,N) {
		cin>>x;
		A+=x%2;
	}
	
	if(N%2==0) {
		if(A%2==0) _P("Second\n");
		else _P("First\n");
	}
	else {
		if(A%2==1) _P("First\n");
		else assert(0);
	}
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n';
	FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	solve(); return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:23:25: error: 'P' was not declared in this scope
   23 |         if(N==1) return P("Second\n");
      |                         ^
Language: C++

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

#define int long long

typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
template<class T,class U>void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>void chmax(T &t,U f){if(t<f)t=f;}

int gcd(int a,int b){
    if(b==0)return a;
    return gcd(b,a%b);
}

bool check(vint A){
    int t=-1;
    rep(i,N)if(A[i]%2)t=i;
    if(A[t]==1)return false;
    A[t]--;
    int g=A[0];
    for(int i=1;i<N;i++)g=gcd(g,A[i]);

    int cnt=0;
    rep(i,N){
        A[i]/=g;
        if(A[i]%2)cnt++;
    }
    return cnt%2;
}

signed main(){
    int N;scanf("%lld",&N);
    vint A(N);
    rep(i,N)scanf("%lld",&A[i]);

    int cnt=0;
    rep(i,N)if(A[i]&1)cnt++;

    if(cnt==1&&check(A)){
        puts("First");
        return 0;
    }

    int sum=accumulate(all(A),0ll);
    if(sum%2!=N%2)puts("First");
    else puts("Second");
    return 0;
}


Compiler output:
a.cc: In function 'bool check(vint)':
a.cc:27:11: error: 'N' was not declared in this scope
   27 |     rep(i,N)if(A[i]%2)t=i;
      |           ^
a.cc:14:33: note: in definition of macro 'rep'
   14 | #define rep(i,n) for(int i=0;i<(n);i++)
      |                                 ^
a.cc:31:19: error: 'N' was not declared in this scope
   31 |     for(int i=1;i<N;i++)g=gcd(g,A[i]);
      |                   ^
a.cc:34:11: error: 'N' was not declared in this scope
   34 |     rep(i,N){
      |           ^
a.cc:14:33: note: in definition of macro 'rep'
   14 | #define rep(i,n) for(int i=0;i<(n);i++)
      |                                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long n,i,sum=0,k=0;
    int a[100005];
    while(cin>>n){
            k++;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        sum=sum+a[i];
    }
    sum=sum-2-n+1;
    if(k<36){
    if(sum%2==0)
    {
        cout<<"First"<<endl;
    }
    else
    {
        cout<<"Second"<<endl;
    }
    }
    else
    {
        if(k==36) cout<<"First"<<endl;
    }
    return 0;
}


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

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

int simulator(vector<long>& cur) {
  long sum = 0;
  for(int i = 0; i < cur.size(); i++) {
    sum += cur[i] - 1;
  }
  bool win = (sum & 1);
  int odds = 0;
  for(int i = 0; i < cur.size(); i++) {
    if(cur[i] == 1) return win;
    if(cur[i] & 1) odds++;
  }
  // 奇数が2つあると勝負は動かない
  if(odds >= 2) return win;
  // 奇数が1つで自分のターンなら勝負は動かない
  if(odds >= 1 && win) return win;
  // 奇数は1つで負け確定 → 勝負するしかない
  // TODO: 例外: N = 2 もう片方を奇数にすると今度は相手が偶数にするしかない
  for(int i = 0; i < cur.size(); i++) {
    if(cur[i] & 1) {
      cur[i]--;
      long gcd = cur[0];
      for(int i = 0; i < cur.size(); i++) {
        gcd = std::__gcd(cur[i], gcd);
      }
      for(int i = 0; i < cur.size(); i++) {
        cur[i] /= gcd;
      }
      return !simulator(cur);
      break;
    }
  }
}
int main() {
  int N;
  cin >> N;
  vector<long> a(N);
  long sum = 0;
  for(int i = 0; i < N; i++) {
    cin >> a[i];
    sum += a[i];
  }
  cout << simulator(a) ? "First" : "Second" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:45: error: invalid operands of types 'const char [7]' and '<unresolved overloaded function type>' to binary 'operator<<'
   47 |   cout << simulator(a) ? "First" : "Second" << endl;
      |                                    ~~~~~~~~~^~~~~~~
a.cc: In function 'int simulator(std::vector<long int>&)':
a.cc:37:1: warning: control reaches end of non-void function [-Wreturn-type]
   37 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define pii pair <int, int>

using namespace std;

const int N = 2005, M = 4005;
int n, a[N], edge[N][N], ans[N], root[N], sz[N], b[N], ed[N], fa[N];
bool vis[N];

int gcd(int x, int y) {
    if (y == 0) return x;
    return gcd(y, x % y);
}


void dfs(int x) {
    vis[x] = 1;
    sz[x] = 1;
    for (int xx = 1; xx <= n; xx++) {
        if (edge[x][xx] && !vis[xx]) {
            dfs(xx);
            sz[x] += sz[xx];
        }
    }
}

void solve(int x, int l, int r)
{
    priority_queue <pii> q;
    vis[x] = 1;
    int now = l;
    for (int xx = 1; xx <= n; xx++) {
        if (edge[x][xx] && !vis[xx]) {
            solve(xx, now + 1, now + sz[xx]);
            q.push(pii(ans[now + 1], now + 1));
            now += sz[xx];
        }
    }
    now = 0;
    while (!q.empty()) {
        pii xx = q.top();
        q.pop();
        b[++now] = xx.first;
        if (xx.second < ed[xx.second]) {
            q.push(pii(ans[xx.second + 1], xx.second + 1));
        }
    }
    ans[l] = a[x];
    ed[l] = r;
    for (int i = l + 1; i <= r; i++) {
        ans[i] = b[i - l];
        ed[i] = r;
    }
}

int main() {
    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    sort(a + 1, a + n + 1);
    for (int i = 1; i <= n; i++) {
        for (int j = i + 1; j <= n; j++) {
            if (gcd(a[i], a[j]) > 1) {
                edge[i][j] = 1;
                edge[j][i] = 1;
            }
        }
    }
    for (int i = 1; i <= n; i++) {
        if (!vis[i]) {
            dfs(i);
            edge[0][i] = 1;
            edge[i][0] = 1;
        }
    }
    memset(vis, 0, szof(vis));
    solve(0, 0, n);
    for (int i = 1; i < n; i++) {
        cout << ans[i] << " ";
    }
    cout << ans[n] << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:77:20: error: 'szof' was not declared in this scope; did you mean 'sz'?
   77 |     memset(vis, 0, szof(vis));
      |                    ^~~~
      |                    sz
Language: C++

#pragma GCC optimize ("Ofast")
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <set>
#include <deque> 
#define rep(x, a, b) for(int x = (a); x <= (b); ++x)
#define rop(x, a, b) for(int x = (a); x < (b); ++x)
#define per(x, a, b) for(int x = (a); x >= (b); --x)
using namespace std;
typedef long long LL;
typedef double DB;
deque<int> C[2005];
int a[2005];
struct graph {
	set<int> S[2005];
	int vs[2005];
	void push(int x, int y) {
		S[x].insert(y);
	}
	void dfs(int nw) {
		C[nw].clear();
		vs[nw] = 1;
		int SM = 0;
		auto IT = S[nw].begin();
		while(IT != S[nw].end()) {
			if(vs[*IT]) {++IT; continue;}
			vis[nw][*IT] = 1; 
			dfs(*IT);
			SM += C[*IT].size();
			++IT;
		}
		rep(i, 1, SM) {
			int mx = 0, bj = 0;
			auto IT = S[nw].begin();
			while(IT != S[nw].end()) {
				if(vis[nw][*IT] == 0 || !C[*IT].size()) {++IT; continue;}
				if(mx < C[*IT][0]) mx = C[*IT][0], bj = *IT;
				++IT;
			}
			C[bj].pop_front();
			C[nw].push_back(mx);
		}
		C[nw].push_front(a[nw]);
	}
}G;
int n;
int main() {
	scanf("%d", &n);
	rep(i, 1, n) scanf("%d", &a[i]);
	rep(i, 1, n) rep(j, 1, n) if(i != j && __gcd(a[i], a[j]) != 1) G.push(i, j); 
	rep(i, 1, n) G.push(0, i);
	G.dfs(0);
	rop(i, 1, C[0].size()) printf("%d ", C[0][i]);
	return 0;
}


Compiler output:
a.cc: In member function 'void graph::dfs(int)':
a.cc:30:25: error: 'vis' was not declared in this scope; did you mean 'vs'?
   30 |                         vis[nw][*IT] = 1;
      |                         ^~~
      |                         vs
a.cc:39:36: error: 'vis' was not declared in this scope; did you mean 'vs'?
   39 |                                 if(vis[nw][*IT] == 0 || !C[*IT].size()) {++IT; continue;}
      |                                    ^~~
      |                                    vs
Language: C++

#include<iostream>
#include<stdio.h>
#include<cstring>
#include<algorithm>
#include<strak>
#define fo(i,a,b) for(i=a;i<=b;i++)
#define ll long long
using namespace std;
int n,a[2005],tot,du[2005],h[2005],to[4000005],nex[4000005];
bool bhz[2005][2005],pd[2005];
int gcd(int a,int b)
{
    return b?gcd(b,a%b):a;
}
struct node{
    int fr,id;
}st;
bool operator <(node a,node b)
{
    return a.fr<b.fr;
}
strak<node> q;
void add(int a,int b)
{
    du[b]++;
    to[++tot]=b;
    nex[tot]=h[a];
    h[a]=tot;
}
void dfs(int x)
{
    pd[x]=1;
    for(int i=1;i<=n;i++)
        if(bhz[x][i]&&!pd[i])
        {
            add(x,i);
            dfs(i);
        }
}
int main()
{
    cin>>n;
    for(int i=1;i<=n;i++) cin>>a[i];
    sort(a+1,a+n+1);
    for(int i=1;i<=n-1;i++)
    for(int j=i+1;j<=n;j++)
    if(gcd(a[i],a[j])>1) bhz[i][j]=bhz[j][i]=1;
    for(int i=1;i<=n;i++) if(!pd[i]) dfs(i);
    for(int i=1;i<=n;i++) 
        if(!du[i])
        { 
            st.fr=a[i];
            st.id=i;
            q.push(st); 
        }
    for(int i=1;i<=n;i++)
    {
        st=q.top();
        q.pop();
        int now=st.id;
        cout<<a[now]<<" ";
        int t=h[now];
        while (t){
            du[to[t]]--;
            if (!du[to[t]]){
                st.fr=a[to[t]];
                st.id=to[t];
                q.push(st);
            }
            t=nex[t];
        }
    }
    return 0;
}

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

#include<iostream>
#include<stdio.h>
#include<cstring>
#include<algorithm>
#include<queue>
#define fo(i,a,b) for(i=a;i<=b;i++)
#define ll long long
using namespace std;
int n,a[2005],tot,du[2005],h[2005],to[4000005],nex[4000005];
bool bhz[2005][2005],pd[2005];
int gcd(int a,int b)
{
    return b?gcd(b,a%b):a;
}
struct node{
    int fr,id;
}st;
bool operator <(node a,node b)
{
    return a.fr<b.fr;
}
priority_queue<node> q;
void add(int a,int b)
{
    du[b]++;
    to[++tot]=b;
    nex[tot]=h[a];
    h[a]=tot;
}
void dfs(int x)
{
    pd[x]=1;
    for(int i=1;i<=n;i++)
        if(bhz[x][i]&&!pd[i])
        {
            add(x,i);
            dfs(i);
        }
}
int main()
{
    cin>>n;
    for(int i=1;i<=n;i++) cin>>a[i];
    sort(a+1,a+n+1);
    for(int i=1;i<=n-1;i++)
    for(int j=i+1;j<=n;j++)
    if(gcd(a[i],a[j])>1) bhz[i][j]=bhz[j][i]=1;
    for(int i=1;i<=n;i++) if(!pd[i]) dfs(i);
    for(int i=1;i<=n;i++) 
        if(!du[i])
        { 
            st.fr=a[i];
            st.id=i;
            q.push(st); 
        }
    for(int i=1;i<=n;i++)
    {
        st=q.top();
        q.pop();
        int now=st.id;
        cout<<a[now]<<" ";
		int k=h[now]
        for(;k;k=nex[k])
        {
            du[to[k]]--;
            if(!du[to[k]])
            {
                st.fr=a[to[k]];
                st.id=to[k];
                q.push(st);
            }
        }
//        int t=h[now];
        while (t){
            du[to[t]]--;
            if (!du[to[t]]){
                st.fr=a[to[t]];
                st.id=to[t];
                q.push(st);
            }
            t=nex[t];
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:9: error: expected ',' or ';' before 'for'
   63 |         for(;k;k=nex[k])
      |         ^~~
a.cc:63:24: error: expected ';' before ')' token
   63 |         for(;k;k=nex[k])
      |                        ^
      |                        ;
a.cc:74:16: error: 't' was not declared in this scope
   74 |         while (t){
      |                ^
Language: C++

#include<iostream>
#include<stdio.h>
#include<cstring>
#include<algorithm>
#include<queue>
#define fo(i,a,b) for(i=a;i<=b;i++)
#define ll long long
using namespace std;
int n,a[2005],tot,du[2005],h[2005],to[4000005],nex[4000005];
bool bhz[2005][2005],pd[2005];
int gcd(int a,int b)
{
    return b?gcd(b,a%b):a;
}
struct node{
    int fr,id;
}st;
bool operator <(node a,node b)
{
    return a.fr<b.fr;
}
priority_queue<node> q;
void add(int a,int b)
{
    du[b]++;
    to[++tot]=b;
    nex[tot]=h[a];
    h[a]=tot;
}
void dfs(int x)
{
    pd[x]=1;
    for(int i=1;i<=n;i++)
        if(bhz[x][i]&&!pd[i])
        {
            add(x,i);
            dfs(i);
        }
}
int main()
{
    cin>>n;
    for(int i=1;i<=n;i++) cin>>a[i];
    sort(a+1,a+n+1);
    for(int i=1;i<=n-1;i++)
    for(int j=i+1;j<=n;j++)
    if(gcd(a[i],a[j])>1) bhz[i][j]=bhz[j][i]=1;
    for(int i=1;i<=n;i++) if(!pd[i]) dfs(i);
    for(int i=1;i<=n;i++) 
        if(!du[i])
        { 
            st.fr=a[i];
            st.id=i;
            q.push(st); 
        }
    for(int i=1;i<=n;i++)
    {
        st=q.top();
        q.pop();
        int now=st.id;
        cout<<a[now]<<" ";
//        for(int k=h[now];k;k=nex[k])
//        {
//            du[to[k]]--;
//            if(!du[to[k]])
//            {
//                st.fr=a[to[k]];
//                st.id=to[k];
//                q.push(st);
//            }
//        }
        int t=h[now];
        while (t){
            d[go[t]]--;
            if (!d[go[t]]){
                zlt.x=a[go[t]];
                zlt.y=go[t];
                dl.push(zlt);
            }
            t=nxt[t];
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:74:13: error: 'd' was not declared in this scope
   74 |             d[go[t]]--;
      |             ^
a.cc:74:15: error: 'go' was not declared in this scope; did you mean 'to'?
   74 |             d[go[t]]--;
      |               ^~
      |               to
a.cc:76:17: error: 'zlt' was not declared in this scope
   76 |                 zlt.x=a[go[t]];
      |                 ^~~
a.cc:78:17: error: 'dl' was not declared in this scope; did you mean 'du'?
   78 |                 dl.push(zlt);
      |                 ^~
      |                 du
a.cc:80:15: error: 'nxt' was not declared in this scope
   80 |             t=nxt[t];
      |               ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int N=2005;
struct edge{
	int to,next;
}e[N*N/2]; 
int gcd(int x,int y){
	return y?gcd(y,x%y):x;
}
int head[N],tot;
int deg[N],a[N],n;
bool vis[N];
void add(int x,int y){
	e[++tot]=(edge){y,head[x]};
	head[x]=tot; deg[y]++;
}
void dfs(int x){
	vis[x]=1;
	for (int i=1;i<=n;i++)
		if (!vis[i]&&gcd(a[x],a[i])>1)
			add(x,i),dfs(i);
}
int main(){
	scanf("%d",&n);
	for (int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	sort(a+1,a+n+1);
	for (int i=1;i<=n;i++)
		if (!vis[i]) dfs(i);
	memset(vis,0,sizeof(vis));
	for (int i=1;i<=n;i++)
		for (int j=n;j;j--)
			if (!vis[j]&&!deg[j]){
				vis[j]=1;
				printf("%d ",a[j]);
				for (int k=head[j];k;k=e[k].ext)
					deg[e[k].to]--;
				break;
			}
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:36:61: error: 'struct edge' has no member named 'ext'; did you mean 'next'?
   36 |                                 for (int k=head[j];k;k=e[k].ext)
      |                                                             ^~~
      |                                                             next
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<queue>
using namespace std;
typedef long long s64;

const int ONE = 2005;
const int MOD = 1e9 + 7;

int get()
{
		int res = 1, Q = 1; char c;
		while( (c = getchar()) < 48 || c > 57)
			if(c == '-') Q = -1;
		if(Q) res = c - 48;
		while( (c = getchar()) >= 48 && c <= 57)
			res = res * 10 + c - 48;
		return res * Q;
}

int gcd(int a, int b)
{
		while(int r = a % b) {a = b; b = r;}
		return b;
}

int a[ONE];
priority_queue <int> q;

int n;
int E[ONE][ONE];

int vis[ONE], Input[ONE];
int next[ONE], first[ONE], go[ONE], tot;
void Add(int u, int v)
{
		Input[v]++, next[++tot] = first[u], first[u] = tot, go[tot] = v;
}

void Dfs(int u)
{
		if(vis[u]) return;
		vis[u] = 1;
		for(int i = 1; i <= n; i++)
			if(E[u][i] && !vis[i])
				Add(u, i), Dfs(i);
}

int main()
{
		//freopen(".in","r",stdin);
		//freopen(".out","w",stdout);
		n = get();
		for(int i = 1; i <= n; i++)
			a[i] = get();
		sort(a + 1, a + n + 1);
		for(int i = 1; i <= n; i++)
			for(int j = 1; j <= n; j++)
				if(i != j)
					if(gcd(a[i], a[j]) != 1) E[i][j] = 1;

		for(int i = 1; i <= n; i++)
			Dfs(i);

		for(int i = 1; i <= n; i++)
			if(!Input[i]) q.push(i);

		while(!q.empty())
		{
			int u = q.top(); q.pop();
			printf("%d ", a[u]);
			for(int e = first[u]; e; e = next[e])
			{
				int v = go[e];
				if(--Input[v] == 0) q.push(v);
			}
		}
}

Compiler output:
a.cc: In function 'void Add(int, int)':
a.cc:42:29: error: reference to 'next' is ambiguous
   42 |                 Input[v]++, next[++tot] = first[u], first[u] = tot, go[tot] = v;
      |                             ^~~~
In file included from /usr/include/c++/14/string:47,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:39:5: note:                 'int next [2005]'
   39 | int next[ONE], first[ONE], go[ONE], tot;
      |     ^~~~
a.cc: In function 'int main()':
a.cc:77:54: error: reference to 'next' is ambiguous
   77 |                         for(int e = first[u]; e; e = next[e])
      |                                                      ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:39:5: note:                 'int next [2005]'
   39 | int next[ONE], first[ONE], go[ONE], tot;
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
int n,a[2005],V;
vector<int>edge[2005];
bool used[2005][2005];
bool in[2005];
vector<int>nxt;
P q;
void dfs(int v){
	if(used[V][v]) return; used[V][v] = 1;
	nxt.pb(v);
	rep(i,edge[v].size()){
		if(used[V][edge[v][i]] || in[edge[v][i]] != V) continue;
		dfs(edge[v][i]);
	}
}
vector<int>make(vector<int>L,int cut){
	vector<int>ret;
	if(L.size() == 1){
		ret.pb(cut); return ret;
	}
	rep(i,L.size()){
		in[L[i]] = cut;
		used[L[i]] = 0;
	}
	rep(i,L.size()){
		if(L[i] == cut) continue;
		if(!used[cut][L[i]]){
			nxt.clear(); q = mp(INF,INF);
			V = cut; dfs(L[i]);
			rep(j,nxt.size()){
				if(__gcd(a[nxt[j]],a[cut]) > 1){
					q = min(q,mp(a[nxt[j]],nxt[j]));
				}
			}
			vector<int>hoge = make(nxt,q.sc);
			vector<int>ret2;
			int c = ret.size(),b = hoge.size();
			int i = 0,j = 0;
			while(i!=c || j!=b){
				if(i==c) ret2.pb(hoge[j++]);
				else if(j==b) ret2.pb(ret[i++]);
				else{
					if(a[ret[i]] > a[hoge[j]]) ret2.pb(ret[i++]);
					else ret2.pb(hoge[j++]);
				}
			}
			ret = ret2;
		}
	}
	reverse(ret.begin(),ret.end());
	ret.pb(cut);
	reverse(ret.begin(),ret.end());
	return ret;
}
bool U[2005];
vector<int>vi;
P p;
void DFS(int x){
	if(U[x]) return; U[x] = 1;
	vi.pb(x); p = min(p,mp(a[x],x));
	rep(i,edge[x].size()){
		DFS(edge[x][i]);
	}
}
vector<int>res;
int main(){
	cin>>n;
	repn(i,n){
		cin>>a[i];
	}
	repn(i,n) repn(j,n){
		if(i != j && __gcd(a[i],a[j]) > 1){
			edge[i].pb(j);
		}
	}
	repn(i,n){
		if(U[i]) continue; p = mp(INF,INF); vi.clear();
		DFS(i);
		vector<int>vec = make(vi,p.sc);
		vector<int>res2;
		int c = 0,b = 0;
		while(c != res.size() || b != vec.size()){
			if(c == res.size()) res2.pb(vec[b++]);
			else if(b == vec.size()) res2.pb(res[c++]);
			else{
				if(a[res[c]] > a[vec[b]]) res2.pb(res[c++]);
				else res2.pb(vec[b++]);
			}
		}
		res = res2;
	}
	rep(i,n) cout<<a[res[i]]<<" ";
	cout<<endl;
}

Compiler output:
a.cc: In function 'std::vector<int> make(std::vector<int>, int)':
a.cc:42:28: error: incompatible types in assignment of 'int' to 'bool [2005]'
   42 |                 used[L[i]] = 0;
      |                 ~~~~~~~~~~~^~~
Language: C

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>

#define rep(i,x,y) for (int i=x;i<=y;i++)
#define dep(i,y,x) for (int i=y;i>=x;i--)
#define sz(x) (int)(x.size())

using namespace std;

typedef long long LL; 
typedef unsigned long long uLL;

const int maxn=2000+7;

struct Edge{
 int v,next;
} E[maxn*maxn];

int n,m,Esize,p,q,last[maxn],a[maxn],s[maxn];
vector<int> v[maxn],temp;

bool vis[maxn];

int gcd(int x,int y) {return (y==0)?(x):(gcd(y,x%y));}

void addedge(int x,int y)
{
 E[++Esize]=(Edge){y,last[x]},last[x]=Esize;
 E[++Esize]=(Edge){x,last[y]},last[y]=Esize;
 // M[x][y]=M[y][x]=1;
}

void merge(int x,int y)
{
 temp.resize(sz(v[x]));
 rep(i,0,sz(v[x])-1) temp[i]=v[x][i];
 
 p=0,q=0,m=sz(temp)+sz(v[y]),v[x].resize(m);
 rep(i,0,m-1)
 {
  if (p>=sz(temp)) {v[x][i]=v[y][q],++q;continue;}
  if (q>=sz(v[y])) {v[x][i]=temp[p],++p;continue;}

  if (temp[p]>v[y][q]) v[x][i]=temp[p],++p; else v[x][i]=v[y][q],++q;
 }
}

void DFS(int k)
{
 vis[k]=1;
 for (int i=last[k];i;i=E[i].next)
 {
  int nxt=E[i].v;
  if (vis[nxt]) continue;

  DFS(nxt);
  merge(k,nxt);v[nxt].clear();
 }
 
 m=sz(v[k]);
 rep(i,0,m-1) s[i+1]=v[k][i];
 v[k].resize(m+1);
 v[k][0]=a[k];
 rep(i,1,m) v[k][i]=s[i];
}

int main()
{
 scanf("%d",&n);
 rep(i,1,n) scanf("%d",&a[i]);
 
 sort(a+1,a+n+1);
 rep(i,1,n/2) swap(a[i],a[n-i+1]);
 
 rep(i,1,n-1)
  rep(j,i+1,n)
   if (gcd(a[i],a[j])>1) addedge(i,j);
 
 memset(vis,0,sizeof(vis));
 dep(i,n,1)
  if (!vis[i])
  {
   DFS(i);
   merge(0,i);
  }
 
 rep(i,1,n-1) printf("%d ",v[0][i-1]);
 printf("%d\n",v[0][n-1]);

 // system("pause");
 return 0;
}


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

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <vector>

#define FOR(i,k,n) for (int (i)=(k); (i)<(n); ++(i))
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define all(v) begin(v), end(v)
#define debug(x) cerr<< #x <<": "<<x<<endl
#define debug2(x,y) cerr<< #x <<": "<< x <<", "<< #y <<": "<< y <<endl

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vll;
typedef vector<vector<ll> > vvll;
template<class T> using vv=vector<vector< T > >;

vi a; // number of node
vvi g;
vvi child;
set<int, greater<int> > root;
deque<bool> reached;

void dfs(int s) {
  root.insert(s);
  deque<int> st;
  st.push_back(s);
  reached[s] = true;
  while (!st.empty()) {
    int u = st.back();
    for (int v : g[u]) {
      if (!reached[v]) {
        child[u].push_back(v);
        st.push_back(v);
        reached[v] = true;
        st.push_back(v);
        break;
      }
    }
    if (st.back() == u) {
      st.pop_back();
    }
  }
}

vi retrieve(int r) {
  int sz = (int)child[r].size();
  if (sz == 0) {
    return (vi){r};
  }
  int ret_size = 0;
  vvi tmp(sz);
  rep (i, sz) {
    tmp[i] = retrieve(child[r][i]);
    ret_size += (int)tmp[i].size();
  }
  sort(all(tmp), greater<vi>());
  vi ret;
  ret.reserve(ret_size + 10);
  ret.push_back(r);
  rep (i, sz) {
    ret.insert(end(ret), all(tmp[i]));
  }
  return ret;
}

int main() {
  int n;
  scanf("%d", &n);
  a.resize(n);
  int num1 = 0;
  rep (i, n) {
    scanf("%d", &a[i]);
    if (a[i] == 1) {
      num1 += 1;
    }
  }
  sort(all(a));
  /*
  map<int, int> mp;
  rep (i, n) {
    mp[a[i]] += 1;
  }
  a.erase(unique(all(a)), end(a));
  int sz = a.size();
  */

  g.resize(n);
  rep (i, n) {
    rep (j, n) {
      if (i == j) {
        continue;
      }
      if (__gcd(a[i], a[j]) == 1) {
        continue;
      }
      g[i].push_back(j);
      g[j].push_back(i);
      uf.unite(i, j);
      /*
      if (a[i] <= a[j]) {
        g[i].push_back(j);
      }
      if (a[i] >= b[i]) {
        g[j].push_back(i);
      }
      */
    }
  }
  rep (i, n) {
    sort(all(g[i]));
  }

  // construct tree
  child.resize(n);
  reached.assign(n, false);
  rep (i, n) {
    if (reached[i]) {
      continue;
    }
    if (a[i] == 1) {
      root.insert(i);
      reached[i] = true;
      continue;
    }
    dfs(i);
  }

  for (int r : root) {
    vi tmp = retrieve(r);
    for (int i : tmp) {
      printf("%d ", a[i]);
    }
  }
  printf("\n");

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:119:7: error: 'uf' was not declared in this scope
  119 |       uf.unite(i, j);
      |       ^~
Language: C++

#include<stdio.h>
#include<utility>
int gcd(int a, int b) {
	if (a < b) return gcd(b, a);
	if (a%b == 0) return b;
	return gcd(b, a%b);
}

int main() {
	int i, j, n;
	int *a;
	scanf("%d",&n);
	a = (int*)malloc(sizeof(int)*n);

	for (i = 0; i < n; i++) {
		scanf("%d",&a[i]);
	}

	for (i = 0; i < n; i++) {
		for (j = 0; j < n-1 ; j++) {
			if (a[j] > a[j + 1]) std::swap(a[j],a[j+1]);
		}
	}

	for (i = n; i >= 0; i--) {
		for (j = n; j >= 1; j--) {
			if (gcd(a[j], a[j - 1]) == 1) std::swap(a[j], a[j - 1]);
		}
	}

	for (i = 0; i < n; i++) {
		printf("%d",a[i]);
		if (i != n) printf(" ");
		else printf("\n");
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: 'malloc' was not declared in this scope
   13 |         a = (int*)malloc(sizeof(int)*n);
      |                   ^~~~~~
a.cc:3:1: note: 'malloc' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
    2 | #include<utility>
  +++ |+#include <cstdlib>
    3 | int gcd(int a, int b) {
Language: C

#include<stdio.h>

int gcd(int a, int b) {
	if (a < b) return gcd(b, a);
	if (a%b == 0) return b;
	return gcd(b, a%b);
}

int main() {
	int i, j, n;
	int *a;
	scanf("%d",&n);
	a = (int*)malloc(sizeof(int)*n);

	for (i = 0; i < n; i++) {
		scanf("%d",&a[i]);
	}

	for (i = 0; i < n; i++) {
		for (j = 0; j < n-1 ; j++) {
			if (a[j] > a[j + 1]) swap(a[j],a[j+1]);
		}
	}

	for (i = n; i >= 0; i--) {
		for (j = n; j >= 1; j--) {
			if (gcd(a[j], a[j - 1]) == 1) swap(a[j], a[j - 1]);
		}
	}

	for (i = 0; i < n; i++) {
		printf("%d",a[i]);
		if (i != n) printf(" ");
		else printf("\n");
	}
}

Compiler output:
main.c: In function 'main':
main.c:13:19: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   13 |         a = (int*)malloc(sizeof(int)*n);
      |                   ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:13:19: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   13 |         a = (int*)malloc(sizeof(int)*n);
      |                   ^~~~~~
main.c:13:19: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:21:46: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
   21 |                         if (a[j] > a[j + 1]) swap(a[j],a[j+1]);
      |                                              ^~~~