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

 #include <bits/stdc++.h>
  2 using namespace std;
  3
  4 #define REP(i, n) for(int i=0; i < (n); ++i)
  5 #define REPR(i, n) for(int i=(n); i >= 0; --i)
  6 #define FOR(i, m, n) for(itn i=(m); i < (n); ++i)
  7
  8 typedef long long ll;
  9
 10 int main(){
 11    int N, M;
 12    cin >> N >> M;
 13    double ans = 0;
 14    int beki = 1;
 15    for(int i=0; i < M; ++i){
 16       beki*=2;
 17    }
 18    int time = (N-M)*100+M*1900;
 19    int sumt = time;
 20    while(beki <= 10 * sumt){
 21       ans +=(double) sumt/beki;
 22       beki *=2;
 23       sumt += time;
 24    }
 25    cout << (int)ans << endl;
 26    return 0;
 27 }                   

Compiler output:
a.cc:4:5: error: stray '#' in program
    4 |   4 #define REP(i, n) for(int i=0; i < (n); ++i)
      |     ^
a.cc:5:5: error: stray '#' in program
    5 |   5 #define REPR(i, n) for(int i=(n); i >= 0; --i)
      |     ^
a.cc:6:5: error: stray '#' in program
    6 |   6 #define FOR(i, m, n) for(itn i=(m); i < (n); ++i)
      |     ^
a.cc:2:3: error: expected unqualified-id before numeric constant
    2 |   2 using namespace std;
      |   ^
a.cc:3:3: error: expected unqualified-id before numeric constant
    3 |   3
      |   ^
a.cc:4:36: error: 'i' does not name a type
    4 |   4 #define REP(i, n) for(int i=0; i < (n); ++i)
      |                                    ^
a.cc:4:45: error: expected unqualified-id before '++' token
    4 |   4 #define REP(i, n) for(int i=0; i < (n); ++i)
      |                                             ^~
a.cc:5:39: error: 'i' does not name a type
    5 |   5 #define REPR(i, n) for(int i=(n); i >= 0; --i)
      |                                       ^
a.cc:5:47: error: expected unqualified-id before '--' token
    5 |   5 #define REPR(i, n) for(int i=(n); i >= 0; --i)
      |                                               ^~
a.cc:6:41: error: 'i' does not name a type
    6 |   6 #define FOR(i, m, n) for(itn i=(m); i < (n); ++i)
      |                                         ^
a.cc:6:50: error: expected unqualified-id before '++' token
    6 |   6 #define FOR(i, m, n) for(itn i=(m); i < (n); ++i)
      |                                                  ^~
a.cc:9:3: error: expected unqualified-id before numeric constant
    9 |   9
      |   ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long ll;

int main() {
    int n, m;
    cin >> n >> m;

    cout << (1900 * m + 100 ( n - m) ) * pow(2, m) << '\n';

}



Compiler output:
a.cc: In function 'int main()':
a.cc:11:29: error: expression cannot be used as a function
   11 |     cout << (1900 * m + 100 ( n - m) ) * pow(2, m) << '\n';
      |                         ~~~~^~~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main(void) {
  int N, M;
  cin >> N >> M;

  int one = M*1900 + (N-M)*100;
  int count = pow(2, M);
  cout << one * count << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: 'pow' was not declared in this scope
    9 |   int count = pow(2, M);
      |               ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,m;
int main()
{
        cin>>n>>m;
        printf("%d\n",(1<<m)*(100*n+1900*m);
        return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:44: error: expected ')' before ';' token
    7 |         printf("%d\n",(1<<m)*(100*n+1900*m);
      |               ~                            ^
      |                                            )
Language: C++

//by kcz 1552920354@qq.com
//if you find any bug in my code
//please tell me
#include<bits/stdc++.h>
using namespace std;

template <typename T> void chmin(T &x,const T &y)
{
	if(x>y)x=y;
}
template <typename T> void chmax(T &x,const T &y)
{
	if(x<y)x=y;
}
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,l,r) for(int i=l;i<=r;++i)
#define per(i,r,l) for(int i=r;i>=l;--i)
#define pb push_back
#define mp make_pair
#define gc (c=getchar())
char readc()
{
	char c;
	while(gc<'-');
	return c;
}
int read()
{
    char c;
    while(gc<'-');
    if(c=='-')
    {
        int x=gc-'0';
        while(gc>='0')x=x*10+c-'0';
        return -x;
    }
    int x=c-'0';
    while(gc>='0')x=x*10+c-'0';
    return x;
}
#undef gc

const int N=100+5;
int a[N],cnt[N];
int n,L,L2;

ll ans;
void dfs(int x,ll s)
{
	if(x>L)
	{
		rep(i,L+1,L2)
		if(!cnt[i])
		{
			if(!cnt[i*2])
			{
				if(a[i]+a[i*2]<0)s-=a[i]+a[i*2];
			}
			else
			{
				if(a[i]<0)s-=a[i];
			}
		}
		chmax(ans,s);
		return ;
	}
	dfs(x+1,s);
	if(cnt[x]||a[x]>=0)return ;
	dfs(x+1,s);
	for(int y=x;y<=n;y+=x)--cnt[y];
}

int main()
{
	/freopen("1.in","r",stdin);//freopen("1.out","w",stdout);
	cin>>n;
	rep(i,1,n)cin>>a[i];
	L=n/3;L2=n/2;
	rep(i,L2+1,n)
	if(a[i]<0)a[i]=0;
	
	ll s=0;
	rep(i,1,n)s+=a[i];
	ans=s;
	dfs(1,s);
	cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:76:9: error: expected primary-expression before '/' token
   76 |         /freopen("1.in","r",stdin);//freopen("1.out","w",stdout);
      |         ^
Language: Java

import java.util.Scanner;

public class Task {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int n = cin.nextInt(), m = cin.nextInt();
        System.out.println(((n - m) * 100 + 1900 * m) * pow(2, m));
    }

    private static int pow(int a, int b) {
        int res = 1;
        for (int i = 0; i < b; ++i) {
            res *= a;
        }
        return res;
    }
}


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

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

ll n,m;
ll ans;
int main() {
    ios::sync_with_stdio(false);
    cin>>n>>m;
    cout<<(1<<m)*(100*(n-m)+1900*m);
    return 0;
}


Compiler output:
a.cc:4:1: error: 'll' does not name a type
    4 | ll n,m;
      | ^~
a.cc:5:1: error: 'll' does not name a type
    5 | ll ans;
      | ^~
a.cc: In function 'int main()':
a.cc:8:10: error: 'n' was not declared in this scope; did you mean 'yn'?
    8 |     cin>>n>>m;
      |          ^
      |          yn
a.cc:8:13: error: 'm' was not declared in this scope; did you mean 'tm'?
    8 |     cin>>n>>m;
      |             ^
      |             tm
Language: C++

x,y=[int(x) for x in input().split()]
s=(1900*y+100*(x-y))/0.5**y
s=int(s)
print(s)

Compiler output:
a.cc:1:1: error: 'x' does not name a type
    1 | x,y=[int(x) for x in input().split()]
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
#define FOR(i, a, b) for(ll i = (a); i < (b); i++)
#define FORD(i, a, b) for(ll i = (b)-1; i >= (a); i--)
 
typedef vector<int> VI;
typedef vector<VI> VVI;
const ll INF = 1000000000000000000LL;
 
#define VEI(w,e) ((E[e].u == w) ? E[e].v : E[e].u)
#define CAP(w,e) ((E[e].u == w) ? E[e].cap[0] - E[e].flow : E[e].cap[1] + E[e].flow)
#define ADD(w,e,f) E[e].flow += ((E[e].u == w) ? (f) : (-(f)))
 
struct Edge { int u, v; ll cap[2], flow; };
 
VI d, act;
 
bool bfs(int s, int t, VVI& adj, vector<Edge>& E, ll lim) {
  queue<int> Q;
  d = VI(adj.size(), -1);
  d[t] = 0;
  Q.push(t);
  while (not Q.empty() and d[s] == -1) {
    int u = Q.front(); Q.pop();
    for (int i = 0; i < int(adj[u].size()); ++i) {
      int e = adj[u][i], v = VEI(u, e);
      if (CAP(v, e) >= lim and d[v] == -1) {
        d[v] = d[u] + 1;
        Q.push(v);
      }
    }
  }
  return d[s] >= 0;
}
 
bool dfs(int u,int t,ll bot,VVI& adj,vector<Edge>& E, ll lim) {
  if (bot == 0) return false;
  if (u == t) return true;
  for (; act[u] < int(adj[u].size()); ++act[u]) {
    int e = adj[u][act[u]];
    if (CAP(u, e) >= lim and d[u] == d[VEI(u, e)] + 1) {
      ll inc=dfs(VEI(u,e),t,min(bot,CAP(u,e)),adj,E,lim);
      if (inc) {
        ADD(u, e, lim);
        return true;
      }
    }
  }
  return false;
}
 
ll maxflow(int s, int t, VVI& adj, vector<Edge>& E) {
  for (int i=0; i<int(E.size()); ++i) E[i].flow = 0;
  ll flow = 0;
  for(int lim = (1<<30); lim >= 1;) {
    if(!bfs(s,t,adj,E, lim)) {
      lim >>= 1;
      continue;
    }
    act = VI(adj.size(), 0);
    while (dfs(s,t,INF, adj, E, lim)) flow += lim;
  }
  return flow;
}
 
void addEdge(int u, int v, VVI& adj, vector<Edge>& E, ll cap){
	Edge e;
	e.u = u;
	e.v = v;
	e.cap[0] = cap;
	e.cap[1] = 0;
	e.flow = 0;
	adj[u].push_back(E.size());
	adj[v].push_back(E.size());
	E.push_back(e);
}
int main() {
  int n;
  scanf("%d", &n);
  vector<int> a(n + 1);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
long long ans = 0;
	vector<vector<int>> adj(n+2);
	vector<Edge> E;
	int S = 0, T = n+1;
	for(int i = 1; i < n+1; ++i) {
		if(v[i] <= 0) addEdge(S, i, adj, E, -v[i]);
		else {
addEdge(i, T, adj, E, v[i]);
ans += v[i];
}
		for(int j = 2; i*j < n+1; ++j) {
			addEdge(i, i*j, adj, E, INF);
		}
	}
	cout << ans - maxflow(S,T,adj,E) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:91:20: error: 'v' was not declared in this scope
   91 |                 if(v[i] <= 0) addEdge(S, i, adj, E, -v[i]);
      |                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,m;
int t[6]={1,2,4,8,16,32};
long long a,res=0;
int main(){
 cin>>n>>m;
long long x=;
a=(n-m)*100ll+1900ll*m;
res=a*x;
cout<<res;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: expected primary-expression before ';' token
    8 | long long x=;
      |             ^
Language: C++

#!/usr/bin/env python

def main():
    N, M = map(int, input().split(" "))

    all_pass_time = (N - M) * 100 + M * 1900
    needed_try_cnt_for_all_pass = 2 ** M
    print(all_pass_time * needed_try_cnt_for_all_pass)

if __name__ == '__main__':
    main()


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #!/usr/bin/env python
      |  ^
a.cc:10:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   10 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:3:1: error: 'def' does not name a type
    3 | def main():
      | ^~~
Language: C++

# coding: utf-8

N, rand = map(int, input().split())

print (2**rand)*1900 + (N-rand)*100

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #coding
    1 | # coding: utf-8
      |   ^~~~~~
a.cc:3:1: error: 'N' does not name a type
    3 | N, rand = map(int, input().split())
      | ^
Language: C++

#include<bits/stdc++.h>

#define int long long

using namespace std;

int main() {
    int n,w,z;
    cin >> n >> w >> z;
    vector<int>v(n);
    for(int i = 0;i < n;i++)
        cin >> v[i];
    if(n == 1){
        cout << abs(v[0] - z)<<endl;
    }
    else{
        cout<<max(abs(v[n-2]-v[n-1]),abs(v[n-1]-z))<<endl;
    }
    return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

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

#define REP(i, n) for(int i = 0;i < n;i++)
#define FOR(i, m, n) for(int i = m;i < n;i++)

int n, m;
int main(){
    cin >> n >> m;
    cout << (1900 * m + 100 * (n - m)) * pow(2, m) << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:42: error: 'pow' was not declared in this scope
   14 |     cout << (1900 * m + 100 * (n - m)) * pow(2, m) << endl;
      |                                          ^~~
Language: Java


import java.util.Scanner;

public class Math {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		double x = 0;
		int y = 0;

		if(n-m>0){
			y = (n-m)*100;
		}
		double k = Math.pow(2, m);

		double p,q;
		p=1-1/k;
		for(int i=1; i<4050000; i++){
			q=Math.pow(p, i-1);
			x += (y + 1900*m)*i*q/(double)k;
		}
		System.out.println(Math.round(x));
		sc.close();

	}
}


Compiler output:
Main.java:4: error: class Math is public, should be declared in a file named Math.java
public class Math {
       ^
Main.java:15: error: cannot find symbol
		double k = Math.pow(2, m);
		               ^
  symbol:   method pow(int,int)
  location: class Math
Main.java:20: error: cannot find symbol
			q=Math.pow(p, i-1);
			      ^
  symbol:   method pow(double,int)
  location: class Math
Main.java:23: error: cannot find symbol
		System.out.println(Math.round(x));
		                       ^
  symbol:   method round(double)
  location: class Math
4 errors
Language: Java

package arc085;

import java.math.BigDecimal;
import java.util.Scanner;

public class C {
	
	public static void main(String[] args) {
		try (
			Scanner scanner = new Scanner(System.in);
		) {
			int n;
			int m;
			BigDecimal x;
			
			n = Integer.parseInt(scanner.next());
			m = Integer.parseInt(scanner.next());
			
			int a = m * 1900 + (n - m) * 100;
			int b = (int)Math.pow(2, m);
			
			System.out.println(a * b);
			
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
	}

}


Compiler output:
Main.java:6: error: class C is public, should be declared in a file named C.java
public class C {
       ^
1 error
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 m = sc.nextInt();
		double x = 0;
		int y = 0;

		if(n-m>0){
			y = (n-m)*100;
		}
		int k = (int)Math.pow(2, m);

		//int -2147483648 2147483647だと長過ぎる
		/*
		 * 21474836だと長すぎ、
		 * 2147483だと間違う
		 *
		 *
TLE
4099999

WA
3999999
		 * */
		double p,q;
		for(int i=1; i<4050000; i++){
			p=1-1/Math.pow(2, m);
			q=Math.pow(p, i-1);
			x += (double)(y + 1900*m)*i*(q*/Math.pow(2, m));
		}
		System.out.println((int)x);
		sc.close();

	}
}


Compiler output:
Main.java:33: error: illegal start of expression
			x += (double)(y + 1900*m)*i*(q*/Math.pow(2, m));
			                               ^
1 error
Language: C++

#include <iostream>


int main() {
	int N, M;
	std::cin >> N;
	std::cin >> M;
	int case_100ms = N - M;
	double one_exe_time = case_100ms * 100 + M * 1900;
	double clear_prob = pow(1 / 2.0, M);
	double s, s_old = 1;
	double total_success_prob, total_success_prob_old = 0.0;
	int x = 1;
	s = 0.0;
	while (1) {
		total_success_prob = 1.0 - pow(1 - clear_prob, x);
		s += (one_exe_time * x) * abs(total_success_prob - total_success_prob_old);
		x++;
		if (abs(s - s_old) < 1e-15){
			break;
		}
		s_old = s;
		total_success_prob_old = total_success_prob;
	}

	std::cout << int(s + 0.5) << "\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:29: error: 'pow' was not declared in this scope
   10 |         double clear_prob = pow(1 / 2.0, M);
      |                             ^~~
Language: Java

package arc085;

import java.util.Scanner;

public class HSI {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = 0;
		int y = 0;

		if(n-m>0){
			y = (n-m)*100;
		}
		double k = Math.pow(2, m);

		//int -2147483648 2147483647だと長過ぎる
		for(int i=1; i<21474836; i++){
			x += (y + 1900*m*i)/(Math.pow(k, i));
		}
		System.out.println(x);
		sc.close();

	}
}


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

#include <iostream>
#include <cstdio>
#include <vedctor>
using namespace std;
int N,M;
int a[100001];
int x=1;
int main(){
  cin >> N >> M;
  for(int i=0;i<M;i++){
    x*=2;
  }
  cout << x*1900 << endl;
  return 0;
}


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

#include <iostream>
using namespace std;

int main() {
	int N, M;
	cin >> N >> M;
	double T,S,n;
	T = 1900 * M + 100 * (N - M);
	n = pow(2, M);
	S = n * T;
	cout << S << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: 'pow' was not declared in this scope
    9 |         n = pow(2, M);
      |             ^~~
Language: Java

import java.io.FileReader;
import java.io.PrintWriter;
import java.util.Scanner;

public class C {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        int m = in.nextInt();
        int r = 1;
        for (int i = 0; i < m; i++) {
            r *= 2;
        }
        int y = (n - m) * 100;
        y += m * 1900;
        y *= r;
        out.print(y);
        out.close();
    }
}


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

#include <algorithm>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

#define SREP(s,i,m) for(unsigned int i = s; i < m; ++i)
#define REP(i,m) SREP(0,i,m)

using namespace std;
#ifdef _MSC_VER
using LONG = __int64;
using ULONG = unsigned __int64;
#else
using LONG = long long int;
using ULONG = unsigned long long int;
#endif

// 二乗を計算する。
int sq(int x) { return x * x; }

// 領域内にいるか。
bool within(int x, int min, int max) {
	return min <= x && x <= max;
}

// container の中から key より小さい値を見つける。
// 見つからない場合は container.end() を返す。
template<typename T>
typename T::iterator less_than(T &container, typename T::key_type &key) {
	typename T::iterator prev = container.lower_bound(key);
	if (prev == container.begin()) prev = container.end();
	else prev--;
	return prev;
}

// container の中から key より大きい値を見つける。
// 見つからない場合は container.end() を返す。
template<typename T>
typename T::iterator greater_than(T &container, typename T::key_type &key) {
	return container.upper_bound(key);
}

// b^e (mod m) を求める
LONG modpow(LONG b, LONG e, LONG m) {
	LONG result = 1;
	while (e > 0) {
		if ((e & 1) == 1) result = (result * b) % m;
		e >>= 1;
		b = (b * b) % m;
	}
	return result;
}

int main(void) {
	int N, M;
	cin >> N >> M;
	double sum = 0, prev = 0;
	const double p = std::pow(1 / 2.0, M);
	double f = 1.0;
	for (int i=0; ; ++i) {
		sum += (i + 1) * ((N - M) * 100 + 1900 * M) * f * p;
		f = f * (1.0 - p);
		//cout << (sum - prev) << endl;
		if (std::abs(sum - prev) < 1E-6) break;
		prev = sum;
	}
	cout << (int)std::round(sum) << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:65:31: error: 'pow' is not a member of 'std'
   65 |         const double p = std::pow(1 / 2.0, M);
      |                               ^~~
a.cc:74:27: error: 'round' is not a member of 'std'
   74 |         cout << (int)std::round(sum) << endl;
      |                           ^~~~~
Language: C++

#include <algorithm>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

#define SREP(s,i,m) for(unsigned int i = s; i < m; ++i)
#define REP(i,m) SREP(0,i,m)

using namespace std;
#ifdef _MSC_VER
using LONG = __int64;
using ULONG = unsigned __int64;
#else
using LONG = long long int;
using ULONG = unsigned long long int;
#endif

// 二乗を計算する。
int sq(int x) { return x * x; }

// 領域内にいるか。
bool within(int x, int min, int max) {
	return min <= x && x <= max;
}

// container の中から key より小さい値を見つける。
// 見つからない場合は container.end() を返す。
template<typename T>
typename T::iterator less_than(T &container, typename T::key_type &key) {
	typename T::iterator prev = container.lower_bound(key);
	if (prev == container.begin()) prev = container.end();
	else prev--;
	return prev;
}

// container の中から key より大きい値を見つける。
// 見つからない場合は container.end() を返す。
template<typename T>
typename T::iterator greater_than(T &container, typename T::key_type &key) {
	return container.upper_bound(key);
}

// b^e (mod m) を求める
LONG modpow(LONG b, LONG e, LONG m) {
	LONG result = 1;
	while (e > 0) {
		if ((e & 1) == 1) result = (result * b) % m;
		e >>= 1;
		b = (b * b) % m;
	}
	return result;
}

int main(void) {
	int N, M;
	cin >> N >> M;
	double sum = 0, prev = 0;
	const double p = pow(1 / 2.0, M);
	double f = 1.0;
	for (int i=0; ; ++i) {
		sum += (i + 1) * ((N - M) * 100 + 1900 * M) * f * p;
		f = f * (1.0 - p);
		//cout << (sum - prev) << endl;
		if (std::abs(sum - prev) < 1E-6) break;
		prev = sum;
	}
	cout << (int)std::round(sum) << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:65:26: error: 'pow' was not declared in this scope
   65 |         const double p = pow(1 / 2.0, M);
      |                          ^~~
a.cc:74:27: error: 'round' is not a member of 'std'
   74 |         cout << (int)std::round(sum) << endl;
      |                           ^~~~~
Language: C++

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

signed main() {
  int n; cin >> n;
  vector<int> v; v.reserve(n);
  vector<int> baddiv;
  baddiv.emplace_back(1);
  for (int i=0; i<n; ++i) {
    int x; cin >> x;
    v.emplace_back(x);
    xabs = abs(x);
    for (int k=1; k*k<=xabs; ++k) {
      if (x%k==0) {
	if (k != 1) baddiv.emplace_back(k);
	baddiv.emplace_back(x/k);
      }
    }
  }
  sort(baddiv.begin(), baddiv.end());
  baddiv.erase(unique(baddiv.begin(), baddiv.end()), baddiv.end());
  baddiv.emplace_back(1e9+1);
  
  int64_t max_score = 0;
  for (auto d : baddiv) {
    int64_t score = 0;
    for (auto x : v)
      if (x%d)
	score += x;
    max_score = max(score, max_score);
  }
  cout << max_score << '\n';
}
 


Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'xabs' was not declared in this scope; did you mean 'labs'?
   12 |     xabs = abs(x);
      |     ^~~~
      |     labs
Language: C

#include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vvi vector<vi>
#define vs vector<string>
#define pb push_back
#define P pair<int,int>
#define vp vector<P>
#define PP pair<P,int>
#define vpp vector<PP>
#define fi first
#define se second
#define INF (1<<30)
#define MOD 1000000007
#define REP(i,n) for(int i=0;i<n;i++)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define all(x) (x).begin(),(x).end()
int main(){
    int n,m;
    cin>>n>>m;
    double p=m*1900+(n-m)*100;
    double q=pow(0.5,m);
    double ans=0.0;
    double now=1.0;
    FOR(i,1,100000){
        ans+=(now*q)*p*i;
        now=now-(now*q);
    }
    cout<<(int)(ans+0.5)<<endl;
    return 0;
}

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

from fractions import *
from decimal import *
n, m = [int(i) for i in input().split()]
a = Decimal()
k = (Decimal(2 ** m) - 1) / 2 ** m
s = m * 1900 + (n - m) * 100
for i in range(1, 10000):
	a += Decimal(i * s) * k ** i
print(round(a))



Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from fractions import *
      | ^~~~
Language: C

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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
#define debug(x) cerr << #x << ": " << x << endl
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  2017/11/11  Problem: ABC 085 A / Link: http://arc085.contest.atcoder.jp/tasks/arc085_a  ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */

LL N,M;

LL ans = 0LL;

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

	string s;
	cin >> N>>M;
	cout << (M * 1900 + (N - M) * 100)*pow(2, M) << endl;


	return 0;
}


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>
#pragma GCC optimize("O2")
using namespace std;

# define mp make_pair
# define pb push_back
# define PI acos(-1)
# define ff first 
# define ss second 
# define endl '\n'
# define vt vector
# define all(c) (c).begin(), (c).end()
# define rep(i,a,b) for(int i = a ; i < b ; ++i)

typedef long long ll ; 
typedef long double ld ; 
typedef pair<int,int> pii ; 
typedef pair<ll,ll> pll ;

template<class T> bool umin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool umax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }

const ll inf = 1e18 ; 
const ll mod = 1e9+7 ; 
const int MOD = 998244353 ; 
vt<pii> dir =  {{-1,0} , {1, 0} , {0,-1} , {0,1}} ; 

ll nCr(ll n,ll r){
	ll res=1;
	if(r>n) return 0;
	if(r>n-r) r=n-r;
	for(ll i=0;i<r;i++) {
		res*=(n-i);
		res/=(i+1);
	}
	return res;
}

ll fastpower(ll a , ll n)
{
	ll res = 1;
	while(n)
	{
		if(n & 1)
			res = (res * a) % MOD;
		n >>= 1;
		a = (a * a) % MOD;
	}
	return res%MOD;
}

// ==========Start Here==============
const int N = 2005 ;

ll n ,z , w ; 
ll a[N] ; 
ll cache[N][2] ; 


ll dp(int idx, int chance , ll prvx , ll prvy) {
	if(idx == n) {
		return abs(prvx - prvy) ; 
	}
	int &ans = cache[idx][chance] ; 
	if(ans != -1) 
		return ans ; 
	if(chance == 0) {
		
			return ans = max(dp(idx+1,1,a[idx],prvy),  dp(idx+1,0,prvx,prvy) ) ; 
		
	} else {
		
			return ans = min(dp(idx+1,0,prvx,a[idx]),dp(idx+1,1,prvx,prvy)) ;
		
	}
}


int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL) ; 
 	
 	cin >> n >> z >> w ; 
 	rep(i,0,n) 
 		cin >> a[i] ; 
 	rep(i,0,N) {
 		rep(j,0,2) {
 			cache[i][j] =  -1 ; 
 		}
 	}
	cout << dp(0,0,z,w) ; 
	

	cerr <<"Time : "<<1000*((double)clock())/(double)CLOCKS_PER_SEC<<" ms\n";
	return 0 ; 
}


Compiler output:
a.cc: In function 'll dp(int, int, ll, ll)':
a.cc:64:37: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'll' {aka 'long long int'}
   64 |         int &ans = cache[idx][chance] ;
      |                    ~~~~~~~~~~~~~~~~~^
Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define pi acos(-1.0)
#define eps 1e-9
#define ll long long
#define ull unsigned long long
#define sf scanf
#define pf printf
#define nl printf("\n")
#define ps(s) printf("%s",s.c_str())
#define	inf (ll)1e15
#define mod 1000000007
#define mem(x,val) memset(x,val,sizeof x)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend() 
#define sz(x) (int)(x).size()
#define test_case int ___t;scanf("%d", &___t);for(int cs=1;cs<=___t;cs++)

using namespace __gnu_pbds;
using namespace std;

inline string getString(int n){char ch[n+5];sf(" %s",ch);return string(ch);}
inline string getLine(int n)
{char ch[n+5];fgets(ch,n+5,stdin);string s=string(ch);s.pop_back();return s;}

//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> new_data_set;


const int S=2010;
int n,z,w;
int ara[S+5];

int main()
{
    //#ifndef ONLINE_JUDGE
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    //#endif
	while(~sf("%d %d %d",&n,&z,&w))
	{
		
		for(int i=1;i<=n;i++)sf("%d",&ara[i]);

		int mx=0;
		mx=max(mx,abs(ara[i]-ara[n]));
		mx=max(mx,abs(ara[n]-w));
		pf("%d\n",mx);
	}
    return 0;
}



































Compiler output:
a.cc: In function 'int main()':
a.cc:47:35: error: 'i' was not declared in this scope
   47 |                 mx=max(mx,abs(ara[i]-ara[n]));
      |                                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
ll mod=1e9+7;
bool dx[2][18000],dy[2][18000];

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,w,z;cin>>n>>z>>w;
    vector<int> a(n);
    rep(i,n)cin>>a[i];
    int ans=abs(w-a[n-1]);
    if(n>1)ans=max(ans,a[n-1],a[n-2]);
    cout<<ans<<endl;
    return 0;
}


Compiler output:
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: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:15:19:   required from here
   15 |     if(n>1)ans=max(ans,a[n-1],a[n-2]);
      |                ~~~^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C++

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,w,z;cin>>n>>z>>w;
    vector<int> a(n);
    rep(i,n)cin>>a[i];
    ans=abs(w-a[n-1]);
    if(n>1)ans=max(ans,a[n-1],a[n-2]);
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |     ans=abs(w-a[n-1]);
      |     ^~~
      |     abs
Language: C++

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

int main() {
  long long n,a,b,ans;
  cin>>n>>a>>b;
  long long a[n];
  for(int i=0;i<n;i++){
    long long k;
    cin>>k;
    a[i]=k;
  }
  if(n==1)ans=abs(a[0]-b);
  else{
    ans=max(abs(a[n-1]-a[n-2]),abs(a[n-1]-b));
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: conflicting declaration 'long long int a [n]'
    7 |   long long a[n];
      |             ^
a.cc:5:15: note: previous declaration as 'long long int a'
    5 |   long long n,a,b,ans;
      |               ^
a.cc:11:6: error: invalid types 'long long int[int]' for array subscript
   11 |     a[i]=k;
      |      ^
a.cc:13:20: error: invalid types 'long long int[int]' for array subscript
   13 |   if(n==1)ans=abs(a[0]-b);
      |                    ^
a.cc:15:18: error: invalid types 'long long int[long long int]' for array subscript
   15 |     ans=max(abs(a[n-1]-a[n-2]),abs(a[n-1]-b));
      |                  ^
a.cc:15:25: error: invalid types 'long long int[long long int]' for array subscript
   15 |     ans=max(abs(a[n-1]-a[n-2]),abs(a[n-1]-b));
      |                         ^
a.cc:15:37: error: invalid types 'long long int[long long int]' for array subscript
   15 |     ans=max(abs(a[n-1]-a[n-2]),abs(a[n-1]-b));
      |                                     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int N, Z, W;
int gam(int n, int x, int y, int ba) {
  if (n == N) return max(x - y, y - x);
  int ans = 1e9 + 10;
  int pl[] = {x, y};
  for (int i = 1; i <= N - n; i ++) {
    pl[ba % 2] += ca[i + n - 1];
    int kj = gam(n + i, pl[0], pl[1], ba + 1);
    if (!(ba % 2))kj *= -1;
    if (ans > kj) ans = kj;
    pl[ba % 2] -= ca[i + n - 1];
  }
  if (!(ba % 2)) ans *= -1;
  return ans;
}
int main () {
  cin >> N >> Z >> W;
  int ca[2020];
  for (int i = 0; i < N; i ++) cin >> ca[i];
  cout << gam(0, Z, W, 0) << endl;
}

Compiler output:
a.cc: In function 'int gam(int, int, int, int)':
a.cc:9:19: error: 'ca' was not declared in this scope; did you mean 'ba'?
    9 |     pl[ba % 2] += ca[i + n - 1];
      |                   ^~
      |                   ba
Language: C++

#include <stdio.h>

#define REP(i, n) for(int (i) = 0; (i) < (n); ++(i))

int main(void){
    int n, z, w; scanf("%d%d%d\n", &n, &z, &w);
    int ans;
    if(n == 1){
        int a; scanf("%d", &a);
        ans = abs(a-w);
    }
    else{
        int N = n - 2, v0, v1;
        REP(i, N) while(getchar() != ' ');
        scanf("%d%d", &v0, &v1);
        ans = std::max(abs(v0-v1), abs(v1-w));
    }
    printf("%d\n", ans);

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: 'abs' was not declared in this scope; did you mean 'ans'?
   10 |         ans = abs(a-w);
      |               ^~~
      |               ans
a.cc:16:20: error: 'max' is not a member of 'std'
   16 |         ans = std::max(abs(v0-v1), abs(v1-w));
      |                    ^~~
a.cc:16:24: error: 'abs' was not declared in this scope; did you mean 'ans'?
   16 |         ans = std::max(abs(v0-v1), abs(v1-w));
      |                        ^~~
      |                        ans
Language: C++

#include <bits/stdc++.h>

using ll = long long;
using namespace std;
constexpr ll inf = 1e15;
constexpr ll mod = 1e9+7;

ll dp[2001][2001] = {0};
int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    int N, Z, W;
    cin>>N>>Z>>W;
    vector<int> A(N);
    for (int n = 0; n < N; n++) cin>>A[n];

    for (int i = 0; i < 2; i++)
        for (int j = 0; j <= 2000; j++)
            for (int k = 0; k <= 2000; k++) dp[i][j][k] = inf;

    function<ll(bool, int, int)> game = [&](bool turn, int X, int Y) {
        if (X == N || Y == N) return dp[X][Y] = abs((X == 0 ? Z : A[X-1]) - (Y == 0 ? W : A[Y-1]));
        if (dp[X][Y] != inf) return dp[X][Y];

        ll ans;
        if (!turn) {
            ans = 0;
            for (int x = max(X,Y)+1; x <= N; x++) ans = max(ans, game(!turn, x, Y));
        } else {
            ans = inf;
            for (int y = max(X,Y)+1; y <= N; y++) ans = min(ans, game(!turn, X, y));
        }
        return dp[X][Y] = ans;
    };

    cout<<game(false, 0, 0)<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:53: error: invalid types 'll {aka long long int}[int]' for array subscript
   20 |             for (int k = 0; k <= 2000; k++) dp[i][j][k] = inf;
      |                                                     ^
Language: C++

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

using namespace std;

function<int const&(int const&, int const&)> comparer[] = {
  [](int a, int b) { return max(a, b); },
  [](int a, int b) { return min(a, b); }
};
constexpr int zero[] = { -1, INT_MAX };

int dp[2001][2];

int score(vector<int> const& as, int i, int cmp) {
  auto& best = dp[i][cmp];
  if (best >= 0) return best;
  auto const& better = comparer[cmp];
  int const len = as.size();
  best = zero[cmp];
  for (int j = i; j < len - 1; j++)
    best = better(best, score(as, j + 1, 1 - cmp));
  best = better(best, as[i - 1]);
  return best;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, z;
  cin >> n >> z;
  memset(dp, -1, sizeof dp);
  vector<int> a(n + 1);
  for (auto& v : a)
    cin >> v;
  for (auto& v : a)
    v = abs(v - a.back());
  cout << score(a, 1, 0) << endl;
}


Compiler output:
a.cc:8:1: error: 'function' does not name a type; did you mean 'union'?
    8 | function<int const&(int const&, int const&)> comparer[] = {
      | ^~~~~~~~
      | union
a.cc:12:30: error: 'INT_MAX' was not declared in this scope
   12 | constexpr int zero[] = { -1, INT_MAX };
      |                              ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <algorithm>
  +++ |+#include <climits>
    5 | 
a.cc: In function 'int score(const std::vector<int>&, int, int)':
a.cc:19:24: error: 'comparer' was not declared in this scope
   19 |   auto const& better = comparer[cmp];
      |                        ^~~~~~~~
a.cc: In function 'int main()':
a.cc:33:3: error: 'memset' was not declared in this scope
   33 |   memset(dp, -1, sizeof dp);
      |   ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <algorithm>
  +++ |+#include <cstring>
    5 |
Language: C++

#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <algorithm>
#include <queue>
#include <map>
#include <unordered_map>
#include <random>
#include <cstdio>
#include <cstring>
#include <cmath>

using namespace std;
using ll = long long;

ll N, Z, W;
vector<ll> A;

void input() {
    cin >> N >> Z >> W;
    A.resize(N);
    for (auto& a : A)
        cin >> a;
}

void solve() {
    return max(abs(A.back() - W), abs(A[N - 2] - A[N - 1]));
}


int main() {
    input();
    solve();
    
    return 0;
}



Compiler output:
a.cc: In function 'void solve()':
a.cc:28:15: error: return-statement with a value, in function returning 'void' [-fpermissive]
   28 |     return max(abs(A.back() - W), abs(A[N - 2] - A[N - 1]));
      |            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

using std::cin;
using std::cout;
using std::cerr;
using std::endl;

using ll = long long;

int main() {
  int N, Z, W;
  std::vector<ll> a;

  cin >> N >> Z >> W;
  a.resize(N);
  for (int i = 0; i < N; ++i) {
    cin >> a[i];
  }

  int ans = absll(a[N - 1] - W);
  if (N >= 2) {
    ans = std::max(ans, absll(a[N - 2] - a[N - 1]));
  }
  if (N >= 3) ans = std::max(ans, absll(a[N - 3] - (absll(a[N - 2] - a[N - 3]) < absll(a[N - 1] - a[N - 3]) ? a[N - 2] : a[N - 1])));

  cout << ans << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:13: error: 'absll' was not declared in this scope
   26 |   int ans = absll(a[N - 1] - W);
      |             ^~~~~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
#define rep(i,n) for(int i = 0; i < n; i++)

int main(){
    int n,z,w
    cin >> n >> z >> w;
 	vector<int> a(n);
    rep(i,n) cin >> a[i];
    if(n == 1){
		cout << abs(a[n-1] - w) << endl;
    }else{
    	cout << max(abs(a[n-1] - w), abs(a[n-1] - a[n-2])) << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: expected initializer before 'cin'
    9 |     cin >> n >> z >> w;
      |     ^~~
a.cc:13:38: error: 'w' was not declared in this scope
   13 |                 cout << abs(a[n-1] - w) << endl;
      |                                      ^
a.cc:15:34: error: 'w' was not declared in this scope
   15 |         cout << max(abs(a[n-1] - w), abs(a[n-1] - a[n-2])) << endl;
      |                                  ^
Language: C++

#include <bits/stdc++.h>

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repfrom(i, from, n) for (ll i = (from); i < (n); i++)
#define reps(i, n) for (ll i = 1; i <= (n); i++)

using namespace std;

using ll = long long;
using p  = pair<ll, ll>;
constexpr ll INF = 1LL << 62;
constexpr ll MAX_N = 2000;

ll N, Z, W;
vector<ll> A;

int main(void) {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    cin >> N >> Z >> W;
    A = vector<ll>(N + 1, 0);
    repfrom(i, N) {
        cin >> A[i];
    }
    
    if (N == 1) {
        cout << abs(A[1] - W) << endl;
    } else {
        cout << max(abs(A[N] - W), abs(A[N - 1] - A[N])) << endl;
    }
    
    return 0;
}


Compiler output:
a.cc:23:17: error: macro "repfrom" requires 3 arguments, but only 2 given
   23 |     repfrom(i, N) {
      |                 ^
a.cc:4:9: note: macro "repfrom" defined here
    4 | #define repfrom(i, from, n) for (ll i = (from); i < (n); i++)
      |         ^~~~~~~
a.cc: In function 'int main()':
a.cc:23:5: error: 'repfrom' was not declared in this scope
   23 |     repfrom(i, N) {
      |     ^~~~~~~
Language: C++

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

#define INF_LL (ll)1e18
#define INF (int)1e9
#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

int main(void){
	int32 N, Z, W;
	int32 a[2020];
	cin >> N >> Z >> W;
	REP(i, N)
		cin >> a[i];
	cout << max(abs(W-a[N-1]), (N >= 2 ? abs(a[N-1]-a[N-2]) : 0) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:70: error: invalid operands of types 'long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   30 |         cout << max(abs(W-a[N-1]), (N >= 2 ? abs(a[N-1]-a[N-2]) : 0) << endl;
      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
Language: C++

/*بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم*/

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

inline ABS (int x)
{
    return x<0 ? -x : x;
}
int main ()
{
    int i,n,z,w,ara[2005];
    cin>>n>>z>>w;
    for (i=1;i<=n;i++) scanf ("%d",&ara[i]);
    if (n==1) cout<<ABS(w-ara[1])<<endl;
    else cout<<max(ABS(w-ara[n]),ABS(ara[n]-ara[n-1]))<<endl;

    return 0;
}


Compiler output:
a.cc:6:8: error: ISO C++ forbids declaration of 'ABS' with no type [-fpermissive]
    6 | inline ABS (int x)
      |        ^~~
Language: C++

#include<iostream>
#include<algorithm>
#include<cmath>
#define INF (2<<21)
using namespace std;
int N,M;
int a[2048];
int b[2048];

int main(void)
{
int p1,p2;
cin >> N >> p1 >> p2;
if (N==0) {
cout << p1-p2 << endl;
return 0;
}
for (int i=0; i<N; i++){
 cin >> a[i];
}
int min = p2;
for (int i=N-1; i>=0; i--){
 b[i] = a[i] - min;
 min = min(min,a[i])
}
int max=-INF;
for (int i=0; i<N; i++){
 max = max(max,b[i])
}
cout <<max << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:11: error: 'min' cannot be used as a function
   24 |  min = min(min,a[i])
      |        ~~~^~~~~~~~~~
a.cc:28:11: error: 'max' cannot be used as a function
   28 |  max = max(max,b[i])
      |        ~~~^~~~~~~~~~
Language: C++

#include<iostream>
#include<cmath>
#define INF (2<<21)
using namespace std;
int N,M;
int a[2048];
int b[2048];

int main(void)
{
int p1,p2;
cin >> N >> p1 >> p2;
if (N==0) {
cout << p1-p2 << endl;
return 0;
}
for (int i=0; i<N; i++){
 cin >> a[i];
}
int min = p2;
for (int i=N-1; i>=0; i--){
 b[i] = a[i] - min;
 min = min(min,a[i])
}
int max=-INF;
for (int i=0; i<N; i++){
 max = max(max,b[i])
}
cout <<,max << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:11: error: 'min' cannot be used as a function
   23 |  min = min(min,a[i])
      |        ~~~^~~~~~~~~~
a.cc:27:11: error: 'max' cannot be used as a function
   27 |  max = max(max,b[i])
      |        ~~~^~~~~~~~~~
a.cc:29:8: error: expected primary-expression before ',' token
   29 | cout <<,max << endl;
      |        ^
a.cc:29:13: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   29 | cout <<,max << endl;
      |         ~~~~^~~~~~~
Language: C++

#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <limits.h>
#include <assert.h>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <string>
#include <bitset>
#include <vector>
using namespace std;

#define LL long long

#define fi first
#define se second
#define lson l,mid,id<<1
#define rson mid+1,r,id<<1|1
#define ls id<<1
#define rs id<<1|1
#define MID(a,b) (((a)+(b))>>1)
#define maxx(a,b) ((a)<(b)?(b):(a))
#define minx(a,b) ((a)<(b)?(a):(b))
#define absx(a) ((a)<0?-(a):(a))
#define mk(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define itr iterator
#define lowbit(x) ((x)&-(x))

typedef unsigned LL ULL;
typedef unsigned uint;
typedef map<int,int> mii;
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
typedef pair<LL,LL> pLL;

template< typename T > inline void read(T &x) {
    bool f; char ch; f=0; x=0; ch=getchar();
    while(ch<'0' || ch>'9') {if(ch=='-') f=1; ch=getchar();}
    while(ch>='0' && ch<='9') {x=x*10+ch-'0'; ch=getchar();}
    if(f) x=-x;
}

template< typename T > inline void Max(T &a, T b) {if(a<b) a=b;}
template< typename T > inline void Min(T &a, T b) {if(b<a) a=b;}
template< typename T > inline T Abs(T a) {if(a<0) return -a; else return a;}

const double pi=(double) acos(-1.0);
const int MOD=(int) 1e9+7;
const int INF=(int) 0x3f3f3f3f;
const LL  LINF=(LL) INF<<32|INF;
const int SINF=(uint) ~0>>1;
const LL  SLINF=(ULL) (-1)>>1;
const double DINF=(double) 1e50;
const double eps=(double) 1e-8;
const int maxn=(int) 2000+20;
const int maxm=(int) 1e5+20;
const int maxk=(int) 5e2+20;

inline int sig(double x) {return x<-eps?-1:x>eps;}

//--------------start------------------

int n;
int a[maxn];
int dp[maxn][2];
int X,Y;

int DP(int i,int t,int x,int y)
{
    if(i==n+1) return Abs(x-y);
    if(dp[i][t]!=-1) return dp[i][t];

    if(t)
    {
        int mx=-SINF;
        for(int j=i;j<=n;j++) Max(mx,DP(j+1,!t,a[j],y));
        return dp[i][t]=mx;
    }
    else
    {
        int mn=SINF;
        for(int j=i;j<=n;j++) Min(mn,Abs(j+1,!t,x,a[j]));
        return dp[i][t]=mn;
    }
}

void work()
{
    read(n), read(X), read(Y);
    for(int i=1;i<=n;i++) read(a[i]);

    memset(dp,-1,sizeof(dp));
    printf("%d\n",DP(1,1,X,Y));

}

//--------------end--------------------

int main()
{
#ifdef yukihana0416
freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
#endif // yukihana0416
    work();
    return 0;
}


Compiler output:
a.cc: In function 'int DP(int, int, int, int)':
a.cc:90:41: error: no matching function for call to 'Abs(int, bool, int&, int&)'
   90 |         for(int j=i;j<=n;j++) Min(mn,Abs(j+1,!t,x,a[j]));
      |                                      ~~~^~~~~~~~~~~~~~~
a.cc:53:33: note: candidate: 'template<class T> T Abs(T)'
   53 | template< typename T > inline T Abs(T a) {if(a<0) return -a; else return a;}
      |                                 ^~~
a.cc:53:33: note:   candidate expects 1 argument, 4 provided
Language: C++

#include <iostream>
#include <vector>
#include <cstdlib>

int main(void)
{

    // n カードの枚数
    // z Xの初期カード
    // w Xの初期カード
    int n=0, z=0, w=0;
    std::cin >> n >> z >> w;

    std::vector<int> cards(n);
    for(auto& card : cards)std::cin >> card;

    if(n==1){
        std::cout << abs(cards[0] - w) << std::endl;
    } else {
        // Xはすべて取るか、1枚残すかのいずれかを選択する
        int patter_1 = abs(cards[n-2] - cards[n-1]);
        int patter_2 = abs(cards[n-1] - w); 
            
        std::cout << (pattern_1 > pattern_2 ? pattern_1 : pattern_2) << std::endl;
    }   

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:23: error: 'pattern_1' was not declared in this scope; did you mean 'patter_1'?
   24 |         std::cout << (pattern_1 > pattern_2 ? pattern_1 : pattern_2) << std::endl;
      |                       ^~~~~~~~~
      |                       patter_1
a.cc:24:35: error: 'pattern_2' was not declared in this scope; did you mean 'patter_2'?
   24 |         std::cout << (pattern_1 > pattern_2 ? pattern_1 : pattern_2) << std::endl;
      |                                   ^~~~~~~~~
      |                                   patter_2
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
using ll = long long int;
ll arr[2010] = {};

int main(void){
ll n,z,w;
cin >> n >> z >> w;
for(int i = 1; i <= n; i++)
  cin >> arr[i];

cout << max(abs(a[n]-w),abs(a[n-1] - a[n])) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'a' was not declared in this scope
   14 | cout << max(abs(a[n]-w),abs(a[n-1] - a[n])) << endl;
      |                 ^
Language: C++

#include <bits/stdc++.h>

#define fr first
#define sc second
#define OK puts("OK");
#define pb push_back
#define mk make_pair

using namespace std;

typedef long long ll;

const int inf = (int)1e9 + 7;
const int N = (int)1e5 + 7;

int n,x,y;
int a[N];
int mx,mn = inf;

int main () {
        cin >> n >> x >> y;

        for (int i = 1; i <= n; i ++) {
                cin >> a[i];
        }
        for (int i = 1; i <= n; i ++) {
                mx = max(mx,abs(a[i] - a[n]))
        }
        if (n != 1)
                mx = max(mx,abs(a[n] - x));

        mx = max(mx,abs(a[n] - y));

        cout << abs (x - y) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:46: error: expected ';' before '}' token
   27 |                 mx = max(mx,abs(a[i] - a[n]))
      |                                              ^
      |                                              ;
   28 |         }
      |         ~