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

#include<bits/stdc++.h>
#define fr(i1,m) for(int i1=0;i1<m;i1++)
using namespace std;
int main()
{
        long n,m;
        while(cin>>n>>m)
        {
            long a[100100],s=0,x,y,i;

            fr(i,n)
            cin>>a[i];

            for(i=1;i<n;i++)
            {
                x=a[i]+a[i-1];
                y=x-m;
                if(y>0)
                {
                    s+=y;
                    a[i]=a[i]-y;
                    a[i]=max(a[i],0);
                }
            }
            cout<<s<<"\n";
        }

        return 0;

}




Compiler output:
a.cc: In function 'int main()':
a.cc:22:29: error: no matching function for call to 'max(long int&, int)'
   22 |                     a[i]=max(a[i],0);
      |                          ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:22:29: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
   22 |                     a[i]=max(a[i],0);
      |                          ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:22:29: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   22 |                     a[i]=max(a[i],0);
      |                          ~~~^~~~~~~~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<sstream>
#include<utility>
#include<map>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<stack>
using namespace std;
typedef long long ll;
typedef pair<int,int>P;
ll N,X,A[100005];
ll res=0;
int main()
{
	scanf("%lld%lld",&N,&X);
	for(int i=0;i<N;i++)scanf("%lld",&A[i]);
	if(A[0]>=X)
	{
		res+=A[i]-(A[i]-X);
		A[0]=max(A[0]-X,0LL);
	}
	for(int i=1;i<N;i++)
	{
		if(A[i]+A[i-1]>X)
		{
			res+=(A[i]+A[i-1])-X;
			A[i]-=(A[i]+A[i-1])-X;
		}
	}
	printf("%lld\n",res);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:24: error: 'i' was not declared in this scope
   26 |                 res+=A[i]-(A[i]-X);
      |                        ^
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <algorithm>
using namespace std;
#define  inf 0x3fffffff 
int main()
{
	int i, n,x,a[110000];
	long long sum;
	while (~scanf("%d%d", &n, &x))
	{
		sum = 0;
		for (i = 1; i <= n; i++)
			scanf("%d", &a[i]);
		if (a[1] > x)
		{
			sum += a[1] - x;
			a[1] = x;
		}
		for (i = 2; i <= n; i++)
		{
			int flag = a[i] + a[i - 1] - x;
			if (flag > 0)
			{
				sum += flag;
				a[i] -= flag;
			}
		}
		printf("%lld\n",sum);
	}
	return 0;
}

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

/*
  C - Boxes and Candies
  <http://abc048.contest.atcoder.jp/tasks/arc064_a>
  [Tips]
  ・callocはヒープ領域からメモリの割り当てを行うため遅い<https://oshiete.goo.ne.jp/qa/1726895.html>
*/

#include <stdio.h>

typedef long int int int64_t;

int main(int argc, char const *argv[]) {

  int64_t N, x, a, a_next;
  int64_t i;
  int64_t cnt;

  scanf("%d %d", &N, &x);

  cnt = 0;
  a = 0;
  for( i=0; i<N; i++ ){
    scanf("%d", &a_next);
    if( (a+a_next) > x ){
      cnt += (a+a_next) - x;
      a_next = x-a;
    }
    a = a_next;
  }

  printf("%d\n", cnt);
  return 0;
}


Compiler output:
main.c:10:18: error: two or more data types in declaration specifiers
   10 | typedef long int int int64_t;
      |                  ^~~
Language: C

/*
  C - Boxes and Candies
  <http://abc048.contest.atcoder.jp/tasks/arc064_a>
  [Tips]
  ・callocはヒープ領域からメモリの割り当てを行うため遅い<https://oshiete.goo.ne.jp/qa/1726895.html>
*/

#include <stdio.h>

typedef long int int32_t

int main(int argc, char const *argv[]) {

  int32_t N, x, a, a_next;
  int32_t i;
  int32_t cnt;

  scanf("%d %d", &N, &x);

  cnt = 0;
  a = 0;
  for( i=0; i<N; i++ ){
    scanf("%d", &a_next);
    if( (a+a_next) > x ){
      cnt += (a+a_next) - x;
      a_next = x-a;
    }
    a = a_next;
  }

  printf("%d\n", cnt);
  return 0;
}


Compiler output:
main.c:10:25: error: expected ';' before 'int'
   10 | typedef long int int32_t
      |                         ^
      |                         ;
   11 | 
   12 | int main(int argc, char const *argv[]) {
      | ~~~                      
main.c: In function 'main':
main.c:14:3: error: unknown type name 'int32_t'
   14 |   int32_t N, x, a, a_next;
      |   ^~~~~~~
main.c:9:1: note: 'int32_t' is defined in header '<stdint.h>'; this is probably fixable by adding '#include <stdint.h>'
    8 | #include <stdio.h>
  +++ |+#include <stdint.h>
    9 | 
main.c:15:3: error: unknown type name 'int32_t'
   15 |   int32_t i;
      |   ^~~~~~~
main.c:15:3: note: 'int32_t' is defined in header '<stdint.h>'; this is probably fixable by adding '#include <stdint.h>'
main.c:16:3: error: unknown type name 'int32_t'
   16 |   int32_t cnt;
      |   ^~~~~~~
main.c:16:3: note: 'int32_t' is defined in header '<stdint.h>'; this is probably fixable by adding '#include <stdint.h>'
Language: C++

//I_F_A
#include "bits/stdc++.h"
using namespace std;

int main(){

	long long n,x;
	cin >> n >> x;

	long long arr[n+1];
	for(long long i=1;i<=n;i++){

		cin >> arr[i];
	}

	for(long long i=2;i<=n;i++){

		if(arr[i] + arr[i-1] > x){

			long long pr = arr[i-1];
			arr[i-1] = max(0LL,(x-arr[i-1]));
			ans = ans + abs(pr-arr[i-1]);
		}
		if(arr[i] + arr[i-1] > x){

			long long pr = arr[i];
			arr[i] = max(0LL,x-arr[i-1]);
			ans = ans + abs(pr-arr[i-1]);
		}
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   22 |                         ans = ans + abs(pr-arr[i-1]);
      |                         ^~~
      |                         abs
a.cc:28:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   28 |                         ans = ans + abs(pr-arr[i-1]);
      |                         ^~~
      |                         abs
a.cc:31:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   31 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C++

//I_F_A
#include "bits/stdc++.h"
using namespace std;

int main(){

	long long n,x;
	cin >> n >> x;

	long long arr[n+1];
	for(long long i=1;i<=n;i++){

		cin >> arr[i];
	}

	for(long long i=2;i<=n;i++){

		if(arr[i] + arr[i-1] > x){

			long long pr = arr[i-1];
			arr[i-1] = max(0LL,(x-arr[i-1]))
			ans = ans + abs(pr-arr[i-1]);
		}
		if(arr[i] + arr[i-1] > x){

			long long pr = arr[i];
			arr[i] = max(0LL,x-arr[i-1]);
			ans = ans + abs(pr-arr[i-1]);
		}
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:57: error: expected ';' before 'ans'
   21 |                         arr[i-1] = max(0LL,(x-arr[i-1]))
      |                                                         ^
      |                                                         ;
   22 |                         ans = ans + abs(pr-arr[i-1]);
      |                         ~~~                              
a.cc:28:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   28 |                         ans = ans + abs(pr-arr[i-1]);
      |                         ^~~
      |                         abs
a.cc:31:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   31 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C++

	//AGC 007-A
#define _USE_MATH_DEFINES
 
#include <iostream>
#include <cmath>
#include <stdlib.h>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cstring>
#include <numeric>
#include <string>
#include <map>
#include <sstream>
using namespace std;
 
 int main(){
 	int N, x, a[100000]
 	long ans = 0;
 	cin >> N >> x;
 	for (int i = 0; i < N; i++){
 		cin >> a[i];
 		if(a[i] > x) {
 			ans += a[i] - x;
 			a[i] = x;
 		}
 	}
 	for (int i = 0; i < N - 1; i++){
 		if(a[i]+a[i+1] > x){
 			ans += a[i] + a[i+1] - x;
 			a[i+1] -= a[i] + a[i+1] - x;
 		}
 	}
 	cout << ans << endl;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: expected initializer before 'long'
   19 |         long ans = 0;
      |         ^~~~
a.cc:22:24: error: 'a' was not declared in this scope
   22 |                 cin >> a[i];
      |                        ^
a.cc:24:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |                         ans += a[i] - x;
      |                         ^~~
      |                         abs
a.cc:29:20: error: 'a' was not declared in this scope
   29 |                 if(a[i]+a[i+1] > x){
      |                    ^
a.cc:30:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   30 |                         ans += a[i] + a[i+1] - x;
      |                         ^~~
      |                         abs
a.cc:34:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   34 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C++

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

#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);

signed main() {
	int N, x; cin >> N >> x;
	vector<int> a(N); rep(i, 0, N) { cin >> a[i]; }
	int ans = 0;
	rep(i, 1, N) {
		if (a[i - 1] + a[i] > x) {
			ans += a[i - 1] + a[i] - x;
			a[i] -= a[i - 1] + a[i] - x;
			a[i] = max(0, a[i]);
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:35: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&)'
   23 |                         a[i] = max(0, a[i]);
      |                                ~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:23:35: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'})
   23 |                         a[i] = max(0, a[i]);
      |                                ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:23:35: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   23 |                         a[i] = max(0, a[i]);
      |                                ~~~^~~~~~~~~
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
int main(){
	int n,x;
	cin >> n >> x;
	vector<int> a(n);
	for(int i=0;i<n;i++){
		cin >> a[i];
	}
	long long int ans=0;
	vector<int> b(n-1);
	for(int i=1;i<a.size();i++){
		b[i-1] = a[i-1] + a[i];
	}
	for(int i=0;i<b.size();i++){
		long long int z = max(b[i] - x,0);
		b[i]-=z;
		b[i+1]=min(b[i+1]-z,0);
		ans += z;
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:27: error: no matching function for call to 'min(long long int, int)'
   20 |                 b[i+1]=min(b[i+1]-z,0);
      |                        ~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:20:27: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   20 |                 b[i+1]=min(b[i+1]-z,0);
      |                        ~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:20:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   20 |                 b[i+1]=min(b[i+1]-z,0);
      |                        ~~~^~~~~~~~~~~~
Language: C++

#include <iostream>
#include <map>
#include <string>
using namespace std;
int main() {
	long long a[100000];
	int n, x:
	long long cnt = 0;
	cin >> n >> x;
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	for (int i = 1; i < n; ++i) {
		if (a[i] + a[i - 1] > x) {
			int tmp = a[i] + a[i - 1] - x;
			a[i] -= tmp;
			cnt += tmp;
		}
	}
	cout << cnt << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: expected initializer before ':' token
    7 |         int n, x:
      |                 ^
a.cc:9:21: error: 'x' was not declared in this scope
    9 |         cin >> n >> x;
      |                     ^
a.cc:17:25: error: 'cnt' was not declared in this scope; did you mean 'int'?
   17 |                         cnt += tmp;
      |                         ^~~
      |                         int
a.cc:20:17: error: 'cnt' was not declared in this scope; did you mean 'int'?
   20 |         cout << cnt << endl;
      |                 ^~~
      |                 int
Language: Java

class UnionFind {
	private int[] data;
	
	public UnionFind(int size) {
		data = new int[size];
		clear();
	}
	
	public UnionFind(final UnionFind uf) {
		data = uf.data.clone();
	}
	
	public void copyFrom(final UnionFind uf) {
		System.arraycopy(uf.data, 0, data, 0, data.length);
	}
	
	public void clear() {
		Arrays.fill(data, -1);
	}
	
	public int root(int x) { return data[x] < 0 ? x : (data[x] = root(data[x])); }
	
	public void union(int x, int y) {
		if((x = root(x)) != (y = root(y))) {
			if(data[y] < data[x]) { final int t = x; x = y; y = t; }
			data[x] += data[y];
			data[y] = x;
		}
	}
	
	public boolean same(int x, int y) { return root(x) == root(y); }
	public int size(int x) { return -data[root(x)]; }
}


Compiler output:
Main.java:18: error: cannot find symbol
		Arrays.fill(data, -1);
		^
  symbol:   variable Arrays
  location: class UnionFind
1 error
Language: Java

package main

import "fmt"
type long int64
func Min(x,y long) long {
 if x < y {
  return x
 }
 return y
}

func main() {
 var N,x,ans,i long
 var a [100000]long

 fmt.Scan(&N,&x)
 for i=0;i<N;i++ {
  fmt.Scan(&a[i])
 }

 for i=1;i<N;i++ {
  var diff long = a[i-1]+a[i]-x
  if diff > 0 {
   ans += diff
   min := Min(diff,a[i])
   a[i] -= min
   diff -= min
   if diff > 0 {
    a[i-1]-=diff
   }
  }
 }
 fmt.Println(ans)
}

Compiler output:
Main.java:1: error: ';' expected
package main
            ^
Main.java:3: error: <identifier> expected
import "fmt"
      ^
Main.java:17: error: class, interface, enum, or record expected
 for i=0;i<N;i++ {
         ^
Main.java:17: error: class, interface, enum, or record expected
 for i=0;i<N;i++ {
             ^
Main.java:21: error: class, interface, enum, or record expected
 for i=1;i<N;i++ {
         ^
Main.java:21: error: class, interface, enum, or record expected
 for i=1;i<N;i++ {
             ^
6 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
void test3(){
    int n,x;
    //while(cin>>n>>x){
        long long ret=0;
        cin>>n>>x;
        vector<int> a(n);
        for(int i=0;i<n;i++) cin>>a[i];
        int r=x;
        for(int i=0;i<n;i++){
            if(a[i]>r) {
                ret=ret+a[i]-r;
                //cout<<ret<<" ";
                a[i]=r;
            }
            r=x-a[i];
            //cout<<r<<" ";
        }
        coutl<<ret<<endl;
   // }
    return;
}
int main()
{
    //freopen("data","r",stdin);
    test3();
    return 0;
}


Compiler output:
a.cc: In function 'void test3()':
a.cc:20:9: error: 'coutl' was not declared in this scope
   20 |         coutl<<ret<<endl;
      |         ^~~~~
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int main() {
	long long n, x, a[100005], ans = 0;

	cin >> n >> x >> a[0];
	for (int i = 1; i < n; ++i) {
		cin >> a[i];
		int d = a[i] + a[i - 1] - x;
		if (d > 0) {
			a[i] = max(a[i] - d, 0);
			ans += d;
		}
	}

	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:35: error: no matching function for call to 'max(long long int, int)'
   14 |                         a[i] = max(a[i] - d, 0);
      |                                ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 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_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:14:35: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   14 |                         a[i] = max(a[i] - d, 0);
      |                                ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:14:35: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   14 |                         a[i] = max(a[i] - d, 0);
      |                                ~~~^~~~~~~~~~~~~
Language: C++

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

int main() {
  long long int N;
  long long int x;
  long long int candy[100000] = {0};

  cin >> N >> x;
  for (int i = 0; i < N; i++) {
    cin >> candy[i];
  }
  long long int counter = 0;
  for (int i = 0; i < N; i++) {
    while (candy[i] + candy[i - 1] > x) {
      long long int tmp;
      tmp = candy[i] + candy[i - 1] - x;
      counter += tmp;
      candy[i] = candy[i] - min(tmp, a[i]);
    }
  }
  cout << counter << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:38: error: 'a' was not declared in this scope
   20 |       candy[i] = candy[i] - min(tmp, a[i]);
      |                                      ^
Language: Java

import java.util.*;
 
public class Main {
	public static void main(String[] args) {
 
	Scanner sc  = new Scanner(System.in);
        
    long ans = 0;
 
    int N = Integer.parseInt(sc.next());
    int x = Integer.parseInt(sc.next());
    int[] a  = new int[N+1];
    while(true){
        a[cnt] = Integer.parseInt(sc.next());
        cnt++;
        if(cnt==N)break;
    }
    

    if (a[0] > x) {
      ans += a[0] - x;
      a[0] = x;
    }
    
    for(int i=0;i<N;i++){
        if(a[i]+a[i+1]>x){
            
                int t = a[i] + a[i+1]-x;
                ans+=t;
                a[i+1] -= t;
    
        }
    }
 
        System.out.print(ans);
        System.out.println();
	}
        
}

Compiler output:
Main.java:14: error: cannot find symbol
        a[cnt] = Integer.parseInt(sc.next());
          ^
  symbol:   variable cnt
  location: class Main
Main.java:15: error: cannot find symbol
        cnt++;
        ^
  symbol:   variable cnt
  location: class Main
Main.java:16: error: cannot find symbol
        if(cnt==N)break;
           ^
  symbol:   variable cnt
  location: class Main
3 errors
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
//ranker
using namespace std;

#define REPS(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (int i = (a); i >= n; --i)
#define DEP(i, n) DEPS(i, n, 0)

using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;
using pis = pair<int, string>;
using psi = pair<string, int>;
using D = double;


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  long long int N, x;

  cin >> N >> x;

  long long int a[N];

  REP(i, N) cin >> a[i];

long long int tot=0;
 REPS(i, 1, N){
   if(a[i]+a[i-1]>x){
     long long int temp;
     temp = a[i]+a[i-1]-x;
     tot += temp;
     a[i+1]=a[i+1]-min(temp, a[i+1]);
 }

cout << tot << endl;
  return 0;
}


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

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
using namespace std;
typedef long long int ll;
ll n, x;
ll first, second;
ll ans;
ll a[100005];


int main()
{

    cin >> n >> x;
    for (int i = 0; i < n; i++)
        cin >> a[i];
    
    for (int i = 1; i < n; i++) {
        if (a[i] + a[i-1] > x) {
            ans += a[i] + a[i-1] - x;
            a[i] -= ((a[i] + a[i-1] -x);
        }
    }
    cout << ans << endl;
   
   
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:40: error: expected ')' before ';' token
   23 |             a[i] -= ((a[i] + a[i-1] -x);
      |                     ~                  ^
      |                                        )
Language: Java

import java.util.Scanner;

/**
 * @Author oreid
 * @Release 04/12/2016
 */
public class MainA3 {
    static long[] row;

    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int x =  scanner.nextInt();
        int opertations = 0;

        row = new long[n];

        for (int i = 0; i < n ; i++) {
            row[i] = scanner.nextInt();
        }

        scanner.close();

            for (int i = 1; i < n; i++) {
                    while(row[i -1] + row[i] > x){
                        if(row[i -1] > row[i]){
                            row[i-1] -= 1;

                        }else{
                            row[i] -= 1;
                        }
                        opertations++;
                    }
            }


        System.out.print(opertations + "");
    }
}


Compiler output:
Main.java:7: error: class MainA3 is public, should be declared in a file named MainA3.java
public class MainA3 {
       ^
1 error
Language: Java

import java.util.Scanner;

public class Q3 {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		long value = sc.nextLong();
		long sum = sc.nextLong();
		long m = 0;
		long eat = 0;

		long[] arr = new long[(int) value];
		for(int i = 0; i< arr.length; i++){
			arr[i] = sc.nextLong();
		}
		sc.close();
		for(int i=0; i <arr.length-1;i++){
			if(arr[i] + arr[i+1] >sum){
				m = arr[i+1];
				arr[i+1] = sum - arr[i];
				eat += m - arr[i+1];
			}
		}
		System.out.println(eat);
	}
}


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

#include <stdio.h>
int main (void)
{
    int a[100050];
    int x;
    int N;
    int i;
    int count = 0;
    scanf("%d",&N);
    scanf("%d",&x);
    for(i=0;i<N;i++)
        scanf("%d",&a[i]);
    
    for(i=0;i<=N-1;i++){
        if(a[i]+a[i+1] > x){
            if(a[i]>=a[i+1]){
                count = count+ a[i] -x;
                a[i] =  a[i+1] -x;
            }else{
                count =  count + a[i+1] -x;
                a[i+1] =a[i] -x;
            }
        }
        //printf("%d\n",count);
    }
    /*for(i=0;i<N;i++){
        printf("%d",a[i]);*/
    }
    printf("\n");
    printf("%d\n",count);
    return 0;


}

Compiler output:
main.c:29:12: error: expected declaration specifiers or '...' before string constant
   29 |     printf("\n");
      |            ^~~~
main.c:30:12: error: expected declaration specifiers or '...' before string constant
   30 |     printf("%d\n",count);
      |            ^~~~~~
main.c:30:19: error: unknown type name 'count'
   30 |     printf("%d\n",count);
      |                   ^~~~~
main.c:31:5: error: expected identifier or '(' before 'return'
   31 |     return 0;
      |     ^~~~~~
main.c:34:1: error: expected identifier or '(' before '}' token
   34 | }
      | ^
Language: Java

import java.util.Scanner;


public class Main {

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

Compiler output:
Main.java:28: error: reached end of file while parsing
	}
	 ^
1 error
Language: Java


/**
 * Created by sonetsuyoshi on 2016/07/31.
 */
public class Main {

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

        int N = scanner.nextInt();
        long x = scanner.nextLong();

        long[] arr = new long[N];
        for(int i = 0; i < N; i++) {
            arr[i] = scanner.nextLong();
        }


        long count = 0;
        for(int i = 0; i < N - 2; i++) {

            long s1 = arr[i] + arr[i + 1];

            if(s1 > x) {
                if(s1 - x <= arr[i + 1]) {
                    count += s1 - x;
                    arr[i + 1] -= s1 - x;
                } else {
                    arr[i + 1] = 0;
                    count += s1 - x -arr[i + 1];
                    arr[i] -= s1 - x - arr[i + 1];
                }
            }
        }

        if(arr[N - 2] + arr[N - 1] > x) {
            count += arr[N - 2] + arr[N - 1] - x;
        }
        System.out.println(count);
    }
}

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

#include<bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
#define rep(i,n) for(int i=0; i<(n); i++)

int main(){
 string S; cin>>S;
 int N=S.size();

 string ans;

 if(S.front()==S.back()){
  ans = (x%2==1) ? "Second" : "First";
 }
 else{
  ans = (N%2==1) ? "First" : "Second";
 }

 cout<<ans<<endl;

 return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: 'x' was not declared in this scope
   14 |   ans = (x%2==1) ? "Second" : "First";
      |          ^
Language: C++

s = gets.chomp

ca = s.size()%2 == 0 and s[0] == s[-1]
cb = s.size()%2 != 0 and s[0] != s[-1]

ans = 'Second'
if ca or cb
    ans = 'First'
end

puts ans


Compiler output:
a.cc:6:7: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
    6 | ans = 'Second'
      |       ^~~~~~~~
a.cc:8:11: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
    8 |     ans = 'First'
      |           ^~~~~~~
a.cc:1:1: error: 's' does not name a type
    1 | s = gets.chomp
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define vit vector<int>::iterator
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define forn(i, n) for(int i = 0; i < int(n); i++)
#define fr first
#define sc second
#define skip continue
#define PI 3.14159265

typedef unsigned long long ull;
typedef long long ll;
typedef unsigned int ui;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<bool> vb;

const int INF = 1e9 + 5;
const long long MAXN=2e5 + 5;;

void faster(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}

bool cmp(const string& a, const string& b) {
	return (a + b) < (b + a);
}

vector<int> Reversed(const vector<int>& s){
   vector<int> d = s;
   reverse(all(d));
   return d;
}

void solve(){
    string s;
    cin >> s;
    int l = s.size();
    if(s[0] == s[l - 1]){
        if(t % 2 == 0)
            cout << "First";
        else cout << "Second";
    }
    else{
        if(t % 2 == 0)
            cout << "Second";
        else cout << "First";
    }
}


int main(){
    //freopen("slalom.in","r",stdin);
    //freopen("slalom.out","w",stdout);
    //faster();
    int n = 1;
    //cin >> n;
    while(n--){
        solve();
        cout << endl;
    }
    //fclose(stdout);
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:48:12: error: 't' was not declared in this scope
   48 |         if(t % 2 == 0)
      |            ^
a.cc:53:12: error: 't' was not declared in this scope
   53 |         if(t % 2 == 0)
      |            ^
Language: C++

#include <iostream>
#include <cstdio>
#include <set>
#include <list>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <string>
#include <sstream>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <fstream>
#include <iomanip>
//#include <unordered_map>
using namespace std;
#define dbg(x) cerr << #x " = " << x << endl;
typedef pair<int, int> P;
typedef long long ll;
#define FIN freopen("in.txt", "r", stdin);

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int ans = -1;
    string op;
    cin >> op;
    int n = op.size();
    int ans = 0;
    if(op[0] == op[n - 1])
    {
        ans = n - 3;
    }
    else
    {
        ans = n - 2;
    }
    
    if(ans % 2)
    {
        cout << "First" << endl;
    }
    else
    {
        cout << "Second" << endl;
    }
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:9: error: redeclaration of 'int ans'
   34 |     int ans = 0;
      |         ^~~
a.cc:30:9: note: 'int ans' previously declared here
   30 |     int ans = -1;
      |         ^~~
Language: C++

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

void solve(std::string s) {
	if(s.size()%2 == 0 or s[0] == s[s.size()-1])cout<<"Second";
  else cout<<"First"
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You
// use the default template now. You can remove this line by using your custom
// template)
int main() {
  std::string s;
  std::cin >> s;
  solve(s);
  return 0;
}


Compiler output:
a.cc: In function 'void solve(std::string)':
a.cc:6:21: error: expected ';' before '}' token
    6 |   else cout<<"First"
      |                     ^
      |                     ;
    7 | }
      | ~
Language: C++

#include <cstring>
#include <iostream>
#include <numeric>
#include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
if(s.size()%2==0)
cout<<"First"<<endl;
else
cout<<"Second"<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: expected '}' at end of input
   12 | cout<<"Second"<<endl;
      |                      ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define mod 10000007
#define ff first
#define ss second
#define ll long long
#define int long long
#define pii pair<ll,ll>
#define vi vector<ll>
#define mii map<ll,ll>
#define pb push_back
#define mp make_pair
#define sp(x,y) fixed<<setprecision(y)<<x
#define mk(arr,n,type) type *arr=new type[n];
#define w(x) ll x; cin>>x; while(x--)
#define endl '\n'
#define str string
#define all(v) v.begin(),v.end()
void kehsihba() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}
char str[10000+5];
int_32 main() {
    scanf("%s",str);
    int len=strlen(str);
 
    int num=len-2;
    if(str[0]!=str[len-1]){
        if(num%2)
            printf("First\n");
        else
            printf("Second\n");
    }
    else{
        if(num%2)
            printf("Second\n");
        else
            printf("First\n");
    }
 
    return 0;

}


Compiler output:
a.cc:27:1: error: 'int_32' does not name a type
   27 | int_32 main() {
      | ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define mod 10000007
#define ff first
#define ss second
#define ll long long
#define int long long
#define pii pair<ll,ll>
#define vi vector<ll>
#define mii map<ll,ll>
#define pb push_back
#define mp make_pair
#define sp(x,y) fixed<<setprecision(y)<<x
#define mk(arr,n,type) type *arr=new type[n];
#define w(x) ll x; cin>>x; while(x--)
#define endl '\n'
#define str string
#define all(v) v.begin(),v.end()
void kehsihba() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}
char str[N];
int_32 main() {
    scanf("%s",str);
    int len=strlen(str);
 
    int num=len-2;
    if(str[0]!=str[len-1]){
        if(num%2)
            printf("First\n");
        else
            printf("Second\n");
    }
    else{
        if(num%2)
            printf("Second\n");
        else
            printf("First\n");
    }
 
    return 0;

}


Compiler output:
a.cc:26:10: error: 'N' was not declared in this scope
   26 | char str[N];
      |          ^
a.cc:27:1: error: 'int_32' does not name a type
   27 | int_32 main() {
      | ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define mod 10000007
#define ff first
#define ss second
#define ll long long
#define int long long
#define pii pair<ll,ll>
#define vi vector<ll>
#define mii map<ll,ll>
#define pb push_back
#define mp make_pair
#define sp(x,y) fixed<<setprecision(y)<<x
#define mk(arr,n,type) type *arr=new type[n];
#define w(x) ll x; cin>>x; while(x--)
#define endl '\n'
#define str string
#define all(v) v.begin(),v.end()
void kehsihba() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}
int main() {
    scanf("%s",str);
    int len=strlen(str);
 
    int num=len-2;
    if(str[0]!=str[len-1]){
        if(num%2)
            printf("First\n");
        else
            printf("Second\n");
    }
    else{
        if(num%2)
            printf("Second\n");
        else
            printf("First\n");
    }
 
    return 0;

}


Compiler output:
cc1plus: error: '::main' must return 'int'
a.cc: In function 'int main()':
a.cc:27:19: error: expected primary-expression before ')' token
   27 |     scanf("%s",str);
      |                   ^
a.cc:28:23: error: expected primary-expression before ')' token
   28 |     int len=strlen(str);
      |                       ^
a.cc:31:11: error: expected unqualified-id before '[' token
   31 |     if(str[0]!=str[len-1]){
      |           ^
Language: C++

#include<iostream>
#include<string>
#include<stdio.h>
main(){
    string c;std::cin>>c;
    int len=c.length();
    if(c[0]==c[l-1]){
        if(len%2==0) puts("First");
        else puts("Second");
    }
    else{
        if(len%2==0) puts("Second");
        else puts("First");
    }
    return 0;
}

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:5:5: error: 'string' was not declared in this scope
    5 |     string c;std::cin>>c;
      |     ^~~~~~
a.cc:5:5: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included 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:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:5:24: error: 'c' was not declared in this scope
    5 |     string c;std::cin>>c;
      |                        ^
a.cc:7:16: error: 'l' was not declared in this scope
    7 |     if(c[0]==c[l-1]){
      |                ^
Language: C++

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

string s;
int len;

int main() {
    cin >> s; len = s.size();
    if (s[0] == s[len - 1]) {
        if (len % 2) printf("Second\n");
        else printf("First\n");
    }
    else {
        if (len % 2) printf("First\n");
        else printf("Second\n")
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:32: error: expected ';' before '}' token
   17 |         else printf("Second\n")
      |                                ^
      |                                ;
   18 |     }
      |     ~
Language: C++

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

bool isok (const string &s) {
    int n = s.length();
    bool ok = false;
    for (int i = 1; i < n-1; i++) {
        ok |= (s[i-1] != s[i+1]);
    }
    return ok;
}

bool isok2 (const string &s) {
    map<char, int> mp;
    int one = 0;
    for (const char &c : s) mp[c]++;
    for (const auto& e : mp) {
        if (e.second == 1) one++;
    }
    return (mp.size() = 3 && one == 1);
}

int main() {
    string s;
    cin >> s;
    int n = s.length();
    if (((n&1) && isok(s)) || (n % 2 == 0 && isok2(s))) {
        cout << "First" << endl;
    } else {
        cout << "Second" << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'bool isok2(const std::string&)':
a.cc:20:20: error: lvalue required as left operand of assignment
   20 |     return (mp.size() = 3 && one == 1);
      |             ~~~~~~~^~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define pll pair<ll,ll>
#define pint pll
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

bool IsFirst(string s){
  int cnt=0;
  int n=s.size();
  if(n==2 && s[0]!=s[1])return false;
  rep(i,n-1){
    if(s[i]==s[i+1]){
      return true;
    }
  }
  for(int i=1;i<n-1;i++){
    string temp=s.substr(0,i)+s.substr(i+1,n-i-1);
    if(!IsFirst(temp))return true;
  }
  return false;
}

int main(){
  /*
  for(int i=0;i<50049;i++){
    int temp=i;
    string t;
    t+='a';
    while(temp){
      t+='a'+temp%3;
      temp/=3;
    }
    if(IsFirst(t));//cout << t << ' ' << "First" << endl;
    else if(t.size()>=6)cout << t << ' ' << "Second" << endl;
  }
  */
  string t;
  cin >> t;
  bool ok=true;
  int m=t.size();
  rep(i,m-1)if(s[i]==s[i+1])ok=false;
  if(ok)cout << "First" << endl;
  else cout << "Second" << endl;
return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:16: error: 's' was not declared in this scope
   61 |   rep(i,m-1)if(s[i]==s[i+1])ok=false;
      |                ^
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
void fun(char *);
void fun(char *s)
{
    int len=strlen(s);
    if(s[0]==s[len-1])
    {
        if(len%2==0)
        {
            printf("First\n");
        }
        else
        {
            printf("Second\n");
        }
    }
    return;
    else
    {
        if(len%2==0)
        {
            printf("Second\n");
        }
        else
        {
            printf("First\n");
        }
    }
}
int main()
{
    char a[10010];
    scanf("%s",a);
    fun(a);
    return 0;
}

Compiler output:
main.c: In function 'fun':
main.c:20:5: error: 'else' without a previous 'if'
   20 |     else
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
string s;
int main(){
    std::cin>>s;
    puts(((s[0]==s[s.length()-1])^(s.length()%2))?"First":"Second");
}

Compiler output:
a.cc:2:1: error: 'string' does not name a type; did you mean 'stdin'?
    2 | string s;
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:4:15: error: 's' was not declared in this scope
    4 |     std::cin>>s;
      |               ^
Language: C++

#include<stdio.h>
#include<string.h>
char s[1000010];int main(){int len;scanf("%s",s);len=strlen(s);return 0&printf("%s",((s[0]==s[s.length()-1])^(s.length()%2))?"First":"Second");}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:97: error: request for member 'length' in 's', which is of non-class type 'char [1000010]'
    3 | char s[1000010];int main(){int len;scanf("%s",s);len=strlen(s);return 0&printf("%s",((s[0]==s[s.length()-1])^(s.length()%2))?"First":"Second");}
      |                                                                                                 ^~~~~~
a.cc:3:113: error: request for member 'length' in 's', which is of non-class type 'char [1000010]'
    3 | char s[1000010];int main(){int len;scanf("%s",s);len=strlen(s);return 0&printf("%s",((s[0]==s[s.length()-1])^(s.length()%2))?"First":"Second");}
      |                                                                                                                 ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define REP(i,a) for(int i = 0; i < (a); i++)
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const long long LINF = 1e18;
const long long MOD = 1e9 + 7;

signed main(){
    string s;
    cin >> s;
    int n = s.size();
    if(s[0] == s[n - 1]) n--;
    if(n % 2 == 0) cout << "Second" << endl;
    else cout << "First" << endl;
    return 0;
}z

Compiler output:
a.cc:19:2: error: 'z' does not name a type
   19 | }z
      |  ^
Language: C++

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

int main()
{
  	string s;
  	cin>>s;
  	int n = s.length();
  	if(((s[0] == s[n-1]) && (a % 2 == 1)) || ((s[0] != s[n-1]) && (a % 2 == 0)))
      	cout<<"Second\n";
  	else
      	cout<<"First\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:34: error: 'a' was not declared in this scope
    9 |         if(((s[0] == s[n-1]) && (a % 2 == 1)) || ((s[0] != s[n-1]) && (a % 2 == 0)))
      |                                  ^
Language: C++

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

void fun(int i, string s, int &count)
{
	if((s.length() > 2) && (s[a-1] != a[i+1]))
    {
    	s.erase(1, 1);
      	count++;
      	fun(s.length()/2, s, count);
    }
}

int main()
{
	string s;
  	cin>>s;
  	int count = 0;
  	fun(s.length()/2, s, count);
  	if(count % 2 == 0)
      	cout<<"Second\n";
 	else
      	cout<<"First\n";
  	return 0;
}

Compiler output:
a.cc: In function 'void fun(int, std::string, int&)':
a.cc:6:35: error: 'a' was not declared in this scope
    6 |         if((s.length() > 2) && (s[a-1] != a[i+1]))
      |                                   ^
Language: C++

#include <bits/stdc++.h>
string s;
int main(void){
    std::cin>>s;
    return 0&(int)printf("%s",((s[0]==s[s.size()-1])^(s.length()%2))?"First\n":"Second\n\r");
}

Compiler output:
a.cc:2:1: error: 'string' does not name a type; did you mean 'stdin'?
    2 | string s;
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:4:15: error: 's' was not declared in this scope
    4 |     std::cin>>s;
      |               ^