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

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

int main(){
	int n;
	cin >> n;
	int a[n];
	for(in=0;in<n;in++){
		cin >> a[in];
	}

	int b[n];
	b[0] = a[0];
	for(in=0;in<n/2;in++){
		b[0] += a[2*in+1]-a[2*in+2];
	}
	for(in=0;in<n-1;in++){
		b[i+1] = a[i+1]-b[i];
	}

	for(in=0;in<n;in++){
		cout << b[i];
	}


	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: 'in' was not declared in this scope; did you mean 'n'?
    9 |         for(in=0;in<n;in++){
      |             ^~
      |             n
a.cc:15:13: error: 'in' was not declared in this scope; did you mean 'n'?
   15 |         for(in=0;in<n/2;in++){
      |             ^~
      |             n
a.cc:18:13: error: 'in' was not declared in this scope; did you mean 'n'?
   18 |         for(in=0;in<n-1;in++){
      |             ^~
      |             n
a.cc:19:19: error: 'i' was not declared in this scope
   19 |                 b[i+1] = a[i+1]-b[i];
      |                   ^
a.cc:22:13: error: 'in' was not declared in this scope; did you mean 'n'?
   22 |         for(in=0;in<n;in++){
      |             ^~
      |             n
a.cc:23:27: error: 'i' was not declared in this scope
   23 |                 cout << b[i];
      |                           ^
Language: C++

#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<functional>
#include<algorithm>
#include<bitset>
#include<utility>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
using namespace std;
#define ll long long;
int main()
{
	int n;
	cin>>n;
	vector<ll>a(n);
	for(int i=0;i<n;i++)
		cin>>a[i];
	ll cur=0;
	for (int i=0;i<n;i++)
		cur=a[i]-cur;
	vector<ll>ans(n);
	ans[0]=cur/2;
	for(int i=1;i<n;i++)
		ans[i]=a[i-1]-ans[i-1];
	for(int i=0;i<n;i++)
		cout<<2LL*ans[i]<<" \n"[i==n-1];
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: template argument 1 is invalid
   21 | #define ll long long;
      |                 ^~~~
a.cc:26:16: note: in expansion of macro 'll'
   26 |         vector<ll>a(n);
      |                ^~
a.cc:21:17: error: template argument 2 is invalid
   21 | #define ll long long;
      |                 ^~~~
a.cc:26:16: note: in expansion of macro 'll'
   26 |         vector<ll>a(n);
      |                ^~
a.cc:26:18: error: expected primary-expression before '>' token
   26 |         vector<ll>a(n);
      |                  ^
a.cc:26:19: error: 'a' was not declared in this scope
   26 |         vector<ll>a(n);
      |                   ^
a.cc:21:17: error: declaration does not declare anything [-fpermissive]
   21 | #define ll long long;
      |                 ^~~~
a.cc:29:9: note: in expansion of macro 'll'
   29 |         ll cur=0;
      |         ^~
a.cc:29:12: error: 'cur' was not declared in this scope
   29 |         ll cur=0;
      |            ^~~
a.cc:21:17: error: template argument 1 is invalid
   21 | #define ll long long;
      |                 ^~~~
a.cc:32:16: note: in expansion of macro 'll'
   32 |         vector<ll>ans(n);
      |                ^~
a.cc:21:17: error: template argument 2 is invalid
   21 | #define ll long long;
      |                 ^~~~
a.cc:32:16: note: in expansion of macro 'll'
   32 |         vector<ll>ans(n);
      |                ^~
a.cc:32:18: error: expected primary-expression before '>' token
   32 |         vector<ll>ans(n);
      |                  ^
a.cc:32:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
   32 |         vector<ll>ans(n);
      |                   ^~~
      |                   abs
Language: C++

#pragma once

#include "Macro.h"

class ABC133D
{
public:
	ABC133D()
	{
		cin >> n;

		a.resize(n);
		rep(i, 0, n)
			cin >> a[i];
	}
	void Run(void)
	{
		vector<ll> ans(n);
		
		repr(i, n - 1, -1)
			ans[0] += (i % 2 == 0) ? a[i] * 2: -a[i] * 2;
		ans[0] /= 2;

		rep(i, 1, n)
			ans[i] = a[i - 1] * 2 - ans[i - 1];

		for (const auto& e : ans)
			cout << e << " ";
	}
private:
	ll n;
	vector<ll> a;
};

class ABC133D
{
public:
	ABC133D()
	{
		cin >> n;

		a.resize(n);
		rep(i, 0, n)
			cin >> a[i];
	}
	void Run(void)
	{
		vector<ll> ans(n);
		
		repr(i, n - 1, -1)
			ans[0] += (i % 2 == 0) ? a[i] * 2: -a[i] * 2;
		ans[0] /= 2;

		rep(i, 1, n)
			ans[i] = a[i - 1] * 2 - ans[i - 1];

		for (const auto& e : ans)
			cout << e << " ";
	}
private:
	ll n;
	vector<ll> a;
};

int main(void)
{
	ABC133D abc133d;
	abc133d.Run();

	return 0;
}

Compiler output:
a.cc:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
a.cc:3:10: fatal error: Macro.h: No such file or directory
    3 | #include "Macro.h"
      |          ^~~~~~~~~
compilation terminated.
Language: C++

void solve();

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

//////////////////////////////////////////////////
//////////////////////////////////////////////////
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>

using namespace std;

int N;
vector<long double> A;
void solve() {
	cin >> N;
	A.resize(N);
	for (int n = 0; n < N; n++)cin >> A[n];
	long double s = 0, e = LDBL_MAX/2;
	while (e - s > 1e-6) {
		long double x0 = (e + s) / 2;
		long double x = x0;
		for (int n = 0; n < N - 1; n++)x = A[n] - x;
		if (A[N - 1] < x + x0)e = x0;
		else s = x0;
	}
	vector<int> x;
	x.resize(N);
	x[0] = (int)round(s);
	for (int n = 1; n < N; n++)x[n] = A[n - 1] - x[n - 1];
	for (int n = 0; n < N; n++) {
		cout << 2*x[n] << endl;
	}
	return;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:26:32: error: 'LDBL_MAX' was not declared in this scope
   26 |         long double s = 0, e = LDBL_MAX/2;
      |                                ^~~~~~~~
a.cc:17:1: note: 'LDBL_MAX' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
   16 | #include <limits.h>
  +++ |+#include <cfloat>
   17 |
Language: C++

void solve();

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

//////////////////////////////////////////////////
//////////////////////////////////////////////////
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <iomanip>
#include <string>
#include <math.h>

using namespace std;

int N;
vector<long double> A;
void solve() {
	cin >> N;
	A.resize(N);
	for (int n = 0; n < N; n++)cin >> A[n];
	long double s = 0, e = LDBL_MAX/2;
	while (e - s > 1e-6) {
		long double x0 = (e + s) / 2;
		long double x = x0;
		for (int n = 0; n < N - 1; n++)x = A[n] - x;
		if (A[N - 1] < x + x0)e = x0;
		else s = x0;
	}
	vector<int> x;
	x.resize(N);
	x[0] = (int)round(s);
	for (int n = 1; n < N; n++)x[n] = A[n - 1] - x[n - 1];
	for (int n = 0; n < N; n++) {
		cout << 2*x[n] << endl;
	}
	return;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:26:32: error: 'LDBL_MAX' was not declared in this scope
   26 |         long double s = 0, e = LDBL_MAX/2;
      |                                ^~~~~~~~
a.cc:17:1: note: 'LDBL_MAX' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
   16 | #include <math.h>
  +++ |+#include <cfloat>
   17 |
Language: C++

#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}
 
#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};
 
    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
 
    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}
 
#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };
 
    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };
 
    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };
 
    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };
 
    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };
 
    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}


fn main() {
    input! {
        N: u32,
        A: [i64; N],
    }
    let mut res:i64 = 0;
    for i in 0..N {
        if i % 2 == 1 {
            res = res - A[i as usize];
        } else {
            res = res + A[i as usize];
        }
    }
    print!("{} ", res);
    for i in 0..N-1 {
        res = (A[i as usize] - res / 2) * 2;
        print!("{} ", res);
    }
    println!("");
}



Compiler output:
a.cc:1:2: error: invalid preprocessing directive #[
    1 | #[allow(unused_macros)]
      |  ^
a.cc:23:2: error: invalid preprocessing directive #[
   23 | #[allow(unused_macros)]
      |  ^
a.cc:39:2: error: invalid preprocessing directive #[
   39 | #[allow(unused_macros)]
      |  ^
a.cc:46:10: error: too many decimal points in number
   46 |         (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
      |          ^~~~~~~
a.cc:73:14: error: too many decimal points in number
   73 |     for i in 0..N {
      |              ^~~~
a.cc:81:14: error: too many decimal points in number
   81 |     for i in 0..N-1 {
      |              ^~~~
a.cc:2:1: error: 'macro_rules' does not name a type
    2 | macro_rules! input {
      | ^~~~~~~~~~~
a.cc:24:1: error: 'macro_rules' does not name a type
   24 | macro_rules! input_inner {
      | ^~~~~~~~~~~
a.cc:40:1: error: 'macro_rules' does not name a type
   40 | macro_rules! read_value {
      | ^~~~~~~~~~~
a.cc:67:1: error: 'fn' does not name a type
   67 | fn main() {
      | ^~
Language: C

#include <stdio.h>
int main(){
	int n,x,c=0;
	scanf("%d",&n);
	long int a[n];
	for(int i=0;i<n;i++){
		scanf("%ld",&a[i]);
		c+=a[i];
		if(i%2!=0)
			c-=a[i]*2;
	}
	x=calc;
	for(int i = 0;i<n;i++){
		printf("%ld ",x);
		x=a[i]*2-x;
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:11: error: 'calc' undeclared (first use in this function)
   12 |         x=calc;
      |           ^~~~
main.c:12:11: note: each undeclared identifier is reported only once for each function it appears in
Language: C++


#include<iostream>
#include<math.h>
#include<algorithm>
#include<windows.h>


using namespace std;



#define Int int64_t
#define dump(x) cout << (x) << endl
#define fi first
#define se second
Int mod = 1e9 + 7;
Int INF = 1e18;
double EPS = 0.00000001;
//Int mod = 1e6+3;


int main() {
		int n;
		int a[100001], s = 0;
		cin >> n;
		for (int i = 0; i < n; i++) {
			cin >> a[i];
			if (i % 2 == 0)
				s += a[i];
			else
				s -= a[i];
		}
		cout << s;
		s = s / 2;
		for (int i = 0; i < n - 1; i++) {
			s = a[i] - s;
			cout << " " << 2 * s;
		}
		cout << endl;

}


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


#include<iostream>
#include<math.h>
#include<algorithm>
#include<windows.h>


using namespace std;



#define Int int64_t
#define dump(x) cout << (x) << endl
#define fi first
#define se second
Int mod = 1e9 + 7;
Int INF = 1e18;
double EPS = 0.00000001;
//Int mod = 1e6+3;


int main() {
		int n;
		long long int a[100001], s = 0;
		cin >> n;
		for (int i = 0; i < n; i++) {
			cin >> a[i];
			if (i % 2 == 0)
				s += a[i];
			else
				s -= a[i];
		}
		cout << s;
		s = s / 2;
		for (int i = 0; i < n - 1; i++) {
			s = a[i] - s;
			cout << " " << 2 * s;
		}
		cout << endl;

}


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

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define rep1(i,n) for (int i = 1; i <= (n); i++)
#define repf(i,a,b) for (int i = (a); i < (b); i++)
#define repi(i,a,b) for (int i = (a); i <= (b); i++)
#define repr(i,a,b) for (int i = (a); i >= (b); i--)
#define all(x) (x).begin(),(x).end()
#define debug(x)  cout << #x << " = " << (x) << endl;
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using tiii = tuple<int, int, int>;

int main() {
  int N; cin >> N;
  vi A(n); rep(i,N) cin >> A.at(0);
  
  ll x2 = 0;
  rep(i,N) {
    if (i%2) 
      x2 -= A.at(i);
    else
      x2 += A.at(i);
  }
  
  vi ans(N);
  ans.at(0) = x2/2;
  rep(i,N-1) {
    ans.at(i+1) = A.at(i) - ans.at(i);
  }
  rep(i,N) ans.at(i) *= 2;
  rep(i,N) printf("%d%c", ans.at(i), i==n-1?'\n':' ');
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:8: error: 'n' was not declared in this scope
   23 |   vi A(n); rep(i,N) cin >> A.at(0);
      |        ^
Language: C++

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

int main(void){
  int n;
  cin>>n;
  vector<ll>a(n),b(n);
  for(int i=0;i<n;i++){
    cin>>a[i];
    if(i&1)b[0]-=a[i];
    else b[0]+=a[i];
  b[0]/=2;
  for(int i=1;i<n;i++){
    b[i]=a[i-1]-b[i-1];
  }
  for(int i=0;i<n;i++){
    cout<<2*b[i]<<" ";
  }
  cout<<endl;
}


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

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

int main(void){
  int n;
  cin>>n;
  vector<ll>a(n),b(n);
  for(int i=0;i<n;i++){
    cin>>a[i];
    if(i&1)b[0]-=a[i];
    else b[0]+=a[i];
  b[0]/=2
  for(int i=1;i<n;i++){
    b[i]=a[i-1]-b[i-1];
  }
  for(int i=0;i<n;i++){
    cout<<2*b[i]<<" ";
  }
  cout<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:10: error: expected ';' before 'for'
   15 |   b[0]/=2
      |          ^
      |          ;
   16 |   for(int i=1;i<n;i++){
      |   ~~~     
a.cc:16:22: error: expected ';' before ')' token
   16 |   for(int i=1;i<n;i++){
      |                      ^
      |                      ;
a.cc:23:2: error: expected '}' at end of input
   23 | }
      |  ^
a.cc:7:15: note: to match this '{'
    7 | int main(void){
      |               ^
Language: C++

#include<stdio.h>
#include<stdlib.h>

#define ll long long int

int main() {
  int n;
  scanf("%d", &n);
  ll *a, *m;
  a = malloc(sizeof(ll) * n);
  m = malloc(sizeof(ll) * (n + 1));
  int i, j;
  for(i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
    m[i] = 0;
  }
  for(i = 0; i < n; i++) m[0] += a[i];
  for(i = 1; i < n; i += 2) m[0] -= 2 * a[i];
  for(i = 1; i < n; i++) m[i] = 2 * a[i - 1] - m[i - 1];
  for(i = 0; i < n; i++) printf("%lld ", m[i]);
  printf("\n");
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: invalid conversion from 'void*' to 'long long int*' [-fpermissive]
   10 |   a = malloc(sizeof(ll) * n);
      |       ~~~~~~^~~~~~~~~~~~~~~~
      |             |
      |             void*
a.cc:11:13: error: invalid conversion from 'void*' to 'long long int*' [-fpermissive]
   11 |   m = malloc(sizeof(ll) * (n + 1));
      |       ~~~~~~^~~~~~~~~~~~~~~~~~~~~~
      |             |
      |             void*
Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <cstring>

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;

using namespace std;

int inputValue(){
    int a;
    cin >> a;
    return a;
};

void inputArray(int * p, int a){
    rep(i, a){
        cin >> p[i];
    }
};

void inputVector(vector<int> * p, int a){
    rep(i, a){
        int input;
        cin >> input;
        p -> push_back(input);
    }
}

template <typename T>
void output(T a, int precision) {
    if(precision > 0){
        cout << setprecision(precision)  << a << "\n";
    }
    else{
        cout << a << "\n";
    }
}

int main(int argc, const char * argv[]) {
    int N = inputValue();
    int A[100000];
    int Y[100000];
    inputArray(A, N);
    Y[i] = 0;
    rep(j,N){
      if(j % 2 == 0)
        Y[0] += A[j];
      else
        Y[0] -= A[j];
    }
    repd(i,1,N){
      Y[i] = 2*A[i] - Y[i-1];
    }
    
    rep(i,N){
      cout << Y[i] << " ";
    }
    cout << endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:53:7: error: 'i' was not declared in this scope
   53 |     Y[i] = 0;
      |       ^
Language: C++

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




int main(){
int N,sum;
sum=0;
cin>>N;
int a[N],b[N];

for(int i=0;i<N;i++){
int s;
cin>>s;
sum+=s;
a[i]=s;
}


b[0]=sum;
for(int j=1;j<=(N-2);j+=2){
b[i]-=a[j%N]*2;
}
for(int i=1;i<N;i++) b[i]=2*a[i-1]-b[i-1];

for(int i=0;i<N;i++) cout<<b[i]<<' ';

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:3: error: 'i' was not declared in this scope
   23 | b[i]-=a[j%N]*2;
      |   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,a,b;
  a=0;
  b=1
  cin >> N;
 
  vector<int> math(N); // N個の数学の点数データ
  vector<int> english(N); // N個の英語の点数データ
 
  // 数学の点数データを受け取る
  for (int i = 0; i < N; i++) {
    cin >> math.at(i);
    a=a+b*math.at(i);
    b=-1*b;
  }
 cout<<a<<endl;
  for (int i = 1; i < N; i++) {
    a=math.at(i)-a;
    cout<<a;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: expected ';' before 'cin'
    7 |   b=1
      |      ^
      |      ;
    8 |   cin >> N;
      |   ~~~
Language: C++

#include <iostream>
#include <vector>

#define int long long

using namespace std;

int main()
{
	int n;
	vector<int> a;
	vector<int> x;

	cin >> n;

	a.resize(n);
	x.resize(n);
	for(int i = 0; i < n; ++i)
	{
		cin >> a[i];
	}

	int sign = 1;
	for(int i = 0; i < n; ++i)
	{
		x[0] += a[i] * sign;
		sign *= -1;
	}

	for(int i = n - 1; i > 0; --i)
	{
		x[i] = 2 * a[i] - x[(i + 1) % n];
	}

	cout << x[0];
	for(int i = 1; i < n; ++i)
	{
		cout << " " << x[i];
	}
	cout << endl;
}

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

#include <bits/stdc++.h>
using namespace std;
//#define rep(i,s,e) for(long long i = s; i < e; i++)
long long N;
void vec_diff(double *a, double* b){
    /* Calcurate the difference of two vectors. Be caution that b[N] changes.*/
    for (long long i = 0; i < N; i++){
        b[i] -= a[i];
    }
}


long long main()
{
	long long n;
	cin >> n;
	double b[n];
	N = n;
	for(long long i=0;i<n;i++)
	{
		cin >> b[i];
	}
	double m[n][n];
	memset(m,0,sizeof(m));

	for (long long i = 0; i < n-1; i++)
	{
		m[i][i] = 1;
		m[i][i+1] = 1;
	}
	m[n-1][0] = m[n-1][n-1] = 1;
	

    for (long long i = 0; i < N; i++){
        for (long long j = 0; j < N; j++){
            //prlong longf("%1.f ", m[i][j]);
            if (j == N-1){
                //prlong longf("\n");
            }
        }
    }

    for (long long i = 0; i < N; i++){
        for (long long j = i+1; j < N; j++){
            double coef = m[j][i] / m[i][i];
            double del[N];

            for (long long k = 0; k < N; k++){
                del[k] = m[i][k] * coef;
            }
            vec_diff(del, m[j]);
            b[j] -= b[i] * coef;
        }
    }

    for (long long i = N -1; i >= 0; i--){
        double x = 1. / m[i][i];
        m[i][i] *= x;
        b[i] *= x;

        for (long long j = 0; j < i; j++){
            b[j] -= b[i]*m[j][i];
            m[j][i] = 0;
        }
    }

    for (long long i = 0; i < N; i++){
        for (long long j = 0; j < N; j++){
            //prlong longf("%1.f ", m[i][j]);
            if (j == N - 1){
                //prlong longf("\n");
            }
        }
    }

    for (long long i = 0; i < N; i++){
        prlong longf("%d ", 2*(long long)b[i]);
    }

	


    return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
a.cc: In function 'int main()':
a.cc:77:9: error: 'prlong' was not declared in this scope; did you mean 'ulong'?
   77 |         prlong longf("%d ", 2*(long long)b[i]);
      |         ^~~~~~
      |         ulong
Language: C++

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

    vector<int>A(N,0);
    vector<int>B(N,0);

    for(int i=0;i<N;i++){
        cin >> A[i];
    }

    if(A[0]%2==0){
        B[0] += A[0]/2;
        B[1] += A[0]/2;
    }else if(A[0]<A[N-1]){
        B[0] += A[0]/2;
        B[1] += A[0]/2 +1;
    }else{
        B[1] += A[0]/2;
        B[0] += A[0]/2 +1;
    }

    for(int i=1;i<N;i++){
        int r = A[i]-B[i];
        B[i] = B[i]*2;
        B[i+1] += r;
    }
    
    for(int i=0;i<N;i++){
            if(i==N-1){
                cout << B[i] << endl;
            }else{
            cout << B[i] << " ";
            }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> N;
      |     ^~~
a.cc:5:5: error: 'vector' was not declared in this scope
    5 |     vector<int>A(N,0);
      |     ^~~~~~
a.cc:5:12: error: expected primary-expression before 'int'
    5 |     vector<int>A(N,0);
      |            ^~~
a.cc:6:12: error: expected primary-expression before 'int'
    6 |     vector<int>B(N,0);
      |            ^~~
a.cc:9:16: error: 'A' was not declared in this scope
    9 |         cin >> A[i];
      |                ^
a.cc:12:8: error: 'A' was not declared in this scope
   12 |     if(A[0]%2==0){
      |        ^
a.cc:13:9: error: 'B' was not declared in this scope
   13 |         B[0] += A[0]/2;
      |         ^
a.cc:16:9: error: 'B' was not declared in this scope
   16 |         B[0] += A[0]/2;
      |         ^
a.cc:19:9: error: 'B' was not declared in this scope
   19 |         B[1] += A[0]/2;
      |         ^
a.cc:24:17: error: 'A' was not declared in this scope
   24 |         int r = A[i]-B[i];
      |                 ^
a.cc:24:22: error: 'B' was not declared in this scope
   24 |         int r = A[i]-B[i];
      |                      ^
a.cc:31:17: error: 'cout' was not declared in this scope
   31 |                 cout << B[i] << endl;
      |                 ^~~~
a.cc:31:25: error: 'B' was not declared in this scope
   31 |                 cout << B[i] << endl;
      |                         ^
a.cc:31:33: error: 'endl' was not declared in this scope
   31 |                 cout << B[i] << endl;
      |                                 ^~~~
a.cc:33:13: error: 'cout' was not declared in this scope
   33 |             cout << B[i] << " ";
      |             ^~~~
a.cc:33:21: error: 'B' was not declared in this scope
   33 |             cout << B[i] << " ";
      |                     ^
Language: C++

#include"bits/stdc++.h"
using namespace std;
int n;
int a[100000];
int main()
{
	scanf("%d",&n);
	for(int i=0;i<=n;i++)
		scanf("%d",&a[i]);
	for(int)
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: expected unqualified-id before ')' token
   10 |         for(int)
      |                ^
a.cc:10:16: error: expected ';' before ')' token
   10 |         for(int)
      |                ^
      |                ;
a.cc:10:16: error: expected primary-expression before ')' token
a.cc:10:16: error: expected ';' before ')' token
   10 |         for(int)
      |                ^
      |                ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;cin>>N;
  vector<int> A(N),B(N);
  for(int i=0;i<N;i++){
    cin >> A.at(i);
  }
  B.at(0) = A.at(N-1);
  int a = 0;
    for(int j=1;j<N;){
      B.at(0) += A.at(a);
      a++;
      j++;
      if(a == N) a = 0;
      B.at(0) -= A.at(a);
      a++;
      j++;
      if(a == N) a = 0;
    }
  for(int i=1;i<N;i++){
    if(i % 2 == 0){
      B.at(i) += 2*A.at(i-1);
    }
    else B.at(i) -= 2*A.at(i-1);
  for(int i=0;i<N;i++){
    cout << B.at(i) <<endl;
  }
}


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

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define rep1(i,n) for (int i = 1; i <= (n); i++)
#define repf(i,a,b) for (int i = (a); i < (b); i++)
#define repi(i,a,b) for (int i = (a); i <= (b); i++)
#define repr(i,a,b) for (int i = (a); i >= (b); i--)
#define all(x) (x).begin(),(x).end()
#define debug(x)  cout << #x << " = " << (x) << endl;
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using tiii = tuple<int, int, int>;

int main() {
  ll N; cin >> N;
  vector<ll> A(2*N); rep(i,N) cin >> A.at(i);
  rep(i,N) A.push_back(A.at(i));
  
  ll sumA = 0;
  rep(i,N) {
    sumA += A.at(i);
  }
  
  ll tmp;
  int a = 0;
  for(int k = 0; k<N; k++) {
    for(int i = k; a=N/2; i+=2) {
      a = 0;
      tmp = sumA;
      tmp -= 2*A.at(i+1);
      a++
    }

    cout << tmp << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:10: error: expected ';' before '}' token
   38 |       a++
      |          ^
      |          ;
   39 |     }
      |     ~
Language: C++

#include <algorithm>
#include <iostream>
#include <limits.h>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <vector>
#include <cstdio>
#include <iomanip>
#define ll long long
#define rep2(i,a,b) for(int i=a;i<=b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define rep3(i,a,b) for(int i=a;i>=b;i--)
#define REP(e,v) for(auto e:v)
#define queint queue<int>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pq priority_queue<int>//大きい順
#define pqg priority_queue<int,vec,greater<int>>//小さい順
#define pb push_back
#define vec vector<int>
#define vecvec vector<vector<int>>
#define vecll vector<ll>
#define vecvecll vector<vector<ll>>
#define bs binary_search
#define All(c) (c).begin(),(c).end()
#define mp make_pair
using namespace std;
int in(){int x;scanf("%d",&x);return x;}
string stin(){string s;cin>>s;return s;}
ll lin(){ll x;scanf("%lld",&x);return x;}
int main(){
    int n=in();
    vecll a(n);
    rep(i,n)a[i]=in()*2;
    vecll s(n);
    ll l=-2;
    ll r=(a[0]+a[1]+2);
    while(l+1<r){
        ll mi=(l+r)/2;
        s[0]=mi;
        rep(i,n){
            s[(i+1)%n]=2*a[i]-s[i];
        }
        if(s[0]>mi)l=mi;
        else  r=mi;
    }
    s[0]=r;
    rep(i,n){
        s[(i+1)%n]=2*a[i]-s[i];
        cout<<s[i]/2<<" ";
      if(s[i]<0){
        while(true){
          int a=1;
        }
    }
}

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

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <numeric>
#include <queue>
#include <vector>
#include <cmath>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <set>

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repl(i, n) for(LL i = 0; i < (LL)(n); i++)

int main(void){
  int n;
  cin >> n;

  vector<LL> a(n, 0);
  LL sum = 0;

  rep(i, n) {
    cin >> a[i];
    if (i % 2 == 0) {
      sum += a[i];
    } else {
      sum -= a[i];
    }
  }

  LL diff = sum / 2;
  cout << diff * 2 << " ";

  LL ans = alpha;

  rep(i, n-1) {
    ans = a[i] - ans;
    cout << ans * 2 << " ";
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:12: error: 'alpha' was not declared in this scope; did you mean 'isalpha'?
   41 |   LL ans = alpha;
      |            ^~~~~
      |            isalpha
Language: C

#include<stdio.h>
#include<stdlib.h>

int main(void) {
	int N, i, j, k,l;
	int* A;
	scanf_s("%d", &N);
	A = (int*)malloc(sizeof(int) * N);
	for (i = 0; i < N; i++) {
		scanf("%d", &A[i]);
	}
	for (i = 0; i < N; i++) {
		int S = 0, T = 0;
		for (j = 0; j < N; j++) {
			S = S + A[j];
		}
		for (k =i - 1; k >= 0; k = k - 2) {
			T = T + A[k];
		}
		for (l = i; l < N; l = l + 2) {
			T = T + A[l];
		}
		printf("%d ", 2 * T - S);
	}
	free(A);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |         scanf_s("%d", &N);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define watch(x) cout << (#x) << " is " << (x) << endl

#define fast                          \

	ios_base::sync_with_stdio(false); \	cin.tie(NULL);

#define FOR(n) for(int i(0);i<n;++i)

#define ASC(i,a,b) for(int i(a); i <=b; ++i)

#define DESC(i,a,b) for(int i(a);i>=b;i--)

#define WL(t) while(t--)

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

#define SZ(a) int((a).size())

#define PB push_back

#define MP make_pair

#define FF first

#define SS second

#define BB begin()

#define EE end()

#define all(c) c.BB, c.EE

#define present(container, element) (container.find(element) != container.end())

// ^^for set,map etc

#define cpresent(container, element) (find(all(container), element) != container.end())

// for vector,array etc

#define tr(container, it) for (auto it = container.begin(); it != container.end(); it++)

#define gcd(a, b) __gcd((a), (b))

#define lcm(a, b) ((a) * (b)) / gcd((a), (b))

#define count(x) __builtin_popcount(x) 

typedef long long LL;

typedef long double LD;

typedef vector<int> vi;

typedef vector<LL> vl;

typedef map<char,int> mci;

typedef pair<int, int> pii;

typedef map<int,pii> ipii;

const float INF = numeric_limits<float>::infinity();

const int MOD = 1e9 + 7;

const double PI = 3.14159265358979323846264338;

const LL big=998244353;

#ifdef _DEBUG

freopen("input.txt", "r", stdin);

freopen("output.txt", "w", stdout);

#endif

int main(){

	int n;

	cin >> n;

	int arr[n];

	forr(i,n) cin >> arr[i];

	int m1=0;

	forr(i,n){

		if(i&1) m1-=arr[i];

		else m1+=arr[i];

	}

	int go[n];

	go[0]=m1;

	for(int i(1);i<n;++i){

		go[i]=2*arr[i-1]-go[i-1];

	}

	for(int i(0);i<n;++i){

		cout << go[i] << " ";

	}

}

Compiler output:
a.cc:9:43: error: stray '\' in program
    9 |         ios_base::sync_with_stdio(false); \     cin.tie(NULL);
      |                                           ^
a.cc:9:34: error: expected constructor, destructor, or type conversion before '(' token
    9 |         ios_base::sync_with_stdio(false); \     cin.tie(NULL);
      |                                  ^
a.cc:9:49: error: 'cin' does not name a type
    9 |         ios_base::sync_with_stdio(false); \     cin.tie(NULL);
      |                                                 ^~~
a.cc: In function 'int main()':
a.cc:19:37: error: expected primary-expression before ')' token
   19 | #define forr(i,n) for(int i(0);i<n;+)
      |                                     ^
a.cc:91:9: note: in expansion of macro 'forr'
   91 |         forr(i,n) cin >> arr[i];
      |         ^~~~
a.cc:19:37: error: expected primary-expression before ')' token
   19 | #define forr(i,n) for(int i(0);i<n;+)
      |                                     ^
a.cc:95:9: note: in expansion of macro 'forr'
   95 |         forr(i,n){
      |         ^~~~
Language: C

#include <stdio.h>
 
int main(void){
  int n
  long int a[100000];
  int i;
  int sum = 0;
  long int ans[100000];
  if(scanf("%d",&n)==1);
  for(i=0;i<n;i++){
    if(scanf("%ld",&a[i])==1);
    sum += a[i];
  }
  
  sum /= 2;
  for(i=2;i<n;i+=2){
    sum -= a[i];
  }
  ans[1] = sum;
  for(i=2;i<n;i++){
    ans[i] = a[i-1] - ans[i-1];
  }
  ans[0] = a[0] - ans[n-1];
  for(i=0;i<n;i++){
    printf("%ld ",2*ans[i]);
  }
  printf("\n");
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:8: error: expected ';' before 'long'
    4 |   int n
      |        ^
      |        ;
    5 |   long int a[100000];
      |   ~~~~  
main.c:9:18: error: 'n' undeclared (first use in this function)
    9 |   if(scanf("%d",&n)==1);
      |                  ^
main.c:9:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
 
int main(void){
  int n
  long int a[100000];
  int i;
  int sum = 0;
  long int ans[100000];
  if(scanf("%d",&n)==1);
  for(i=0;i<n;i++){
    if(scanf("%ld",&a[i])==1);
    sum += a[i];
  }
  
  sum /= 2;
  for(i=2;i<n;i+=2){
    sum -= a[i];
  }
  ans[1] = sum;
  for(i=2;i<n;i++){
    ans[i] = a[i] - ans[i-1];
  }
  ans[0] = a[0] - ans[n-1];
  for(i=0;i<n;i++){
    printf("%ld ",2*ans[i]);
  }
  printf("\n");
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:8: error: expected ';' before 'long'
    4 |   int n
      |        ^
      |        ;
    5 |   long int a[100000];
      |   ~~~~  
main.c:9:18: error: 'n' undeclared (first use in this function)
    9 |   if(scanf("%d",&n)==1);
      |                  ^
main.c:9:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N;
  int A[100000];
  int M[100000];
  cin >> N;

  for (int i =0; i < N; i++){
    cin >> A[i];
  }


  M[1] = A[0];

  for(int i = 1; i < N; i++){
    if(i%2 == 0){
      M[1] -= A[i];
    } else{
      M[1] += A[i];
    }
  }

  M[0] = 2 * A[0] - M[1];

  cout << M[0] << " " << M[1];

  for (int i = 2; i< N){
    M[i] = 2 * A[i] - M[i];
    cout << " " << M[i];
  }

  cout << endl;


  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:23: error: expected ';' before ')' token
   29 |   for (int i = 2; i< N){
      |                       ^
      |                       ;
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();
		double[] a = new double[N];
		for (int i = 0; i < N; i++) {
			a[i] = sc.nextDouble();
		}
		long[][] b = new long[N][N + 1];
		for (int i = 0; i < N; i++) {
			for (int j = 0; j < N; j++) {
				if (j == i || j == i + 1 || (i == N - 1 && j == 0)) {
					b[i][j] = 0.5;
				} else {
					b[i][j] = 0;
				}
			}
			b[i][N] = a[i];
		}

		for (int k = 0; k < N - 1; k++) {
			for (int i = k + 1; i < N; i++) {
				double d = b[i][k] / b[k][k];
				for (int j = k + 1; j <= N; j++) {
					b[i][j] -= b[k][j] * d;
				}
			}
		}
		for (int i = N - 1; i >= 0; i--) {
			double d = b[i][N];
			for (int j = i + 1; j < N; j++) {
				d -= b[i][j] * b[j][N];
			}
			b[i][N] = d / b[i][i];
		}
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < N; i++) {
			if (i > 0) {
				sb.append(" ");
			}
			sb.append((int)b[i][N]);
		}
		System.out.println(sb.toString());
	}
}

Compiler output:
Main.java:14: error: incompatible types: possible lossy conversion from double to long
					b[i][j] = 0.5;
					          ^
Main.java:19: error: incompatible types: possible lossy conversion from double to long
			b[i][N] = a[i];
			           ^
Main.java:35: error: incompatible types: possible lossy conversion from double to long
			b[i][N] = d / b[i][i];
			            ^
3 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ll n,sum=0;
    cin>>n;
    vector<ll>a(n),cnt(n);
    for(int i=0;i<n;i++){
        cin>>a[i];
        sum+=a[i];
    }
    sum/=2;
    ll odd=0,even=0;
    for(int j=0;j<(n-1)/2;j++){
        even+=a[(1+j*2)%n];
    }
    cnt[0]=sum-even;
    for(int j=0;j<(n-1)/2;j++){
        odd+=a[(2+j*2)%n];
    }
    cnt[1]=sum-odd;
    for(int i=2;i<n;i+=2){
        even=even-a[(i+n-1)%n]+a[(i+n-2)%n];
        cnt[i]=sum-even;
    }
    for(int i=3;i<n;i+=2){
        odd=odd-a[(i+n-1)%n]+a[(i+n-2)%n];
        cnt[i]=sum-odd;
    }
    for(int i=0;i<n;i++){
        cout<<ans[i]*2<<" ";
    }
    cout<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   31 |         cout<<ans[i]*2<<" ";
      |               ^~~
      |               abs
Language: C++

#include <iostream>
#include <cstring>
#include <vector>
#include <algorithm>
#include <numeric>
#include <mutex>
#include <cmath>
#include <set>
#include <climits>
#define lli long long int
#define ll long long
#define mod 1000000007
#define pii pair<int,int>
#define mp make_pair
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;


int main(){
        int n;
        cin >> n;
        int a[n];
        int b[n];
        it ans[n];
        rep(i,n){
          cin >> a[i];
          b[i] = 2 * a[i];
        }
        ans[1] = b[1] - b[0];
        for(int j = 2; j < n; j++){
          ans[j] = b[j-1] - ans[j-1];
        }
        ans[0] = b[0] - ans[1];
        rep(k, n){
          cout << ans[k];
        }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'it' was not declared in this scope; did you mean 'int'?
   24 |         it ans[n];
      |         ^~
      |         int
a.cc:29:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   29 |         ans[1] = b[1] - b[0];
      |         ^~~
      |         abs
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args){
    	Scanner s=new Scanner(System.in);
      	int n=s.nextInt();
      long[] dams=new long[n];
      for(int i=0;i<n;i++)arr[i]=s.nextInt();
      long sum=0;
      for(int i=0;i<n-1;i++){
    	if(i%2==0)sum+=dams[i];
        else sum-=dams[i];
      }
      long tempsum=sum+dams[n-1];
      tempsum/=2;
      long[] mountains=new long[n];
      mountains[0]=tempsum;
      for(int i=1;i<n;i++){
      	mountains[i]=dams[i]*2-mountains[i-1];
      }
      for(int i=0;i<n;i++){
      	System.out.print(mountains[i]+" ");
      }
     }
}

Compiler output:
Main.java:8: error: cannot find symbol
      for(int i=0;i<n;i++)arr[i]=s.nextInt();
                          ^
  symbol:   variable arr
  location: class Main
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int n,i,wa=0,hiku=0,a;
  cin>>n;
  int a[n];
  for(i=0;i<n;i++){
    cin>>a[i];
    wa+=a[i];
    if(i%2==1){
      hiku+=a[i];
    }
  }
  a=(wa/2)-hiku;
  for(i=0;i<n;i++){
    cout<<2*a<<" ";
    a=a[i]-a;
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: conflicting declaration 'int a [n]'
    7 |   int a[n];
      |       ^
a.cc:5:23: note: previous declaration as 'int a'
    5 |   int n,i,wa=0,hiku=0,a;
      |                       ^
a.cc:9:11: error: invalid types 'int[int]' for array subscript
    9 |     cin>>a[i];
      |           ^
a.cc:10:10: error: invalid types 'int[int]' for array subscript
   10 |     wa+=a[i];
      |          ^
a.cc:12:14: error: invalid types 'int[int]' for array subscript
   12 |       hiku+=a[i];
      |              ^
a.cc:18:8: error: invalid types 'int[int]' for array subscript
   18 |     a=a[i]-a;
      |        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int a,b.c;
  cin>>>a>>b>>c;
  cout<<a*c<<a+b<<b*c;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: expected initializer before '.' token
    5 |   int a,b.c;
      |          ^
a.cc:6:8: error: expected primary-expression before '>' token
    6 |   cin>>>a>>b>>c;
      |        ^
a.cc:6:12: error: 'b' was not declared in this scope
    6 |   cin>>>a>>b>>c;
      |            ^
a.cc:6:15: error: 'c' was not declared in this scope
    6 |   cin>>>a>>b>>c;
      |               ^
Language: C++

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


using namespace std;
using ll = long long;

const ll mod = 1000000007;

ll N, a[100000];

//山iに振った雨
ll ans[100000];
ll sumrain;
ll temps;

int main()
{
	cin >> N;
	for (int i = 0; i < N; i++)
	{
		cin >> a[i];
		sumrain += a[i];
	}
	for (int i = 0; i < N - 1; i += 2)
	{
		temps += a[i];
	}
	temps *= 2;
	ans[N - 1] = sumrain - temps;
	for (int i = 0; i < N - 1; i++)
	{
		int x = (i + N - 1) % N;
		ans[i] = a[x] * 2 - ans[x];
	}
	cout << ans[i];
	for (int i = 1; i < N; i++)
	{
		cout << ' ' << ans[i] << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:21: error: 'i' was not declared in this scope
   39 |         cout << ans[i];
      |                     ^
Language: C++

#include <vector>
#include <iostream>
#include <cmath>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <fstream>
#include <unistd.h>
#include <string>
#include <numeric>
#include <queue>
#include <deque>
#include <sstream>
#include <iomanip>
#include <set>
#include <stack>
#include <cassert>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vvb> vvvb;
typedef vector<vvvb> vvvvb;
typedef vector<string> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<char> vc;
typedef vector<vector<char>> vvc;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvd> vvvd;
typedef pair<ll, ll> PL;
typedef vector<PL> vpl;
typedef vector<vector<PL>> vvpl;
const int INF = 1001001001;
const ll LINF = 1e17;
const double pi = 3.1415926535897932;
const string endstr = "\n";
#define FOR(i, a, b) for(ll i = (a); i < b; i++)
#define RFOR(i, a, b) for(ll i = (a); i > b; i--)
#define rep(i, n) for(ll i = 0; i < n; i++)
#define rrep(i, n) for(ll i = n-1; i > -1; i--)
#define FORMAP(it, m) for(auto it = m.begin(); it != m.end(); it++)
#define ff first
#define ss second
#define pb push_back
#define epb emplace_back

template <typename T>
T gcd(T a, T b) {
    return (a == 0) ? b : gcd(b%a, a);
}
template <typename T>
T lcm(T a, T b) {
    return a / gcd(a, b) * b;
}

bool p_comp_fs(const PL p1, const PL p2){ return p1.first < p2.first;};
bool p_comp_fg(const PL p1, const PL p2){ return p1.first > p2.first;};
bool p_comp_ss(const PL p1, const PL p2){ return p1.second < p2.second;};
bool p_comp_sg(const PL p1, const PL p2){ return p1.second > p2.second;};
template <typename T>
vector<T> uniquen(vector<T> vec){
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
    return vec;
}

inline ll popcnt(ll x){return __builtin_popcount((unsigned int)x);};
template<class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }

int main(){
tdio(false);
    cin.tie(nullptr);
    ll N; cin >> N;
    vl A(N); rep(i, N) cin >> A[i];
    
    ll sum = 0;
    rep(i, N-1){
        if(i%2 == 0) sum -= A[i];
        else sum += A[i];
    }
    
    ll x = A[N-1] - sum;
    
    rep(i, N){
        cout << x << " ";
        x = 2*A[i] - x;
    }
    cout << endstr;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:79:1: error: 'tdio' was not declared in this scope
   79 | tdio(false);
      | ^~~~
Language: C++

#include<bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll MAX_N = 100000;
ll N;vector<ll> g[MAX_N];
bool visit[MAX_N] = {},put[MAX_N] = {};
queue<ll> q;
ll dis(ll s){
  ll ans = 0,i,j;
  for(i=0;i<g[s].size();i++){
    if(visit[g[s][i]]) ans++;
    if(!put[g[s][i]]){
      q.push(g[s][i]);
      put[g[s][i]] = true;
    }
    for(j=0;j<g[g[s][i]].size();j++){
      if(visit[g[g[s][i]][j]]) ans++;
    }
  }
  return ans;
}
int main(){
  ll K,i,a,b,f;scanf("%lld%lld",&N,&K);
  for(i=0;i<N-1;i++){
    scanf("%lld%lld",&a,&b);a--;b--;
    g[a].emplace_back(b);
    g[b].emplace_back(a);
  }
  ll ans = 1;vector<ll> P;
  P.emplace_back(0);
  q.push(0);put[0] = true;
  while(!q.empty()){
    f = q.front();q.pop();
    ans = ans*(K-dis(f))%mod;
    if(ans <= 0){
      printf("0\n");return 0;
    }
    visit[f] = true;
  }
  printf("%lld\n",ans);
}


Compiler output:
a.cc: In function 'll dis(ll)':
a.cc:15:8: error: reference to 'visit' is ambiguous
   15 |     if(visit[g[s][i]]) ans++;
      |        ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:10:6: note:                 'bool visit [100000]'
   10 | bool visit[MAX_N] = {},put[MAX_N] = {};
      |      ^~~~~
a.cc:21:10: error: reference to 'visit' is ambiguous
   21 |       if(visit[g[g[s][i]][j]]) ans++;
      |          ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:10:6: note:                 'bool visit [100000]'
   10 | bool visit[MAX_N] = {},put[MAX_N] = {};
      |      ^~~~~
a.cc: In function 'int main()':
a.cc:42:5: error: reference to 'visit' is ambiguous
   42 |     visit[f] = true;
      |     ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:10:6: note:                 'bool visit [100000]'
   10 | bool visit[MAX_N] = {},put[MAX_N] = {};
      |      ^~~~~
Language: Java

import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;


public class Main2 {

    static class Vertex {

        int num;

        List<Integer> edges = new LinkedList<>();

        public Vertex(int num) {

            this.num = num;
        }
    }

    static int N;

    static int K;

    static long result = 1;

    static long mod = 1000000007;
    static int[] leaf;

    static Vertex[] nodes;


    static boolean check[];

    public static void main(String[] args) {

        Scanner s = new Scanner(System.in);

        N = s.nextInt();

        K = s.nextInt();

        leaf = new int[N];

        nodes = new Vertex[N+1];

        check = new boolean[N+1];

        for (int i = 1; i <= N; i++) {

            nodes[i]= new Vertex(i);
        }

        for (int i = 0; i < N-1; i++) {

            int v1 = s.nextInt();

            int v2 = s.nextInt();

            nodes[v1].edges.add(v2);

            nodes[v2].edges.add(v1);
        }



        System.out.println( (K *dfs(nodes[1],0)) %mod);

    }

    public static long dfs(Vertex v , int depth) {

        int num = Math.max(K-2, K-depth-1);

        long tot = 1;

        for (int k : v.edges) {

            if (check[k] == true) continue;
            tot *= num;

            tot %= mod;

            num--;


        }
        check[v.num] = true;

        for (int k : v.edges) {


            if (check[k] == true) continue;

            tot *= dfs(nodes[k], depth+1);

            tot %= mod;
        }

        return tot;

    }
}


Compiler output:
Main.java:6: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
       ^
1 error