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

//C++14 (Clang 3.8.0)

#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string>

typedef long long ll;
using namespace std;
const int MAX_N=1e5+1;
const int MAX_Q=1e5+1;
ll MAX_q=1e18+1;
ll a[MAX_N];
ll t[MAX_N];

int binsearch(vector<ll> x,ll y,int z){
    int l=-1,r=z,mid;
    while(r-l>1){
        mid=(l+r) / 2;
        if(y >= x[mid]) l=mid;
        else  r = mid;
    }
    return r;
}

int main(){
    int N;
    int Q;
    cin>>N>>Q;
    vector<ll> q;
    q.push_back(N);
    for(int i =0;i<Q;i++) {
        ll x;
        cin>>x;
        while(!q.empty() && q.back() >= x) q.pop_back();
        q.push_back(x);
    }

    int L = q.size() - 1;
    t[L] = 1;

    for(int i = L;i >0;i--){
        ll k=q[i];
        bef=i-1;
        while(k>q[0]){
            int ind=binsearch(q,k,bef);
            t[ind]+=t[i]*(k/q[ind]);
            k=k%q[ind];
            bef=ind;
        }
        a[k-1]+=t[i];
    }
    a[q[0]-1] += t[0];
    for(int i=N-1;i>=0;i--) a[i]+=a[i+1];
    for(int i=0;i<N;i++) cout<<a[i]<<endl;    
    return 0;
};


Compiler output:
a.cc: In function 'int main()':
a.cc:60:9: error: 'bef' was not declared in this scope
   60 |         bef=i-1;
      |         ^~~
Language: C

#include "stdio.h"
#include "climits"

int i = 0;
int j = 0;
int far;
int retu[100000];
int trynum;
int getnum[100000];
int num[100000];
int start;
int min();
int box;
int little;
int prev;
int startbox;
int cal;


int main() {

	scanf("%d", &far);
	scanf("%d", &trynum);
	for (i = 0; i < trynum; i++) {
		scanf("%d", &getnum[i]);
	}
	start = 0;
	startbox = 0;
	prev = 0;
	for (i = 0; i < min(); i++) {
		if (i >= 100000) {
			num[i % 100000]++;
		}
		num[i]++;
	}
	little = min();
	printf("%d\n\n", little);
	if (little >= 100000)little = 100000;
	prev = min();;
	start = startbox + 1 ;
	while (start != trynum) {
			for (i = 0; i < little; i++) {
				num[i] *= (min() / prev);
			}
			cal = min() % prev;
			for (i = 0; i < cal; i++) {
				num[i%little]++;
			}
			prev = min();
			start = startbox+1;
	}
	for (i = 0; i < far; i++) {
		printf("%d\n",num[i]);
	}
	



	return 0;

}

int min() {
	box = INT_MAX;
	for (j = start; j < trynum; j++) {
		if (getnum[j] < box) {
			box = getnum[j];
			startbox = j;
		}
	}
	return box;
}

Compiler output:
main.c:2:10: fatal error: climits: No such file or directory
    2 | #include "climits"
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include <cstdio>
using namespace std;
const int Mod = 1e9 + 7;
int Ad(int x, int y) { return ((x + y) > Mod) ? (x + y - Mod) : (x + y); }
int Dc(int x, int y) { return ((x - y) < 0) ? (x - y + Mod) : (x - y); }
int Ml(int x, int y) { return (long long)x * y % Mod; }
int ksm(int x, long long y) {
	int ret = 1;
	for (; y; y >>= 1, x = Ml(x, x))
		if (y & 1ll)
			ret = Ml(ret, x);
	return ret;
}
struct Matrix {
	int r, c, A[2][2];
	Matrix() : r(0), c(0) {}
	Matrix(int _r, int _c, int a00, int a01, int a10, int a11) : r(_r), c(_c) {
		A[0][0] = a00;
		A[0][1] = a01;
		A[1][0] = a10;
		A[1][1] = a11;
	}
	void Print() {
		printf("r : %d c : %d\n", r, c);
		for (int i = 0; i < r; ++i) {
			for (int j = 0; j < c; ++j)
				printf("%d ", A[i][j]);
			printf("\n");
		}
	}
};
Matrix operator*(const Matrix &a, const Matrix &b) {
	Matrix ret;
	ret.r = a.r;
	ret.c = b.c;
	for (int i = 0; i < ret.r; ++i)
		for (int j = 0; j < ret.c; ++j) {
			ret.A[i][j] = 0;
			for (int k = 0; k < a.c; ++k)
				ret.A[i][j] = Ad(ret.A[i][j], Ml(a.A[i][k], b.A[k][j]));
		}
	return ret;
}
void ksm(Matrix &ans, Matrix x, ll y) {
	for (; y; y >>= 1, x = x * x)
		if (y & 1) ans = ans * x;
}
int eup, edown, H, W, ud, lr;
const int NH = 1e3 + 5;
char base[NH][NH];
long long K;
int main() {
	scanf("%d%d%lld", &H, &W, &K);
	for (int i = 1; i <= H; ++i) scanf("%s", base[i] + 1);
	for (int i = 1; i <= W; ++i) if (base[1][i] == '#') ud += (base[1][i] == base[H][i]);
	for (int i = 1; i <= H; ++i) if (base[i][1] == '#') lr += (base[i][1] == base[i][W]);
	if (ud && lr)
		printf("1\n");
	else if (ud || lr) {
		Matrix ans(1, 2, 1, 1, 0, 0);
		int cnt = 0;
		for (int i = 1; i <= H; ++i)
			for (int j = 1; j <= W; ++j)
				cnt += (base[i][j] == '#');
		int con = 0;
		if (ud) {
			for (int i = 2; i <= H; ++i)
				for (int j = 1; j <= W; ++j)
					if (base[i][j] == '#')
						con += (base[i][j] == base[i-1][j]);
		} else {
			for (int i = 1; i <= H; ++i)
				for (int j = 2; j <= W; ++j)
					if (base[i][j] == '#')
						con += (base[i][j] == base[i][j-1]);
		}
		Matrix b(2, 2, cnt, 0, Dc(0, con), ud | lr);
		ksm(ans, b, K-1);
		printf("%d\n", ans.A[0][0]);
	} else {
		int cnt = 0;
		for (int i = 1; i <= H; ++i)
			for (int j = 1; j <= W; ++j)
				cnt += (base[i][j] == '#');
		printf("%d\n", ksm(cnt, K - 1));
	}
	return 0;
}

Compiler output:
a.cc:44:33: error: 'll' has not been declared
   44 | void ksm(Matrix &ans, Matrix x, ll y) {
      |                                 ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
#define int long long
const int P = 1e9 + 7;
int h, w, cnt, s1, s2, f1, f2; lint k;
char s[1050][1050];
struct Maxtir {
	int a[10][10], n;
	void init(int _n, int x) {n = _n; memset(a, 0, sizeof a); for(int i = 1; i <= n; ++i) a[i][i] = x;}
	Maxtir operator *(const Maxtir &b) const {
		Maxtir c; c.init(n, 0);
		for(int i = 1; i <= n; ++i)
			for(int j = 1; j <= n; ++j)
				for(int k = 1; k <= n; ++k)
					c.a[i][j] = (c.a[i][j] + 1ll * a[i][k] * b.a[k][j] % P) % P;
		return c;
	}
};
int pint(int a, lint b) {
	int res = 0;
	for(; b; a = 1ll*a*a%P, b>>=1) if(b&1) res=1ll*res*a%P;
	return res;
}
Maxtir pmax(Maxtir a, lint b) {
	Maxtir res; res.init(a.n, 1);
	for(; b; a = a * a, b >>= 1) if(b&1) res = res * a;
	return res;
}
signed main() {
	scanf("%lld%lld%lld", &h, &w, &k)
	for(int i = 1; i <= h; ++i) {
		scanf("%s", s[i]+1);
		for(int j = 1; j <= w; ++j) {
			//while(s[i][j] = getchar(), s[i][j] != '#' && s[i][j] != '.');
			cnt += (s[i][j] == '#');
			s1 += (s[i][j] == '#' && s[i][j-1] == '#');
			s2 += (s[i][j] == '#' && s[i-1][j] == '#');
		}
		f1 += (s[i][1] == '#' && s[i][w] == '#');
	}
	for(int i = 1; i <= w; ++i) f2 += (s[1][i] == '#' && s[h][i] == '#');
	if(f1 && f2) {puts("1"); return 0;}
	if(!f1 && !f2) {printf("%lld\n", pint(cnt, k-1)); return 0;}
	if(!f1) swap(f1, f2), swap(s1, s2);
	Maxtir ori; ori.init(2, 0);
	ori.a[1][1]	= cnt; ori.a[2][1] = s1; ori.a[2][2] = f1;
	ori = pmax(ori, k-1);
	printf("%lld\n", (ori.a[1][1] - ori.a[2][1] + P) % P);
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:31:42: error: expected ';' before 'for'
   31 |         scanf("%lld%lld%lld", &h, &w, &k)
      |                                          ^
      |                                          ;
   32 |         for(int i = 1; i <= h; ++i) {
      |         ~~~                               
a.cc:32:24: error: 'i' was not declared in this scope
   32 |         for(int i = 1; i <= h; ++i) {
      |                        ^
Language: C++

#include<algorithm>
using namespace std;
const int N = 1005, P = 1e9 + 7;
int h, w, num, o1, o2, s;
using ll = long long;
ll k;
char m[N][N];

int qp (int a, ll b) {
	int c = 1; for (; b; b >>= 1, a = 1ll * a * a % P) if (b & 1) c = 1ll * c * a % P; return c;
}

struct Matrix {
	int T[2][2];
	Matrix () { T[0][0] = T[0][1] = T[1][0] = T[1][1] = 0; }
}S, T;

void Mul (Matrix &CC, const Matrix &A, const Matrix &B) {
	static Matrix C;
	C.T[0][0] = (1ll * A.T[0][0] * B.T[0][0] + 1ll * A.T[0][1] * B.T[1][0]) % P;
	C.T[0][1] = (1ll * A.T[0][0] * B.T[0][1] + 1ll * A.T[0][1] * B.T[1][1]) % P;
	C.T[1][0] = (1ll * A.T[1][0] * B.T[0][0] + 1ll * A.T[1][1] * B.T[1][0]) % P;
	C.T[1][1] = (1ll * A.T[1][0] * B.T[0][1] + 1ll * A.T[1][1] * B.T[1][1]) % P;
	CC = C;
}

void mqp (const Matrix &AA, Matrix &CC, ll b) {
	static Matrix A, C;
	C = A = AA; --b;
	for (; b; b >>= 1, Mul(A, A, A)) if (b & 1) Mul(C, C, A);
	CC = C;
}

int main () {
	scanf("%d%d%lld", &h, &w, &k);
	if (k <= 1) return puts("1"), 0; --k;
	for (int i = 1; i <= h; ++i) {
		scanf("%s", m[i] + 1);
		for (int j = 1; j <= w; ++j) if (m[i][j] == '#') {
			++num;
			if (j > 1 && m[i][j - 1] == '#')
			++s;
		}
	}
	for (int i = 1; i <= h; ++i) if (m[i][1] == '#' && m[i][w] == '#') ++o1;
	for (int i = 1; i <= w; ++i) if (m[1][i] == '#' && m[h][i] == '#') ++o2;
	if (o1 > o2) o1 ^= o2 ^= o1 ^= o2;
	if (o1) return puts("1"), 0;
	if (!o2) return printf("%d\n", qp(num, k)), 0;
	T.T[0][0] = o2; T.T[1][0] = s; T.T[1][1] = num;
	S.T[0][0] = 0; S.T[0][1] = 1;
	mqp(T, T, k);
//	for (int i = 1; i <= k; ++i) 
//	Mul(S, S, T);
	Mul(S, S, T);
	printf("%d\n", (S.T[0][1] - S.T[0][0] + P) % P);
	return 0;
}
/*
5 5 10000000000000000
#.#.#
#####
.###.
#####
#.#.#
*/

Compiler output:
a.cc: In function 'int main()':
a.cc:35:9: error: 'scanf' was not declared in this scope
   35 |         scanf("%d%d%lld", &h, &w, &k);
      |         ^~~~~
a.cc:36:28: error: 'puts' was not declared in this scope
   36 |         if (k <= 1) return puts("1"), 0; --k;
      |                            ^~~~
a.cc:48:24: error: 'puts' was not declared in this scope
   48 |         if (o1) return puts("1"), 0;
      |                        ^~~~
a.cc:49:25: error: 'printf' was not declared in this scope
   49 |         if (!o2) return printf("%d\n", qp(num, k)), 0;
      |                         ^~~~~~
a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    1 | #include<algorithm>
  +++ |+#include <cstdio>
    2 | using namespace std;
a.cc:56:9: error: 'printf' was not declared in this scope
   56 |         printf("%d\n", (S.T[0][1] - S.T[0][0] + P) % P);
      |         ^~~~~~
a.cc:56:9: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
ll modpow(ll x,ll n)
{
	ll res=1;
	while(n>0)
	{
		if(n&1) res=res*x%mod;
		x=x*x%mod;
		n>>=1;
	}
	return res;
}
int n,m; ll k;
char f[2005][1005];
int main(){
	scanf("%d%d",&n,&m); cin>>M;
	if(M<=1){ puts("1"); return 0;}
	for(int i=0;i<n;i++) scanf("%s",&f[i]);
	bool tate=0,yoko=0;
	for(int i=0;i<n;i++){
		if(f[i][0]=='#' && f[i][m-1]=='#'){
			yoko = 1;
		}
	}
	for(int i=0;i<m;i++){
		if(f[0][i]=='#' && f[n-1][i]=='#'){
			tate = 1;
		}
	}
	if(yoko&&tate){
		puts("1"); return 0;
	}
	if(!yoko&&!tate){
		ll ans = 0;
		for(int i=0;i<n;i++) for(int j=0;j<m;j++) ans+=f[i][j]=='#';
		cout<<modpow(ans,M-1)<<endl; return 0;
	}
	if(yoko){
		ll val = 0,c = 0;
		for(int i=0;i<n;i++){
			for(int j=0;j<m-1;j++){
				if(f[i][j]=='#' && f[i][j+1]=='#'){
					val++;
				}
			}
			for(int j=0;j<m;j++) c+=f[i][j]=='#';
		}
		ll ans = modpow(c,k-1);
		ll x = val * modpow(c,k-2)%mod;
		ll y = val * modpow(c,mod-2) % mod;
		//x+...x*y^(k-2)
		ll z;
		if(y==1) z = k-1;
		else z = (modpow(y,k-1)-1)*modpow(y-1,mod-2)%mod;
		cout<<(ans-x*z%mod+mod)%mod<<endl;
	}
	else{
		ll val = 0,c = 0;
		for(int i=0;i<n-1;i++){
			for(int j=0;j<m;j++){
				if(f[i][j]=='#' && f[i+1][j]=='#'){
					val++;
				}
			}
			for(int j=0;j<m;j++) c+=f[i][j]=='#';
		}
		ll ans = modpow(c,k-1);
		ll x = val * modpow(c,k-2)%mod;
		ll y = val * modpow(c,mod-2) % mod;
		//x+...x*y^(k-2)
		ll z;
		if(y==1) z = k-1;
		else z = (modpow(y,k-1)-1)*modpow(y-1,mod-2)%mod;
		cout<<(ans-x*z%mod+mod)%mod<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:35: error: 'M' was not declared in this scope
   34 |         scanf("%d%d",&n,&m); cin>>M;
      |                                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
ll modpow(ll x,ll n)
{
	ll res=1;
	while(n>0)
	{
		if(n&1) res=res*x%mod;
		x=x*x%mod;
		n>>=1;
	}
	return res;
}
int n,m; ll M;
char f[2005][1005];
int main(){
	scanf("%d%d",&n,&m); cin>>M;
	if(M<=1){ puts("1"); return 0;}
	for(int i=0;i<n;i++) scanf("%s",&f[i]);
	bool tate=0,yoko=0;
	for(int i=0;i<n;i++){
		if(f[i][0]=='#' && f[i][m-1]=='#'){
			yoko = 1;
		}
	}
	for(int i=0;i<m;i++){
		if(f[0][i]=='#' && f[n-1][i]=='#'){
			tate = 1;
		}
	}
	if(yoko&&tate){
		puts("1"); return 0;
	}
	if(!yoko&&!tate){
		ll ans = 0;
		for(int i=0;i<n;i++) for(int j=0;j<m;j++) ans+=f[i][j]=='#';
		cout<<modpow(ans,M-1)<<endl; return 0;
	}
	if(yoko){
		ll val = 0,c = 0;
		for(int i=0;i<n;i++){
			for(int j=0;j<m-1;j++){
				if(f[i][j]=='#' && f[i][j+1]=='#'){
					val++;
				}
			}
			for(int j=0;j<m;j++) c+=f[i][j]=='#';
		}
		ll ans = modpow(c,k-1);
		ll x = val * modpow(c,k-2)%mod;
		ll y = val * modpow(c,mod-2) % mod;
		//x+...x*y^(k-2)
		ll z;
		if(y==1) z = k-1;
		else z = (modpow(y,k-1)-1)*modpow(y-1,mod-2)%mod;
		cout<<(ans-x*z%mod+mod)%mod<<endl;
	}
	else{
		ll val = 0,c = 0;
		for(int i=0;i<n-1;i++){
			for(int j=0;j<m;j++){
				if(f[i][j]=='#' && f[i+1][j]=='#'){
					val++;
				}
			}
			for(int j=0;j<m;j++) c+=f[i][j]=='#';
		}
		ll ans = modpow(c,k-1);
		ll x = val * modpow(c,k-2)%mod;
		ll y = val * modpow(c,mod-2) % mod;
		//x+...x*y^(k-2)
		ll z;
		if(y==1) z = k-1;
		else z = (modpow(y,k-1)-1)*modpow(y-1,mod-2)%mod;
		cout<<(ans-x*z%mod+mod)%mod<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:35: error: 'k' was not declared in this scope
   66 |                 ll ans = modpow(c,k-1);
      |                                   ^
a.cc:85:35: error: 'k' was not declared in this scope
   85 |                 ll ans = modpow(c,k-1);
      |                                   ^
Language: C

//ProblemD.cpp

#include <iostream>

static std::istream & ip = std::cin;
static std::ostream & op = std::cout;

#if OJ_MYPC
#include <ojio.h>
#endif

#ifndef OPENOJIO
#define OPENOJIO
#endif

#if 1 || DEFINE
/***************************************************************/
typedef unsigned long long u64;
typedef long long s64;

typedef unsigned uint;

#define ABS(x) ((x) > 0 ? (x) : -(x))

#define MIN(x, y) ((x) < (y) ? (x) : (y))
#define MAX(x, y) ((x) > (y) ? (x) : (y))

#define MIN3(x, y, z) MIN(x, MIN(y, z))
#define MAX3(x, y, z) MAX(x, MAX(y, z))

#define FillZero(arr) memset(arr, 0, sizeof(arr));

/***************************************************************/
#endif //1 || DEFINE

#include <string>
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <queue>
#include <stack>
#include <utility>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <cmath>
#include <cstdio>

//001
//op << setfill('0') << setw(3) << setiosflags(ios::right) << 1;

//op << fixed << setprecision(20);

using namespace std;

//ProblemD.cpp

/*
a[1] = a, b[1] = b, c[1] = c

a[n+1] = a[n]*a = a^n
b[n+1] = a[n]*b + b[n]*c
c[n+1] = c[n]*c = c^n

-> b[n+1] = b(a^(n-1) + b(a^(n-2))+...+b^(n-1))
          = b * (a^n - c^n)) / (a - c)
		  = b * (a^n - c^n) * k
		  ((a-c) * k = 1(mod p))

x[n+1] = a[n+1] - b[n+1]
*/

#define MOD 1000000007

static s64 getpow(s64 a, s64 x, s64 m = MOD) {
	if (x == 0) return 1;
	a = a % m; if (a < 0) a += m;

	s64 mul = a;
	s64 rst = 1;
	while (x)
	{
		if (x & 1) rst = rst * mul % m;

		x >>= 1;
		mul = mul * mul % m;
	}
	return rst;
}

#define MAXSIZE 1010

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

	int h, w;
	s64 k;
	ip >> h >> w >> k;

	s64 a, bx, cx, by, cy;
	a = bx = cx = by = cy = 0;

	static int s[MAXSIZE][MAXSIZE];
	for(int i = 0; i < h; ++i)
		for (int j = 0; j < w; ++j) {
			char tc; 
			ip >> tc;
			s[i][j] = tc == '#';
			a += s[i][j];
		}

	for (int i = 0; i < h; ++i) {
		if (s[i][0] && s[i][w - 1]) ++cx;
		for (int j = 0; j < w - 1; ++j)
		{
			if (s[i][j] && s[i][j + 1]) ++bx;
		}
	}

	for (int j = 0; j < w; ++j) {
		if (s[0][j] && s[h - 1][j]) ++cy;
		for (int i = 0; i < h - 1; ++i) {
			if (s[i][j] && s[i + 1][j]) ++by;
		}
	}

	s64 rst = 1;
	if (k <= 1) rst = 1;
	else if (cx > 0 && cy > 0) rst = 1;
	else if (cx == 0 && cy == 0) {
		rst = getpow(a, k - 1);
	}
	else {
		s64 b, c;
		if (cx > 0) { b = bx; c = cx; }
		else { b = by; c = cy; }

		s64 ak = getpow(a, k - 1);
		s64 ck = getpow(c, k - 1);

		s64 a_c = a - c;
		s64 inv = getpow(a_c, MOD - 2);
		s64 bk = (ak - ck) % MOD * b % MOD * inv % MOD;

		rst = (ak - bk) % MOD;
		if (rst < 0) rst += MOD;
	}

	cout << rst << endl;

	return 0;
}
/***************************************************************/


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

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

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

#define forn(i, a, n) for (int i = a; i < n; ++i)
#define ford(i, a, n) for (int i = n - 1; i >= a; --i)
#define fore(i, a, n) for (int i = a; i <= n; ++i)
#define all(a) (a).begin(), (a).end()
#define fs first
#define sn second
#define trace(a)\
	for (auto i : a) cerr << i << ' ';\
	cerr << '\n'
#define eb emplace_back

#ifndef M_PI
const ld M_PI = acos(-1.0);
#endif

const ld eps = 1e-9;
const int INF = 2000000000;
const ll LINF = 1ll * INF * INF;
const ll MOD = 1000000007;

struct Matrix {
	ll a[2][2];

	Matrix () {};

	Matrix (int cells, int inBound, int outBound) {
		a[0][0] = cells;
		a[0][1] = -inBound;
		if (a[0][1] < 0) a[0][1] += MOD;
		a[1][0] = 0;
		a[1][1] = outBound;
	}

	Matrix operator* (Matrix other) {
		Matrix m(0, 0, 0);
		forn(i, 0, 2) forn(j, 0, 2) forn(k, 0, 2) {
			m.a[i][k] += a[i][j] * other.a[j][k];
			m.a[i][k] %= MOD;
		}
		return m;
	}

	Matrix Pow (ll k) {
		Matrix x = *this, y = Matrix(1, 0, 1);
		while (k) {
			if (k % 2) y = x * y;
			x = x * x;
			k /= 2;
		}
		return y;
	}
};

ll Pow (ll n, ll k) {
	ll x = n, y = 1;
	while (k) {
		if (k % 2) y = y * x % MOD;
		x = x * x % MOD;
		k /= 2;
	}
	return y;
}

const int N = 1002;
char a[N][N];

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int h, w;
	ll k;
	cin >> h >> w >> k;
	if (k <= 1) {
		cout << "1\n";
		return 0;
	}
	forn(i, 0, h) gets(a[i]);
	bool ver = false, hor = false;
	forn(i, 0, h) if (a[i][0] == '#' && a[i][w - 1] == '#') hor = true;
	forn(i, 0, w) if (a[0][i] == '#' && a[h - 1][i] == '#') ver = true;
	if (hor && ver) {
		cout << "1\n";
		return 0;
	}
	int sz = 0;
	forn(i, 0, h) forn(j, 0, w) if (a[i][j] == '#') ++sz;
	if (!hor && !ver) {
		cout << Pow(sz, k - 1) << '\n';
		return 0;
	}
	if (ver) {
		forn(i, 0, N) forn(j, 0, i) swap(a[i][j], a[j][i]);
		swap(h, w);
	}
	int in = 0;
	forn(i, 0, h) forn(j, 0, w - 1) if (a[i][j] == '#' && a[i][j + 1] == '#') ++in;
	int out = 0;
	forn(i, 0, h) if (a[i][0] == '#' && a[i][w - 1] == '#') ++out;
	Matrix M = Matrix(sz, in, out);
	Matrix P = M.Pow(k - 1);
	cout << (P.a[0][0] + P.a[0][1]) % MOD << '\n';
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:84:23: error: 'gets' was not declared in this scope; did you mean 'getw'?
   84 |         forn(i, 0, h) gets(a[i]);
      |                       ^~~~
      |                       getw
Language: C++

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

#define llong long long 
#define len(x) ((int)x.size())
#define rep(i,n) for (int i = -1; ++ i < n; )
#define rep1(i,n) for (int i = 0; i ++ < n; )
#define rand __rand
mt19937 rng(chrono::system_clock::now().time_since_epoch().count());  // or mt19937_64
template<class T = int> T rand(T range = numeric_limits<T>::max()) { return (T)(rng() % range); }

#define CONCAT_(x, y) x##y/*{{{*/
#define CONCAT(x, y) CONCAT_(x, y)
#ifdef LOCAL_DEBUG   
int __db_level = 0;
bool __db_same_line = false;
#define clog cerr << string(!__db_same_line ? __db_level * 2 : 0, ' ')
struct debug_block {
    function<void()> fn;
    void print_name() { __db_same_line = true; fn(); clog << endl; __db_same_line = false;  }
    debug_block(function<void()> fn_): fn(fn_) { clog << "{ "; print_name(); ++__db_level; }
    ~debug_block() { --__db_level; clog << "} "; print_name(); }
};
#define DB(args...) debug_block CONCAT(dbbl, __LINE__)([=]{ clog << args; })
#define deb(...)  if (1) { (clog << "[" #__VA_ARGS__ "] = [" << __VA_ARGS__) << "]"; if (!__db_same_line) clog << endl; }
#else
#define clog if (0) cerr
#define DB(...)
#define deb(...)
#endif
template<class T>
ostream& operator,(ostream& out, const T& thing) { return out << ", " << thing; }
template<class U, class V>
ostream& operator<<(ostream& out, const pair<U, V>& p) { return (out << "(" << p.first, p.second) << ")"; }
template<class A, class B>
ostream& operator<<(ostream& out, const tuple<A, B>& t) { return (out << "(" << get<0>(t), get<1>(t)) << ")"; }
template<class A, class B, class C>
ostream& operator<<(ostream& out, const tuple<A, B, C>& t) { return (out << "(" << get<0>(t), get<1>(t), get<2>(t)) << ")"; }
template<class T> ostream& operator<<(ostream& out, const vector<T>& container) { 
    out << "{";
    if (len(container)) out << container[0];
    rep1(i, len(container) - 1) out, container[i];
    return out << "}";
}
template<class x> vector<typename x::value_type> $v(const x& a) { return vector<typename x::value_type>(a.begin(), a.end()); }
#define ptrtype(x) typename iterator_traits<x>::value_type
template<class u> vector<ptrtype(u)> $v(u a, u b) { return vector<ptrtype(u)>(a, b); }/*}}}*/
// ACTUAL SOLUTION BELOW ////////////////////////////////////////////////////////////

const int maxn = 111;
int n;
llong a[maxn];
int main(void) {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    
    cin >> n;
    rep(i, n) cin >> a[i];
    llong ans = LLONG_MAX;
        
    for (llong m = -100; m <= 100; ++m) {
        llong cur_ans = 0;
        rep(i, n) cur_ans += (a[i] - m) * (a[i] - m);
        ans = min(ans, cur_ans);
    }
    cout << ans


    return 0;
}

// Remember:
// - Multitest? REFRESHING the data!!!
// - Constrains for each set of data may differs. Should NOT USE the same max constant (maxn)
//   for all of them.
// vim: foldmethod=marker


Compiler output:
a.cc: In function 'int main()':
a.cc:65:16: error: expected ';' before 'return'
   65 |     cout << ans
      |                ^
      |                ;
......
   68 |     return 0;
      |     ~~~~~~
Language: C++

#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define ArraySizeOf(array)     (sizeof(array) / sizeof(array[0]))
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define int long long
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define _GLIBCXX_DEBUG
unsigned NthDayOfWeekToDay(unsigned n, unsigned dow, unsigned dow1)
{
unsigned day;
if(dow < dow1) dow += 7;
day = dow - dow1;
day += 7 * n - 6;
return day;
}
unsigned DayToWeekNumber(unsigned day)
{
  return (day - 1) / 7 + 1;
}
unsigned AnotherDayOfWeek(unsigned day, unsigned day0, unsigned dow0)
{
  return (dow0 + 35 + day - day0) % 7;
}
using namespace std;
signed main(){
int main(){
  int N;
  cin>>N;
  int A,B;
  vector<int>a(N);
  rep(i,N)cin>>a[i];
  sort(a.begin(),a.end());
  rep(i,a[N-1]-a[0]){
    rep(j,N){
      A+=abs(a[j]-i-a[i]);
    }
    if(i!=0)B=min(A,B);
    else B=A;
    A=0;
  }
  cout<<B<<endl;
}

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

                                       //BISMILLAHIR RAHMANIR RAHIM
                                          //By the name of ALLAH
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<iterator>
#include<numeric>
#define pi acos(-1.0)
using namespace std;
bool f(long long int x,long long int y)
{
    return x>y;
}
void solve()
{
    int t;
    cin>>t;
    int a[10000];
    for(int i=0;i<t;i++){
        cin>>a[i];
    }
    int p=ceil((a[0]+a[t-1])/2);
    long long cost=0;
    for(int i=0;i<t;i++){
        cost+=(p-a[i])*(p-a[i]);
    }
   cout<<cost<<endl;
}
int main()
{
    solve();
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:23:11: error: 'ceil' was not declared in this scope
   23 |     int p=ceil((a[0]+a[t-1])/2);
      |           ^~~~
Language: C

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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
  }
  int totalc = 50000;//
  for (int i = -100; i <= 100; i++) {
    int totalc_ati = 0;
    for (int j = 0; j < n; j++) {
      int sa = a.at(j) - i;//(x-y)
      totalc_ati += sa * sa;
    }
    totalc = min(totalc_ati, totalc);
  }
  cout << totalc;
}

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++

n = int(input());
a = list(map(int, input().split()));

a.sort()
ans = 1 << 60
for x in range(a[0], a[n-1]) :
  res = 0
  for j in range(n) :
    res += abs(x - a[j])**2
  ans = min(ans, res)
print(ans)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input());
      | ^
a.cc:2:1: error: 'a' does not name a type
    2 | a = list(map(int, input().split()));
      | ^
a.cc:4:1: error: 'a' does not name a type
    4 | a.sort()
      | ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<long long> a(N);
  long long sun = 0;
  for(int i = 0; i < N; i++) {
    cin >> a[i];
    sum += a[i];
  }
  long long ave = sum / N;
  long long ave2 = ave + 1;
  long long res = 0, res2 = 0;
  for(int i = 0; i < N; i++){
    res += (a[i] - ave) * (a[i] - ave);
    res2 += (a[i] - ave2) *(a[i] - ave2);
  }
  cout << min(res, res2) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'sum' was not declared in this scope; did you mean 'sun'?
   11 |     sum += a[i];
      |     ^~~
      |     sun
a.cc:13:19: error: 'sum' was not declared in this scope; did you mean 'sun'?
   13 |   long long ave = sum / N;
      |                   ^~~
      |                   sun
Language: C++

#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,no-stack-protector,fast-math")
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define IO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
const int N = 1e5 + 5, M = 2 * N + 5;

ll ans(LLONG_MAX)
int n, a[N];

int getCst(int a, int b){
    return (a - b) * (a - b);
}

int check(int x){
    ll ret = 0;
    for(int i = 0 ; i < n ; ++i)
        ret += getCst(x, a[i]);
    return ret;
}

int main(){
    scanf("%d", &n);
    for(int i = 0 ; i < n ; ++i)
        scanf("%d", a + i);

    int mn = *min_element(a, a + n);
    int mx = *max_element(a, a + n);

    for(int x = mn ; x <= mx ; ++x)
        check(x);
    printf("%lld\n", ans);
}

Compiler output:
a.cc:10:1: error: expected ',' or ';' before 'int'
   10 | int n, a[N];
      | ^~~
a.cc: In function 'int check(int)':
a.cc:18:25: error: 'n' was not declared in this scope
   18 |     for(int i = 0 ; i < n ; ++i)
      |                         ^
a.cc:19:26: error: 'a' was not declared in this scope
   19 |         ret += getCst(x, a[i]);
      |                          ^
a.cc: In function 'int main()':
a.cc:24:18: error: 'n' was not declared in this scope
   24 |     scanf("%d", &n);
      |                  ^
a.cc:26:21: error: 'a' was not declared in this scope
   26 |         scanf("%d", a + i);
      |                     ^
a.cc:28:27: error: 'a' was not declared in this scope
   28 |     int mn = *min_element(a, a + n);
      |                           ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int n;
  cin>>n;
  int a[n];
  for(int i=0;i<n;i++){
    cin>>a[i];
    sum+=a[i];
  }
  int p=sum/n;
  int ans1=0,ans2=0;
  for(int i=0;i<n;i++){
    ans1+=((a[i]-p)*(a[i]-p));
    ans2+((a[i]-(p+1))*(a[i]-(p+1)));
  }
  cout<<min(ans1,ans2)<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'sum' was not declared in this scope
    9 |     sum+=a[i];
      |     ^~~
a.cc:11:9: error: 'sum' was not declared in this scope
   11 |   int p=sum/n;
      |         ^~~
Language: C++

int main() {
    int N;
    cin >> N;
    int sum = 0;
    vector<int> A(N);
    rep(i, N) {
        cin >> A[i];
        sum += A[i];
    }
    int mean = sum / N;
    int can1, can2, can3, can4;
    can1 = mean + 1;
    can2 = mean + 2;
    can3 = mean - 1;
    can4 = mean - 2;

    int res, res1, res2, res3, res4;
    res = 0, res1 = 0, res2 = 0, res3 = 0, res4 = 0;
    rep(i, N) { res += pow((A[i] - mean), 2); }

    rep(i, N) { res1 += pow((A[i] - can1), 2); }

    rep(i, N) { res2 += pow((A[i] - can2), 2); }

    rep(i, N) { res3 += pow((A[i] - can3), 2); }

    rep(i, N) { res4 += pow((A[i] - can4), 2); }

    res = min(res, min(res1, min(res2, min(res3, res4))));
    cout << res << endl;
}

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);
      |     ^~~~~~
a.cc:5:12: error: expected primary-expression before 'int'
    5 |     vector<int> A(N);
      |            ^~~
a.cc:6:9: error: 'i' was not declared in this scope
    6 |     rep(i, N) {
      |         ^
a.cc:6:5: error: 'rep' was not declared in this scope
    6 |     rep(i, N) {
      |     ^~~
a.cc:29:40: error: 'min' was not declared in this scope; did you mean 'main'?
   29 |     res = min(res, min(res1, min(res2, min(res3, res4))));
      |                                        ^~~
      |                                        main
a.cc:29:30: error: 'min' was not declared in this scope; did you mean 'main'?
   29 |     res = min(res, min(res1, min(res2, min(res3, res4))));
      |                              ^~~
      |                              main
a.cc:29:20: error: 'min' was not declared in this scope; did you mean 'main'?
   29 |     res = min(res, min(res1, min(res2, min(res3, res4))));
      |                    ^~~
      |                    main
a.cc:29:11: error: 'min' was not declared in this scope; did you mean 'main'?
   29 |     res = min(res, min(res1, min(res2, min(res3, res4))));
      |           ^~~
      |           main
a.cc:30:5: error: 'cout' was not declared in this scope
   30 |     cout << res << endl;
      |     ^~~~
a.cc:30:20: error: 'endl' was not declared in this scope
   30 |     cout << res << endl;
      |                    ^~~~
Language: C++

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

int main() {
  int n, m = 1000000000;
  cin >> n;
  vector<int> v(n);
  rep(i, n) cin >> v[i];
  sort(v.begin(), v.end());
  rep(i, n){
    int tmp = 0
    rep(j, n) tmp += (v[i]-v[j])*(v[i]-v[j]);
    m = min(m, tmp);
  }
  cout << m << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:19: error: expected ',' or ';' before 'for'
    3 | #define rep(i, n) for(int i = 0; i < n; ++i)
      |                   ^~~
a.cc:14:5: note: in expansion of macro 'rep'
   14 |     rep(j, n) tmp += (v[i]-v[j])*(v[i]-v[j]);
      |     ^~~
a.cc:14:9: error: 'j' was not declared in this scope
   14 |     rep(j, n) tmp += (v[i]-v[j])*(v[i]-v[j]);
      |         ^
a.cc:3:34: note: in definition of macro 'rep'
    3 | #define rep(i, n) for(int i = 0; i < n; ++i)
      |                                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int A[MAXN];
int N;
int sub;
int ans;

int main(){
	cin>>N;
  	for (int i=1;i<=N;++i)cin>>A[i];
  ans = 1000000000;
  	for (int x=-100;x<=100;++x){
    	sub=0;
      	for (int i=1;i<=N;++i)sub += (A[i] - x)*(A[i]-x);
      	ans = min(ans,sub);
    }
  cout<<ans;
}

Compiler output:
a.cc:3:7: error: 'MAXN' was not declared in this scope
    3 | int A[MAXN];
      |       ^~~~
a.cc: In function 'int main()':
a.cc:10:36: error: 'A' was not declared in this scope
   10 |         for (int i=1;i<=N;++i)cin>>A[i];
      |                                    ^
a.cc:14:39: error: 'A' was not declared in this scope
   14 |         for (int i=1;i<=N;++i)sub += (A[i] - x)*(A[i]-x);
      |                                       ^
Language: Java

import java.io.*;
import java.util.*;


public class BeTogether {

   
    public static void main(String[] args) {
    FastReader sc=new FastReader();
    int N=sc.nextInt();
    int[] a=new int[N];
    double sum=0;
    for(int i=0;i<N;i++){
        a[i]=sc.nextInt();
        sum+=a[i];    
    }
  int avg=(int)Math.round(sum/N);
 int mini=0;
 for(int i=0;i<N;i++){
 mini+=Math.pow(a[i]-avg,2);
 }
        System.out.print(mini);
    
    
    }
    
}



class FastReader{
    BufferedReader br ;
    StringTokenizer st;
public FastReader(){
    InputStreamReader inr =new InputStreamReader(System.in);
    br=new BufferedReader(inr);

}

String next(){
    while(st==null || !st.hasMoreElements()){
    try{
    st=new StringTokenizer(br.readLine());
    }
    catch(IOException e){
        e.printStackTrace();
    }}
    return st.nextToken();
}

int nextInt(){
    return Integer.parseInt(next());
}

double nextDouble(){
    return Double.parseDouble(next());

}

long nextLong(){
    return Long.parseLong(next());
}


String nextLine(){
    String str="";
    try{
        str=br.readLine();
    }
    catch(IOException e)
    {
        e.printStackTrace();
    }
    return str;
}
}

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

#include<bits/stdc++.h> 
using  namespace  std ;
 const  int N = 5005 , mod = 1e9 + 7 ;
 int n, f [N] [N], m; char s [N];
 int  main () {
   scanf ( "% d% s" , & n, s + 1 ); m = strlen (s + 1 );
  f [ 0 ] [ 0 ] = 1 ;
   for ( int i = 0 ; i <n; i ++)
       for ( int j = 0 ; j <= i; j ++) {
           if (j) f [i + 1 ] [j- 1 ] = (f [i + 1 ] [j- 1 ] + f [i] [j])% mod;
           else f [i + 1 ] [j] = (f [i + 1 ] [j] + f [i] [j])% mod;
          f [i + 1 ] [j + 1 ] = (f [i + 1 ] [j + 1 ] + 1l l * f [i] [j] * 2 )% mod;
      }
  for ( int i = 1 ; i <= m; i ++) f [n] [m] = 1l l * f [n] [m] * 500000004 % mod;
   printf ( "% d \ n" , f [n] [m]);
   return  0 ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:58: error: expected ')' before 'l'
   12 |           f [i + 1 ] [j + 1 ] = (f [i + 1 ] [j + 1 ] + 1l l * f [i] [j] * 2 )% mod;
      |                                 ~                        ^~
      |                                                          )
a.cc:14:49: error: expected ';' before 'l'
   14 |   for ( int i = 1 ; i <= m; i ++) f [n] [m] = 1l l * f [n] [m] * 500000004 % mod;
      |                                                 ^~
      |                                                 ;
a.cc:15:13: warning: unknown escape sequence: '\040'
   15 |    printf ( "% d \ n" , f [n] [m]);
      |             ^~~~~~~~~
Language: C++

#include <bits / stdc ++. h> 
using  namespace  std ;
 const  int N = 5005 , mod = 1e9 + 7 ;
 int n, f [N] [N], m; char s [N];
 int  main () {
  
   scanf ( "% d% s" , & n, s + 1 ); m = strlen (s + 1 );
  f [ 0 ] [ 0 ] = 1 ;
   for ( int i = 0 ; i <n; i ++)
       for ( int j = 0 ; j <= i; j ++) {
           if (j) f [i + 1 ] [j- 1 ] = (f [i + 1 ] [j- 1 ] + f [i] [j])% mod;
           else f [i + 1 ] [j] = (f [i + 1 ] [j] + f [i] [j])% mod;
          f [i + 1 ] [j + 1 ] = (f [i + 1 ] [j + 1 ] + 1l l * f [i] [j] * 2 )% mod;
      }
  for ( int i = 1 ; i <= m; i ++) f [n] [m] = 1l l * f [n] [m] * 500000004 % mod;
   printf ( "% d \ n" , f [n] [m]);
   return  0 ;
}

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

import java.util.*;
import java.io.*;

public class Main 
{
	public static void main(String[] args) { new Main(); }
	FS in = new FS();
	PrintWriter out = new PrintWriter(System.out);
	
	int n, c;
	long mod = (long)1e9 + 7;
       	int[] a, b;
	long[][] pre, dp;
	
	Main() {
		n = in.nextInt();
		c = in.nextInt();
		a = new int[n]; b = new int[n];
		for (int i = 0; i < n; a[i++] = in.nextInt());
		for (int i = 0; i < n; b[i++] = in.nextInt());

		pre = new long[n][c + 1];
		for (int i = 0; i < n; i++)
			for (int j = 0; j <= c; j++)
				for (int k = a[i]; k <= b[i]; k++) {
					pre[i][j] += pow(k, j);
					pre[i][j] %= mod;
				}

		dp = new long[n][c + 1];
		out.println(dp(0, c));
		out.close();
	}
	
	long dp(int idx, int left) {
		if (left == 0)
			return 1;
		if (idx == n)
			return 0;
		if (dp[idx][left] != -1)
			return dp[idx][left];

		long ans = 0;
		for (int i = 0; i <= left; i++) {
			ans += mult(pre[idx][i], dp(idx + 1, left - i));
			ans %= mod;
		}
		return dp[idx][left] = ans;
	}

	long mult(long a, long b) {
		return (a % mod)*(b % mod) % mod;
	}

	long pow(long a, long b) {
		long res = 1L;
		while (b > 0) {
			res *= res;
			if ((b & 1) > 0)
				res *= a;
			res %= mod;
			b >> 1;
		}
		return res;
	}
	
	class FS {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch (Exception e) {}
			} return st.nextToken();
		}
		int nextInt() { return Integer.parseInt(next()); }
		long nextLong() { return Long.parseLong(next()); }
		double nextDouble() { return Double.parseDouble(next()); }
	}
}


Compiler output:
Main.java:62: error: not a statement
			b >> 1;
			  ^
1 error
Language: Java

import java.util.*;
import java.io.*;

public class Main 
{
	public static void main(String[] args) { new Main(); }
	FS in = new FS();
	PrintWriter out = new PrintWriter(System.out);
	
	int n, min, arr[];
	
	Main() {
		arr = new int[n = in.nextInt()];
		for (int i = 0; i < n; arr[i++] = in.nextInt());

		min = 400_000*n;
		for (int j = -100; j <= 100; j++) {
			int cost = 0;
			for (int i = 0; i < n; i++)
				cost += (arr[i] - j)*(arr[i] - j);
			min = min(min, cost);
		}
		out.println(min);
		out.close();
	}
	
	int min(int a, int b) {
		if (a < b)
			return a;
		return b;
	}
	
	class FS {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenier("");
		String next() {
			while (!st.hasMoreTokens()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch (Exception e) {}
			} return st.nextToken();
		}
		int nextInt() { return Integer.parseInt(next()); }
		long nextLong() { return Long.parseLong(next()); }
		double nextDouble() { return Double.parseDouble(next()); }
	}
}


Compiler output:
Main.java:35: error: cannot find symbol
		StringTokenizer st = new StringTokenier("");
		                         ^
  symbol:   class StringTokenier
  location: class Main.FS
1 error
Language: C++

#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
int main() {
 int a,b[110],c,d;
    
  cin >> a;
  
  for(int i=0;i<a;i++)
    cin >> b[i];
  c=10000000;
  for(int i=0;i<a;i++){
    d =0;
    for(int i=-100;i<110;i++){
    d +=(b[i]-j);
    }
    
    c =min(c,d);
  }
  
  cout << c << endl;
}

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

#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main() {
  int n,a[100],ans=10000000,cnt=0;
  cin >> n;
  for(int i=0; i<n; i++) {
    cin >> a[i];
  }
  for(int i=-100; i<=100; i++) {
    for(int j=0; j<n; j++) {
      cnt+=(a[j]-i)(a[j]-i);
    }
    if(cnt<ans) {
      ans=cnt;
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: expression cannot be used as a function
   13 |       cnt+=(a[j]-i)(a[j]-i);
      |            ~~~~~~~~^~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=410;
const ll mod = 1e9+7 ; 
ll a[N],b[N];
ll sum[N][N], l[N][N];
ll dp[N][N];
int main(){
    ll n,m;
    scanf("%lld%lld",&n, &m);
    for(int i=1;i<=n;i++){
        scanf("%lld",&a[i]);
    }
    for(int i=1;i<=n;i++){
        scanf("%lld",&b[i]);
    }
    for(int i=0; i<N; i++){
        l[i][0]=1;
        for(int j=1; j<N; j++){
            l[i][j]=(l[i][j-1]*i)%mod;
        }
    }
    for(int i=1; i<N; i++){
        for(int j=0; j<N; j++){
            sum[i][j]=(sum[i][j]+sum[i-1][j]+l[i][j])%mod;
        }
    }
    dp[0][0]=1;
    for(int i=1;i<=n;i++){
        for(int j=0;j<=m;j++){
            for(int k=0;k<=j;k++){
                dp[i][j]=(dp[i][j]%mod+(1ll*dp[i-1][j-k]*(sum[b[i]][k]-sum[a[i]-1][k]+))%mod)%mod;
            }
        }
    }
    printf("%lld\n",dp[n][m]);
    //system("pause");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:87: error: expected primary-expression before ')' token
   33 |                 dp[i][j]=(dp[i][j]%mod+(1ll*dp[i-1][j-k]*(sum[b[i]][k]-sum[a[i]-1][k]+))%mod)%mod;
      |                                                                                       ^
Language: C++

#include<iostream>
#include<vector>

using namespace std;

int main(void){
  int N;
  cin >> N;
  vector<int> a(N);
  int s = 0;
  for(int i = 0; i < N; i++){
    cin >> a[i];
    s += a[i];
  }
  int m = (int)round((double)s / N);
  int ans = 0;
  for(int i = 0; i < N; i++) ans += (a[i] - m) * (a[i] - m);
  cout << ans << endl;
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: 'round' was not declared in this scope
   15 |   int m = (int)round((double)s / N);
      |                ^~~~~
Language: C++

#include<iostream>
#include<cmath>
#include<vector>
using namespace std;
int main()
{
	vector<int> num(n);
	long long n;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>num[i];
	}
	int cost=1000000;	
	for(int i=-200;i<=200;i++)
	{
		int be=0;
		for(int j=0;j<n;j++)
		{
			be+=(i-num[j])*(i-num[j]);
		}
		cost=min(cost,be);
	 }
	 cout<<cost;
	 return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:25: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |         vector<int> num(n);
      |                         ^
      |                         yn
Language: C++

#include<iostream>
#include<vector>
#include<climits>
#include<algorithm>
using namespace std;
int ans=INT_MAX;
int main(void){
int n;
  cin>>n;
  vector<int> a(n);
  for(int i =0;i<n;i++)cin>>a(i);
  for(int i =-100;i<=100;i++){
      int tmp=0;
        for(int j =0;j<n;j++)tmp+=(a[j]-i)*(a[j]-i);
      ans=min(ans,tmp);
    }
  cout <<ans<<endl;
  return 0; 
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:11:30: error: no match for call to '(std::vector<int>) (int&)'
   11 |   for(int i =0;i<n;i++)cin>>a(i);
      |                             ~^~~
Language: C++

#include<iostream>
#include<vector>
#include<climits>
#include<algorithm>
using namespace std;
int ans=INT_MAX;
int main(void){
int n;
  cin>>n;
  vector<int> a(n);
  for(int i =0;i<n;i++)cin>>a(i);
    for(int i =-100;i<=100;i++){
      int tmp=0;
        for(int j =0;j<n;j++)tmp+=(a[j]-i)*(a[j]-i);
      ans=max(ans,tmp);
    }
  cout <<ans<<endl;
  return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:30: error: no match for call to '(std::vector<int>) (int&)'
   11 |   for(int i =0;i<n;i++)cin>>a(i);
      |                             ~^~~
Language: C++

#include<iostream>
#include<vector>
#include<climts>
#include<algorithm>
using namespace std;
int ans=INT_MAX;
int main(void){
int n;
  cin>>n;
  vector<int> a(n);
  for(int i =0;i<n;i++)cin>>a(i);
    for(int i =-100;i<=100;i++){
      int tmp=0;
        for(int j =0;j<n;j++)tmp+=(a[j]-i)*(a[j]-i);
      ans=max(ans,tmp);
    }
  cout <<ans<<endl;
  return 0;

}

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

#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<map>
#include<vector>
#include<string.h>
#include<set>
#define inf 0x3f3f3f3f
using namespace std;
int pre[110];
int main()
{
    int n;
    cin>>n;
    int sum=0;
    for(int i=0;i<n;i++)
    {
        scanf("%d",&pre[i]);
        sum+=pre[i];
    }
    sum=sum/n;
    for(int i=0;i<n;i++)
    {
        ans+=(pre[i]-sum)*(pre[i]-sum);
    }
    printf("%d\n",ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   25 |         ans+=(pre[i]-sum)*(pre[i]-sum);
      |         ^~~
      |         abs
a.cc:27:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
   27 |     printf("%d\n",ans);
      |                   ^~~
      |                   abs
Language: C++

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define ll long long
#define Di 3.1415926
#include<math.h>
#include<string>
#include<stack>
#define INF 0x3f3f3f3f
using namespace std;
ll  gcd(ll a,ll b)
{
    return a%b? gcd(b,a%b):b;
}
struct Node
{
    int t;
    char a[102];
}s[102];
bool cmp(Node a,Node b)
{
    return strcmp(a.a,b.a)<0;
}
int a[200];
int main()
{    int m,sum=0;
      cin>>m;
      for(i=0;i<m;i++)
      {
          cin>>a[i];
          sum+=a[i];
      }
      int num=sum/m;
       if(sum%m!=0)
         num+=1;
         sum=0;
        for(i=0;i<m;i++)
        {
            sum+= pow((a[i]-num),2);
        }
        cout<<sum<<endl;

 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:11: error: 'i' was not declared in this scope
   29 |       for(i=0;i<m;i++)
      |           ^
a.cc:38:13: error: 'i' was not declared in this scope
   38 |         for(i=0;i<m;i++)
      |             ^