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

#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "math.h"
#include "utility"
#include "string"
#include "map"
#include "unordered_map"
#include "iomanip"
#include "random"

using namespace std;
const long long int MOD = 1000000007;

int N, K;
list<int>edge[5000];
list<int>can[5000];
queue<int>box;
priority_queue<long long int, vector<long long int>, greater<long long int>>Q;

int main() {
	ios::sync_with_stdio(false);
	cin >> N >> K;
	vector<int>cost(N);
	vector<int>far(N);
	vector<int>dis(N, INT_MAX);
	dis[0] = 0;
	for (int i = 0; i < N; i++)cin >> cost[i] >> far[i];
	for (int i = 0; i < K; i++) {
		int a, b;
		cin >> a >> b;
		a--;
		b--;
		edge[a].push_back(b);
		edge[b].push_back(a);
	}
	vector<int>move(N, INT_MAX);
	Q.push(0);
	while (!Q.empty()) {
		int current = Q.top() % MOD;
		int dist = Q.top() / MOD;
		box.push(current);
		for (int i = 0; i < N; i++)move[i] = INT_MAX;
		move[current] = 0;
		while (!box.empty()) {
			for (auto j : edge[box.front()]) {
				if (move[j] > move[box.front()] + 1) {
					move[j] = move[box.front()] + 1;
					box.push(j);
				}
			}
			box.pop();
		}
		for (int j = 0; j < N; j++) {
			if (move[j] && move[j] <= far[i])can[i].push_back(j);
		}
		for (auto i : can[current]) {
			if (dis[i] > dist + cost[current]) {
				dis[i] = dist + cost[current];
				Q.push(dis[i] * MOD + i);
			}
		}
		can[current].clear();
		Q.pop();
	}
	cout << dis[N - 1] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:55: error: 'i' was not declared in this scope
   60 |                         if (move[j] && move[j] <= far[i])can[i].push_back(j);
      |                                                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
#define F first
#define S second
#define MP make_pair
int N, K;
int c[5000], r[5000];
bool flag[5000];
int flag2[5000];
vector<int> G[5000], G2[5000];
priority_queue<P, vector<P>, greater<P> > pq;
void bfs(int s)
{
	queue<P> que;
	que.push(MP(s, 0));
	memset(flag, 0, sizeof(flag));
	flag[s] = true;
	while(!que.empty())
	{
		P now = que.front();
		que.pop();
		if(now.S == r[s]) continue;
		for(int i = 0; i < G[now.F].size(); ++i)
		{
			if(!flag[G[now.F][i]])
			{
				flag[G[now.F][i]] = true;
				que.push(MP(G[now.F][i], now.S + 1));
				G2[s].push_back(G[now.F][i]);
			}
		}
	}
}
void dijkstra(int s)
{
	pq.push(MP(0, 0));
	while(!pq.empty())
	{
		P now = pq.top();
		pq.pop();
		for(int i = 0; i < G2[now.S].size(); ++i)
		{
			if(flag2[G2[now.S][i]] > now.F + c[now.S])
			{
				flag2[G2[now.S][i]] = now.F + c[now.S];	
				pq.push(MP(now.F + c[now.S], G2[now.S][i]));
			}
		}
	}
}
int main()
{
	cin >> N >> K;
	for(int i = 0; i < N; ++i)
		scnaf("%d%d", c + i, r + i);
	for(int i = 0; i < K; ++i)
	{
		int in1, in2;
		scanf("%d%d", &in1, &in2);
		--in1; --in2;
		G[in1].push_back(in2);
		G[in2].push_back(in1);
	}
	fill(flag2 + 1, flag2 + N, INT_MAX);
	for(int i = 0; i < N; ++i)
		bfs(i);
	dijkstra(0);
	cout << flag2[N - 1] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:17: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
   56 |                 scnaf("%d%d", c + i, r + i);
      |                 ^~~~~
      |                 scanf
Language: C++

#include <iostream>
#include <vector>
#include <utility>
#include <queue>
#include <cstring>
#define INF 900000000
  
using namespace std;
  
int n, k, c[5010], r[5010], cost[5010];
vector<int> road[5010];
vector<pair<int, int>> adj[5010];
bool done[5010];
  
void dfs (int dep, int lim, int num)
{
    done[lim]=true;
    if (dep>r[lim]) return;
    else
    {
        for (vector<int>::iterator itr=road[num].begin(); itr!=road[num].end(); itr++)
        {
            int u=*itr;
　　　　　　 if (!done[u])
            {
                done[u]=true;
                adj[lim].push_back({u, c[lim]});
                dfs(dep+1, lim, u);
            }
        }
    }
}
  
int dijkstra ()
{
    //memset(done, false, sizeof(done));
    for (int i=0; i<5010; i++) cost[i]=INF;
    cost[1]=0;
    priority_queue<pair<int, int>> que;
    que.push({0,1});
    while (!que.empty())
    {
        int a=que.top().second;
        que.pop();
        /*if (done[a]) continue;
        done[a]=true;*/
        for (vector<pair<int,int>>::iterator u=adj[a].begin(); u!=adj[a].end(); u++)
        {
            int b=u->first, w=u->second;
            if (cost[b]>cost[a]+w)
            {
                cost[b]=cost[a]+w;
                que.push({-cost[b], b});
            }
        }
    }
    return cost[n];
}
  
int main()
{
    int a,b;
    cin>>n>>k;
    for (int i=1; i<=n; i++ ) cin>>c[i]>>r[i];
    for (int i=1; i<=k; i++)
    {
        cin>>a>>b;
        road[a].push_back(b);
        road[b].push_back(a);
    }
    for (int i=1; i<=n; i++)
    {
        memset(done, false, sizeof(done));
        dfs(1, i, i);
    }
    cout<<dijkstra()<<'\n';
    return 0;
}



Compiler output:
a.cc:24:1: error: extended character 　 is not valid in an identifier
   24 | 　　　　　　 if (!done[u])
      | ^
a.cc:24:1: error: extended character 　 is not valid in an identifier
a.cc:24:1: error: extended character 　 is not valid in an identifier
a.cc:24:1: error: extended character 　 is not valid in an identifier
a.cc:24:1: error: extended character 　 is not valid in an identifier
a.cc:24:1: error: extended character 　 is not valid in an identifier
a.cc: In function 'void dfs(int, int, int)':
a.cc:24:1: error: '\U00003000\U00003000\U00003000\U00003000\U00003000\U00003000' was not declared in this scope
   24 | 　　　　　　 if (!done[u])
      | ^~~~~~~~~~~~
Language: C++

#include<iostream>
#include<queue>
#include<vector>
#include<cstdio>

using namespace std;

struct P{int c,r;};
struct State{
  int t;
  int pos, remain;
  bool operator < (const State& st) const {
    return t > st.t;
  }
};

const int MAX = 5001;
const int INF = (1<<25);
int T[MAX][MAX];
vector<int> Edge[MAX];
P price[MAX];
int N,K;

void input(){
  scanf("%d %d",&N,&K);
  for(int i = 0; i < N; i++) scanf("%d %d",&price[i].c, &price[i].r);
  for(int i = 0; i < K; i++){
    int a,b;
    scanf("%d %d",&a, &b);
    a--;b--;
    Edge[a].push_back(b);
    Edge[b].push_back(a);
  }
}

void solve(){
  //fill(T[0], T[0]+MAX*MAX, INF);
  memset(T, -1, sizeof(T));
  T[0][0] = 0;
  priority_queue<State> Q;
  Q.push((State){0,0,0});
  while(!Q.empty()){
    const State now = Q.top();
    Q.pop();
    
    if(now.t > T[now.pos][now.remain]) continue;
    
    if(now.remain > 0){
      for(int i = 0; i < (int)Edge[now.pos].size(); i++){
	State nex = now;
	nex.pos = Edge[now.pos][i];
	nex.remain--;
	
	if(T[nex.pos][nex.remain] == -1 || T[nex.pos][nex.remain] > nex.t){
	  T[nex.pos][nex.remain] = nex.t;
	  Q.push(nex);
	}
      }
    }
    
    State nex = now;
    nex.t += price[now.pos].c; 
    nex.remain = price[now.pos].r;
    if(T[nex.pos][nex.remain] == -1 || T[nex.pos][nex.remain] > nex.t){
      T[nex.pos][nex.remain] = nex.t;
      Q.push(nex);
    }
  }
  
  int ans = INF;
  for(int i = 0; i < MAX; i++) 
    if(T[N-1][i] >= 0) ans = min(ans,T[N-1][i]);
  printf("%d\n",ans);
}

int main(){

  input();
  solve();
  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:38:3: error: 'memset' was not declared in this scope
   38 |   memset(T, -1, sizeof(T));
      |   ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<cstdio>
  +++ |+#include <cstring>
    5 |
Language: C++

#include <iostream>
#include <algorithm>

int32_t N;
int32_t D[120];
int32_t A[120];
int32_t dp[100][0X80];

struct R_print {
	template<typename T>
	T operator=(T&& v) {
		std::cout << v << ')' << '\n'; return std::forward<T>(v);
	}
};

//i??\?????????????????¨???????????§???eatable_flag???i????????????i??????7???(???????????????)???
int32_t func(int l_pos, uint8_t eatable_flag)
{
	if (N <= l_pos) { return 0; }
	eatable_flag &= 0X7F;
	if (N <= l_pos + 7) {
		uint16_t mask = 0;
		for (int i = l_pos + 1; i < N; ++i) {
			mask <<= 1; mask |= 1;
		}
		eatable_flag &= mask;
	}

#ifdef DEBUG
	auto PARAM_PRINT = [&]() {
		std::cout << '(' << l_pos << ',';
		for (int i = 7 - 1; i >= 0; --i) {
			std::cout << ((eatable_flag & (1 << i)) ? '1' : '0');
		}
		std::cout << ','; };
#define RETURN PARAM_PRINT(); return R_print{}=
#else
#define RETURN return
#endif

	if (-1 != dp[l_pos][eatable_flag]) { return dp[l_pos][eatable_flag]; }
	auto eat = [l_pos, eatable_flag](int pos) {
		auto index = l_pos + pos + 1;
		int32_t v = 0;
		for (int i = -7; i <= 7; ++i) {
			auto rindex = index + i;
			if (rindex < 0 || N < rindex) { continue; }
			if (rindex < l_pos) {
				if (index <= rindex + D[rindex]) {
					v += A[rindex];
				}
			}
			if (l_pos < rindex) {//0 < pos + 1  + i
				auto bit = pos + i;
				if (
					(bit < 7) &&

					(
						((eatable_flag & (1 << bit)) == 0) &&
						(rindex - D[rindex] <= index && index <= rindex + D[rindex])
					)
					
					) {
					v += A[rindex];
				}
			}
		}
		return v;
	};
	int32_t res = 0;
	for (int i = 0; i < 7; ++i) {
		if (eatable_flag & (1 << i)) {
			//l_pos??\???????£???????
			res = std::max(res, eat(i) + func(l_pos, eatable_flag & ~(1 << i)));
		}
	}
	//l_pos????£???????
	auto nf = eatable_flag;
	int count = 0;
	while ((nf & 1) != 1) {
		++count;
		nf |= 0X80; nf >>= 1;
	}
	++count;
	nf |= 0X80; nf >>= 1;
	res = std::max(res, eat(-1) + func(l_pos + count, nf));
	RETURN dp[l_pos][eatable_flag] = res;
}

int main()
{
	for (auto& a : dp)for (auto& i : a) { i = -1; }
	std::cin >> N;
	for (int i = 0; i < N; ++i) {
		std::cin >> D[i];
	}
	for (int i = 0; i < N; ++i) {
		std::cin >> A[i];
	}
	std::cout << func(0, 0X7FFF) << std::endl;
}

Compiler output:
a.cc:17:25: error: 'uint8_t' has not been declared
   17 | int32_t func(int l_pos, uint8_t eatable_flag)
      |                         ^~~~~~~
a.cc: In function 'int32_t func(int, int)':
a.cc:22:17: error: 'uint16_t' was not declared in this scope
   22 |                 uint16_t mask = 0;
      |                 ^~~~~~~~
a.cc:3:1: note: 'uint16_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    2 | #include <algorithm>
  +++ |+#include <cstdint>
    3 | 
a.cc:24:25: error: 'mask' was not declared in this scope
   24 |                         mask <<= 1; mask |= 1;
      |                         ^~~~
a.cc:26:33: error: 'mask' was not declared in this scope
   26 |                 eatable_flag &= mask;
      |                                 ^~~~
Language: C++

#include <stdio.h>
#include <tchar.h>
#include<set>
#include<deque>
#include<queue>
#include<map>
#include<string>
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<functional>

#define fir first
#define sec second
#define mp make_pair
#define mt make_tuple
#define pub push_back
using namespace std;
typedef long long int llint;
const llint one = 1;
const llint big = (one<<33);
const llint ban = (big<<20);

int main(void){
	//di max7
	int i,j,N,M,a,ans;
	vector<int> per={1,2,3,4,5,6,7};
	vector<int>pera={1,2,3,4,5,6,7};
	vector<int> perg={1,2,3,4,5,6,7,8};
	vector<int> di={7,7,7,7,7,7,7};
	vector<int> ai={10000,10000,10000,10000,10000,10000,10000};
	vector<int>stz[5041];
	map<vector<int>,int> zts;
	static int dp[114][5140]={0};
	i=0;
	do {
		stz[i]=per;
		zts[per]=i;
		i++;
	} while(std::next_permutation(per.begin(),per.end()));
	scanf_s("%d",&N);
	for(i=0;i<N;i++){
		scanf_s("%d",&a);
		di.pub(a);
	}
	for(i=0;i<N;i++){
		scanf_s("%d",&a);
		ai.pub(a);
	}
	for(i=0;i<7;i++){per[i]=i+1;}
	dp[6][zts[per]]=210000;
	for(i=7;i<N+7;i++){
		for(j=0;j<8;j++){
			perg[j]=j+1;
		}
		do {
			for(j=0;j<7;j++){
				if(perg[j]>perg[7]){ per[j]=perg[j]-1; } else{ per[j]=perg[j]; }
			}//per??????????????????
			for(j=0;j<7;j++){
				if(perg[j+1]>perg[0]){ pera[j]=perg[j+1]-1; } else{ pera[j]=perg[j+1]; }
			}//pera??????????????°??????
			ans=dp[i-1][zts[per]];
			for(j=0;j<7;j++){
				if(perg[j]<perg[7]&&di[i-7+j]>=7-j){
					ans+=ai[i-7+j];
				}
				if(perg[j]>perg[7]&&di[i]>=7-j){
					ans+=ai[i];
				}
			}
			dp[i][zts[pera]]=max(dp[i][zts[pera]],ans);
		} while(std::next_permutation(perg.begin(),perg.end()));
	}
	ans=0;
	for(i=0;i<5040;i++){
		ans=max(ans,dp[N+6][i]);
	}
	
	for(i=7;i>0;i--){
		if(N<i){ ans+=10000*(8-i); }
	}
	printf("%d",ans-490000);
	return 0;
}

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

#include <stdio.h>
//#include <tchar.h>
#include<set>
#include<deque>
#include<queue>
#include<map>
#include<string>
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<functional>

#define fir first
#define sec second
#define mp make_pair
#define mt make_tuple
#define pub push_back
using namespace std;
typedef long long int llint;
const llint one = 1;
const llint big = (one<<33);
const llint ban = (big<<20);

int main(void){
	//di max7
	int i,j,N,M,a,ans;
	vector<int> per={1,2,3,4,5,6,7};
	vector<int>pera={1,2,3,4,5,6,7};
	vector<int> perg={1,2,3,4,5,6,7,8};
	vector<int> di={7,7,7,7,7,7,7};
	vector<int> ai={10000,10000,10000,10000,10000,10000,10000};
	vector<int>stz[5041];
	map<vector<int>,int> zts;
	static int dp[114][5140]={0};
	i=0;
	do {
		stz[i]=per;
		zts[per]=i;
		i++;
	} while(std::next_permutation(per.begin(),per.end()));
	scanf_s("%d",&N);
	for(i=0;i<N;i++){
		scanf_s("%d",&a);
		di.pub(a);
	}
	for(i=0;i<N;i++){
		scanf_s("%d",&a);
		ai.pub(a);
	}
	for(i=0;i<7;i++){per[i]=i+1;}
	dp[6][zts[per]]=210000;
	for(i=7;i<N+7;i++){
		for(j=0;j<8;j++){
			perg[j]=j+1;
		}
		do {
			for(j=0;j<7;j++){
				if(perg[j]>perg[7]){ per[j]=perg[j]-1; } else{ per[j]=perg[j]; }
			}//per??????????????????
			for(j=0;j<7;j++){
				if(perg[j+1]>perg[0]){ pera[j]=perg[j+1]-1; } else{ pera[j]=perg[j+1]; }
			}//pera??????????????°??????
			ans=dp[i-1][zts[per]];
			for(j=0;j<7;j++){
				if(perg[j]<perg[7]&&di[i-7+j]>=7-j){
					ans+=ai[i-7+j];
				}
				if(perg[j]>perg[7]&&di[i]>=7-j){
					ans+=ai[i];
				}
			}
			dp[i][zts[pera]]=max(dp[i][zts[pera]],ans);
		} while(std::next_permutation(perg.begin(),perg.end()));
	}
	ans=0;
	for(i=0;i<5040;i++){
		ans=max(ans,dp[N+6][i]);
	}
	
	for(i=7;i>0;i--){
		if(N<i){ ans+=10000*(8-i); }
	}
	printf("%d",ans-490000);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   42 |         scanf_s("%d",&N);
      |         ^~~~~~~
      |         scanf
Language: Java

import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.util.Map;
import java.util.PriorityQueue;
import java.math.BigInteger;
    
public class Main{

static final InputStream in=System.in;
static final PrintWriter out=new PrintWriter(System.out);
static final int INF=Integer.MAX_VALUE/2;
static final long LINF=Long.MAX_VALUE/2;
static int m,n;
static char[][] flag;
static char[][] emblem;
static final char JOI={'J','O','I'};
    
public static void main(String[] args) throws IOException{
InputReader ir=new InputReader(in);
m=ir.nextInt();
n=ir.nextInt();
flag=ir.makeCharMap(m,n);
emblem=ir.makeCharMap(2,2);
int ans=numOfEmblems();
for(int i=0;i<m;i++){
for(int j=0;j<n;j++){
for(int k=0;k<3;k++){
if(flag[i][j]!=JOI[k]){
char c=flag[i][j];
flag[i][j]=JOI[k];
ans=Math.max(ans,numOfEmblems());
flag[i][j]=c;
}
}
}
}
out.println(ans);
out.flush();
}

public staitc int numOfEmblem(){
int cnt=0;
for(int i=0;i<m-1;i++){
for(int j=0;j<n-1;j++){
if(flag[i][j]==emblem[0][0]&&flag[i][j+1]==emblem[0][1]&&flag[i+1][j]==emblem[1][0]&&flag[i+1][j+1]==emblem[1][1]) cnt++;
}
}
return cnt;
}

static class InputReader {
private InputStream in;
private byte[] buffer=new byte[1024];
private int curbuf;
private int lenbuf;

public InputReader(InputStream in) {this.in=in;}
  
public int readByte() {
if(lenbuf==-1) throw new InputMismatchException();
if(curbuf>=lenbuf){
curbuf= 0;
try{
lenbuf=in.read(buffer);
}
catch (IOException e) {
throw new InputMismatchException();
}
if(lenbuf<=0)
return -1;
}
return buffer[curbuf++];
}

public boolean isSpaceChar(int c){return !(c>=33&&c<=126);}

private int skip() {int b; while((b = readByte())!=-1&&isSpaceChar(b)); return b;}

public String next() {
int b=skip();
StringBuilder sb=new StringBuilder();
while(!isSpaceChar(b)){
sb.appendCodePoint(b);
b=readByte();
}
return sb.toString();
}
 
public int nextInt() {
int c=readByte();
while (isSpaceChar(c)) c=readByte();
boolean minus=false;
if (c=='-') {
minus=true;
c=readByte();
}
int res=0;
do{
if(c<'0'||c>'9') throw new InputMismatchException();
res=res*10+c-'0';
c=readByte();
}while(!isSpaceChar(c));
return (minus)?-res:res;
}

public long nextLong() {
int c=readByte();
while (isSpaceChar(c)) c=readByte();
boolean minus=false;
if (c=='-') {
minus=true;
c=readByte();
}
long res = 0;
do{
if(c<'0'||c>'9') throw new InputMismatchException();
res=res*10+c-'0';
c=readByte();
}while(!isSpaceChar(c));
return (minus)?-res:res;
}

public int[] toIntArray(int n){
int[] a=new int[n];
for(int i=0;i<n;i++) a[i]=nextInt();
return a;
}
}

public char[][] makeCharMap(int m,int n){
char[][] map=new char[m][n];
for(int i=0;i<m;i++) map[i]=ir.next().toCharArray();
}
}

Compiler output:
Main.java:50: error: <identifier> expected
public staitc int numOfEmblem(){
             ^
1 error
Language: C++

#include <iomanip>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <utility>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <set>

#define INF_LL 9000000000000000000
#define INF 2000000000

#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()

using namespace std;

typedef long long ll;
typedef pair<int, int> PII;
typedef pair<int, PII> PPII;
typedef pair<int, PPII> PPPII;

class Union_find{
private:
	vector<int> par;
	vector<int> rank;
	int n;

public:
	Union_find(int a){
		n = a;
		for(int i = 0;i < n;i++){
			par.push_back(i);
			rank.push_back(0);
		}
	}

	int find(int x){
		if(par[x] == x){
			return x;
		}else{
			return par[x] = find(par[x]);
		}
	}

	void unite(int x, int y){
		x = find(x);
		y = find(y);
		if(x == y) return;

		if(rank[x] < rank[y]){
			par[x] = y;
		}else{
			par[y] = x;
			if(rank[x] == rank[y]) rank[x]++;
		}
	}

	bool same(int x, int y){
		return find(x) == find(y);
	}
};

int main(void){
	int N, M;
	string flag[2];
	string base[1010];
	ll res = 0;

	cin >> M >> N;
	REP(i, M){
		cin >> base[i];
	}
	REP(i, 2){
		cin >> flag[i];
	}

	REP(i, M-1){
		REP(j, N-1){
			bool ok = true;
			REP(a, 2){
				REP(b, 2){
					if(flag[a][b] != base[i+a][j+b]){
						ok = false;
					}
				}
			}
			if(ok)
				res++;
		}
	}
	int mp = 0;
	REP(i, M){
		REP(j, N){
			char ch[] = {'J', 'O', 'I'};
			char org = base[i][j];
			REP(k, 3){
				base[i][j] = ch[k];
				
				int cnt = 0;
				FOR(a, max(i-1, 0), i+1){
					FOR(b, max(j-1, 0), j+1){
						bool ok = true;
						REP(c, 2){
							REP(d, 2){
								if(flag[c][d] != base[a+c][b+d])
									ok =false;
							}
						}
						if(ok) cnt++;
					}
				}
				if(mp < cnt && ch[k] != org)
					mp = cnt;
			}
		}
	}
	cout << res + mp << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:74:9: error: 'cin' was not declared in this scope
   74 |         cin >> M >> N;
      |         ^~~
a.cc:12:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   11 | #include <set>
  +++ |+#include <iostream>
   12 | 
a.cc:122:9: error: 'cout' was not declared in this scope
  122 |         cout << res + mp << endl;
      |         ^~~~
a.cc:122:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

//============================================================================
// Name        : AOJ.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;
char D[1002][1002]={};

int main() {
	int M,N;
	char E[2][2];
	char b[4]="SJOI";
	cin>>M>>N;
	for(int i=1;i<M+1;i++){
		for(int j=1;j<N+1;j++){
			cin>>D[i][j];
		}
	}
	for(int i=0;i<2;i++){
		for(int j=0;j<2;j++){
			cin>>E[i][j];
		}
	}
	int a=0;
	for(int i=1;i<M;i++){
		for(int j=1;j<N;j++){
			if(D[i][j]==E[0][0]&&D[i][j+1]==E[0][1]&&D[i+1][j]==E[1][0]&&D[i+1][j+1]==E[1][1]){
				a+=1;
			}
		}
	}
	int c[4];
	char C;
	int R=0;
	for(int i=1;i<M+1;i++){
		for(int j=1;j<N+1;j++){
			b[0]=D[i][j];
			for(int k=0;k<4;++k){
				D[i][j]=b[k];
				c[k]=0;
				if(D[i][j]==E[0][0]&&D[i][j+1]==E[0][1]&&D[i+1][j]==E[1][0]&&D[i+1][j+1]==E[1][1])c[k]+=1;
				if(D[i][j-1]==E[0][0]&&D[i][j]==E[0][1]&&D[i+1][j-1]==E[1][0]&&D[i+1][j]==E[1][1])c[k]+=1;
				if(D[i-1][j-1]==E[0][0]&&D[i-1][j]==E[0][1]&&D[i][j-1]==E[1][0]&&D[i][j]==E[1][1])c[k]+=1;
				if(D[i-1][j]==E[0][0]&&D[i-1][j+1]==E[0][1]&&D[i][j]==E[1][0]&&D[i][j+1]==E[1][1])c[k]+=1;
				C=D[i][j];
			}
			D[i][j]=b[0];
			R=max(R,a+c[1]-c[0]);
			R=max(R,a+c[2]-c[0]);
			R=max(R,a+c[3]-c[0]);
		}
	}


	cout<<R<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:19: error: initializer-string for 'char [4]' is too long [-fpermissive]
   16 |         char b[4]="SJOI";
      |                   ^~~~~~
Language: C++

#include<iostream>

using namespace std;
const int INF = 1000000000;
int M,N,ans;
int ma[10003];
int ha[503][2];
int dp[503][10003];
int main(void){
	cin >> M >> N;
	for(int i = 0;i < m;i++){
		cin>>ma[i];
	}
	sort(ma,ma + M,greater<int>());
	for(int i = 1;i < M;i++)ma[i] += ma[i-1];
	for(int i = 0;i < N;i++){
		cin >> ha[i][0] >>ha[i][1];
	}
	
	
	for(int i = 0;i <= N;i++){
		for(int j = 1;j <= M;j++){
			dp[i][j] = INF;
		}
	}
	for(int i = 1;i <= ha[0][0];i++){
		dp[1][i] = ha[0][1];
		ans = max(ans,ma[i-1]-dp[1][i]);
	}
	for(int i = 2;i <= N;i++){
		for(int j = 1;j <= M;j++){
			dp[i][j] = min(dp[i-1][j],ha[i-1][1]+dp[i-1][max(0,j-ha[i-1][0])]);
			ans = max(ans,ma[j-1]-dp[i][j]);
		}
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:27: error: 'm' was not declared in this scope
   11 |         for(int i = 0;i < m;i++){
      |                           ^
a.cc:14:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |         sort(ma,ma + M,greater<int>());
      |         ^~~~
      |         short
Language: C++

#include <functional>
#include <iostream>
using namespace std;
int p[100100],c[100100],e[100100];
int dp[2][100100];//dp[i+1][j]:=i番目までの箱を使ってj個の饅頭
int main()
{
    int n,m;
    cin >> n >> m;
    int sum=0;
    for(int i=0;i<n;i++)cin >> p[i];
    for(int i=0;i<m;i++)cin >> c[i] >> e[i];
    sort(p,p+n,greater<int>());
    for(int i=0;i<n;i++)p[i+1]+=p[i];
    for(int i=0;i<2;i++)
    {
        for(int j=0;j<=n;j++)
        {
            dp[i][j]=INF;
        }
    }
    dp[0][0]=0;
    for(int i=0;i<m;i++)
    {
        for(int j=0;j<=n;j++)
        {
            dp[(i+1)%2][j]=min(dp[i%2][j],dp[i%2][max(j-c[i],0)]+e[i]);
        }
    }
    int ans=0;
    for(int i=1;i<=n;i++)
    {
        ans=max(ans,p[i-1]-dp[m%2][i]);
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |     sort(p,p+n,greater<int>());
      |     ^~~~
      |     short
a.cc:19:22: error: 'INF' was not declared in this scope
   19 |             dp[i][j]=INF;
      |                      ^~~
Language: C++

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

int main() {
	
const int INF = 1001001001;
const int LIM_M = 10000;
const int LIM_N = 500;

int M, N;
int P[LIM_M + 10];
int C[LIM_N + 10], E[LIM_N + 10];

int PSum[LIM_M + 10];
int dp[LIM_M + 10];

int main() {
	int i, j;
	
	scanf("%d%d", &M, &N);
	for (i = 0; i < M; ++i) {
		scanf("%d", &P[i]);
	}
	for (j = 0; j < N; ++j) {
		scanf("%d%d", &C[j], &E[j]);
	}
	
	//	PSum[i] := maximum price for selling i manjus.
	sort(P, P + M, greater<int>());
	for (i = 0; i < M; ++i) {
		PSum[i + 1] = PSum[i] + P[i];
	}
	
	//	dp[i] := minimum expense for boxes to pack i manjus.
	//	invariant: dp[0] <= dp[1] <= ... <= dp[M].
	for (i = 0; i <= M; ++i) {
		dp[i] = INF;
	}
	dp[0] = 0;
	for (j = 0; j < N; ++j) {
		for (i = M; i >= 0; --i) {
			if (dp[i] > dp[max(i - C[j], 0)] + E[j]) {
				dp[i] = dp[max(i - C[j], 0)] + E[j];
			}
		}
	}
	
	int ans = 0;
	for (i = 0; i <= M; ++i) {
		if (ans < PSum[i] - dp[i]) {
			ans = PSum[i] - dp[i];
		}
	}
	printf("%d\n", ans);
	
	return 0;
}

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

#include<iostream>
#include<vector>

using namespace std;

typedef pair<int,int> pii;
typedef vector<int> vi;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define INF 999999999


int main(){
    int m,n;
    cin>>m>>n;
    vector<int> man;
    rep(i,m){
        int a;
        cin>>a;
        man.pb(a);
    }
    vector<pii> box;
    rep(i,n){
        int a,b;
        cin>>a>>b;
        box.pb(pii(a,b));
    }
    
    static int dp[600][11000];
    rep(i,11000)rep(j,600)dp[j][i]=INF;
    dp[0][0]=0;
    for(int i=0;i<n;i++){
        for(int j=n;j>=1;j--){
            for(int k=0;k<=10100;k++){
                if(k-box[i].first>=0)
                    dp[j][k]=min( dp[j-1][k-box[i].first]+box[i].second , dp[j][k] );
            }
        }
    }
    vector<int> data;
    rep(i,10100){
        int x=INF;
        rep(j,n+1){x=min(x,dp[j][i]);
//            cout<<"dp["<<j<<"]["<<i<<"]="<<dp[j][i]<<endl;
        }
        data.pb(x);
    }
    for(int i=10100-1;i>=1;i--){
        if(data[i]<data[i-1])data[i-1]=data[i];
    }
//    rep(i,data.size())cout<<data[i]<<" ";cout<<endl;
//    rep(i,10)cout<<data[i]<<" ";
    sort(all(man),greater<int>());
    for(int i=1;i<man.size();i++){
        man[i]=man[i-1]+man[i];
    }
    int ans=0;
    rep(i,m){
        ans=max(ans,man[i]-data[i+1]);
//        cout<<i<<" "<<ans<<" "<<data[i+1]<<endl;
    }
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   56 |     sort(all(man),greater<int>());
      |     ^~~~
      |     short
Language: C++

#include <cstdio>
#include <algorithm>
#include <map>

using namespace std;
int m, n;
int p[10001];
int c[501];
int e[501];
int dp[10001][501];

/*
??????????????? ?????????????£???? ??¨ ??±????????± ???????????????
?\?????????????????£??????¨??? ??????????????????
???????????\?????± ????????????

*/
int solve(int i,int j){
	if (i < 0){
		return (0);
	}
	if (j > m){
		return 1e9;
	}
	if(dp[i][j] != -1){
		return dp[i][j];
	}
	int tmp, tmp2;
	tmp = e[j] + solve(i - c[j], j+1);
	tmp2 = solve(i, j+1);
	
	dp[i][j] = min(tmp, tmp2);
	//printf(" %d %d %d\n", i, j, dp[i][j]);
	return dp[i][j];
}

int main()
{
	scanf("%d %d", &m, &n);
	for (int i = 0; i < m; i++){
		scanf("%d", &p[i]);
	}
	for (int i = 0; i < n; i++){
		scanf("%d %d", &c[i], &e[i]);
	}
	
	memset(dp, -1, sizeof(dp));
	
	solve(m, 0);
	
	sort(p, p + m);
	reverse(p, p + m);
	
	int set_value = 0;
	int rieki = 0;
	for(int i = 0; i < m;i++){
		set_value += p[i];
		rieki = max(rieki, set_value - solve(i, 0));
	}
	
	printf("%d\n", rieki);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:9: error: 'memset' was not declared in this scope
   47 |         memset(dp, -1, sizeof(dp));
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <map>
  +++ |+#include <cstring>
    4 |
Language: C++

#include <cstdio>
#include <algorithm>
#include <map>
#include <memset>

using namespace std;
int m, n;
int p[10001];
int c[501];
int e[501];
int dp[10001][501];

/*
??????????????? ?????????????£???? ??¨ ??±????????± ???????????????
?\?????????????????£??????¨??? ??????????????????
???????????\?????± ????????????

*/
int solve(int i,int j){
	if (i < 0){
		return (0);
	}
	if (j > m){
		return 1e9;
	}
	if(dp[i][j] != -1){
		return dp[i][j];
	}
	int tmp, tmp2;
	tmp = e[j] + solve(i - c[j], j+1);
	tmp2 = solve(i, j+1);
	
	dp[i][j] = min(tmp, tmp2);
	//printf(" %d %d %d\n", i, j, dp[i][j]);
	return dp[i][j];
}

int main()
{
	scanf("%d %d", &m, &n);
	for (int i = 0; i < m; i++){
		scanf("%d", &p[i]);
	}
	for (int i = 0; i < n; i++){
		scanf("%d %d", &c[i], &e[i]);
	}
	
	memset(dp, -1, sizeof(dp));
	
	solve(m, 0);
	
	sort(p, p + m);
	reverse(p, p + m);
	
	int set_value = 0;
	int rieki = 0;
	for(int i = 0; i < m;i++){
		set_value += p[i];
		rieki = max(rieki, set_value - solve(i, 0));
	}
	
	printf("%d\n", rieki);
}

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

#include<bits/stdc++.h>
using namespace std;
#define INF (1<<30)
??
int main()
{
????int M, N, C[10000], E[10000];
????int P[10001] = {0};
??
????cin >> M >> N;
????for(int i = 1; i <= M; i++) {
????????cin >> P[i];
????}
????for(int i = 0; i < N; i++) {
????????cin >> C[i] >> E[i];
????}
??
????sort(P + 1, P + M + 1, greater< int >());
????for(int i = 1; i <= M; i++) {
????????P[i] += P[i - 1];
????}
??
????int dp[20001];
????fill_n(dp, 20001, INF);
????dp[0] = 0;
????for(int i = 0; i < N; i++) {
????????for(int j = 20000; j >= C[i]; j--) {
????????????dp[j] = min(dp[j], dp[j - C[i]] + E[i]);
????????}
????}
????int ret = 0;
????for(int i = 0; i <= M; i++) {
????????ret = max(ret, P[i] - dp[i]);
????}
????cout << ret << endl;
}

Compiler output:
a.cc:4:1: error: expected unqualified-id before '?' token
    4 | ??
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define INF (1<<55)
const long long INF = 1LL << 55;
 
int main()
{
  int M, N, C[10000], E[10000];
  int P[10001] = {0};
 
  cin >> M >> N;
  for(int i = 1; i <= M; i++) {
    cin >> P[i];
  }
  for(int i = 0; i < N; i++) {
    cin >> C[i] >> E[i];
  }
 
  sort(P + 1, P + M + 1, greater< int >());
  for(int i = 1; i <= M; i++) {
    P[i] += P[i - 1];
  }
 
  int dp[20001];
  fill_n(dp, 20001, INF);
  dp[0] = 0;
  for(int i = 0; i < N; i++) {
    for(int j = 20000; j >= C[i]; j--) {
      dp[j] = min(dp[j], dp[j - C[i]] + E[i]);
    }
  }
  int ret = 0;
  for(int i = 0; i <= M; i++) {
    ret = max(ret, P[i] - dp[i]);
  }
  cout << ret << endl;
}

Compiler output:
a.cc:3:14: error: expected unqualified-id before numeric constant
    3 | #define INF (1<<55)
      |              ^
a.cc:4:17: note: in expansion of macro 'INF'
    4 | const long long INF = 1LL << 55;
      |                 ^~~
a.cc:3:14: error: expected ')' before numeric constant
    3 | #define INF (1<<55)
      |             ~^
a.cc:4:17: note: in expansion of macro 'INF'
    4 | const long long INF = 1LL << 55;
      |                 ^~~
a.cc: In function 'int main()':
a.cc:3:15: warning: left shift count >= width of type [-Wshift-count-overflow]
    3 | #define INF (1<<55)
      |              ~^~~~
a.cc:25:21: note: in expansion of macro 'INF'
   25 |   fill_n(dp, 20001, INF);
      |                     ^~~
Language: Java

import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.Map;
import java.util.PriorityQueue;
import java.math.BigDecimal;
import java.math.BigInteger;
    
public class Main{

static final InputStream in=System.in;
static final PrintWriter out=new PrintWriter(System.out);
static final int INF=Integer.MAX_VALUE/2;
static final long LINF=Long.MAX_VALUE/2;
static int N;
static long[] sum;

public static void main(String[] args) throws IOException{
InputReader ir=new InputReader(in);
N=ir.nextInt();
int[] a=ir.toIntArray(N);
sum=new long[2*N+1];
sum[0]=0;
for(int i=1;i<=2*N;i++) sum[i]=sum[i-1]+(long)a[(i-1)%N];
long ans=0;
for(int i=0;i<N-2;i++){
int l=i+1;
int r=i+2;
while(true){
if(r>=N) break;
long a=sum[i+N]-sum[r];
long b=sum[r]-sum[l];
long c=sum[l]-sum[i];
long res;
if(a<=b&&a<=c){
ans=Math.max(ans,a);
break;
}
else if(b<=a&&b<=c){
res=b;
r++;
}
else{
res=c;
if(r>l+1) l++;
else r++;
}
ans=Math.max(ans,res);
}
}
out.println(ans);
out.flush();
}

static class InputReader {
private InputStream in;
private byte[] buffer=new byte[1024];
private int curbuf;
private int lenbuf;

public InputReader(InputStream in) {this.in=in;}
  
public int readByte() {
if(lenbuf==-1) throw new InputMismatchException();
if(curbuf>=lenbuf){
curbuf= 0;
try{
lenbuf=in.read(buffer);
}
catch (IOException e) {
throw new InputMismatchException();
}
if(lenbuf<=0)
return -1;
}
return buffer[curbuf++];
}

public boolean isSpaceChar(int c){return !(c>=33&&c<=126);}

private int skip() {int b; while((b = readByte())!=-1&&isSpaceChar(b)); return b;}

public String next() {
int b=skip();
StringBuilder sb=new StringBuilder();
while(!isSpaceChar(b)){
sb.appendCodePoint(b);
b=readByte();
}
return sb.toString();
}
 
public int nextInt() {
int c=readByte();
while (isSpaceChar(c)) c=readByte();
boolean minus=false;
if (c=='-') {
minus=true;
c=readByte();
}
int res=0;
do{
if(c<'0'||c>'9') throw new InputMismatchException();
res=res*10+c-'0';
c=readByte();
}while(!isSpaceChar(c));
return (minus)?-res:res;
}

public long nextLong() {
int c=readByte();
while (isSpaceChar(c)) c=readByte();
boolean minus=false;
if (c=='-') {
minus=true;
c=readByte();
}
long res = 0;
do{
if(c<'0'||c>'9') throw new InputMismatchException();
res=res*10+c-'0';
c=readByte();
}while(!isSpaceChar(c));
return (minus)?-res:res;
}

public int[] toIntArray(int n){
int[] a=new int[n];
for(int i=0;i<n;i++) a[i]=nextInt();
return a;
}
}
}

Compiler output:
Main.java:40: error: variable a is already defined in method main(String[])
long a=sum[i+N]-sum[r];
     ^
1 error
Language: Java

import java.util.Scanner;

public class Baumkuchen {
	public static void main(String[] args){
		int B1 = 0;
		int B2 = 0;
		int B3 = 0;
		int B4 = 0;
		int Bmin = 0;
		int BMIN = 0;
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int b[] = new int[n];
		for(int x = 0; x <= n-1; x++){
			b[x] = scan.nextInt();
		}
		for(int p = 1; p <= n-2; p++){
			for(int q = p+1; q <= n-1; q++){
				B1 = 0;
				B2 = 0;
				B3 = 0;
				for(int i = 0; i <= p-1; i++){
					B1 += b[i];
				}
				for(int j = p; j <= q-1; j++){
					B2 += b[j];
				}
				for(int k = q; k <= n-1; k++){
					B3 += b[k];
				}
				Bmin = Math.min(B1, B2);
				Bmin = Math.min(Bmin, B3);
				BMIN = Math.max(BMIN, Bmin);
			}
		}
		for(int p = 1; p <= n-3; p++){
			for(int q = p+1; q <= n-2; q++){
				for(int r = q+1; r <= n-1; r++){
					B1 = 0;
					B2 = 0;
					B3 = 0;
					B4 = 0;
					for(int i = 0; i <= p-1; i++){
						B1 += b[i];
					}
					for(int j = p; j <= q-1; j++){
						B2 += b[j];
					}
					for(int k = q; k <= r-1; k++){
						B3 += b[k];
					}
					for(int l = r; l <= n-1; l++){
						B4 += b[l];
					}
					Bmin = Math.min(B1+B4, B2);
					Bmin = Math.min(Bmin, B3);
					BMIN = Math.max(BMIN, Bmin);
				}
			}
		}

		System.out.println("????°????????????§??????"+BMIN+"??§???");

	}
}

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

import java.io.*;

public class Main{
	public static void main(String[] args){
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = BufferedReader(is);
		
		String str = br.readLine();
		int kosuu = Integer.perseInt(str);
		int[] A = new int[kosuu];//配列の宣言の仕方自信なし
		int m = 2000000000, M = 0;
		int kei = 0;
		int kei1 = 0, kei2 = 0, kei3 = 0;//3つの切り分けた領域の合計を表す
		
		for(int i = 0; i < kosuu; i++){
			A[i] = Integer.perseInt(br.readLine())//引数に戻り値のあるメソッドを指定してよいかわからない
		}
		
		for(int i = 1; i < kosuu; i++){
			for(int j = i + 1; j < kosuu + 1; j++){
				for(int k = j + 1; k < kosuu + 2; k++){
					for(int i2 = 0; i2 < i; i2++) kei1 = kei1 + A[i2];
					if(m > kei1) m = kei1;
					for(int j2 = i; j2 < j; j2++) kei2 = kei2 + A[j2];
					if(m > kei2) m = kei2;
					for(int k2 = j; k2 < k; k2++) kei3 = kei3 + A[k2];
					if(m > kei3) m = kei3;
			
					if(m > M) M = m;
				}
			}
		}
		System.out.println(M);
	}
}


Compiler output:
Main.java:16: error: ';' expected
			A[i] = Integer.perseInt(br.readLine())//??????????????????????????
			                                      ^
1 error
Language: Java

import java.io.*;

public class Main{
	public static void main(String[] args){
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = BufferedReader(is);
		
		String str = br.readLine();
		int kosuu = Integer.perseInt(str);
		int[] A = new int[kosuu];//配列の宣言の仕方自信なし
		int m = 2000000000, M = 0;
		int kei = 0;
		int kei1 = 0, kei2 = 0, kei3 = 0;//3つの切り分けた領域の合計を表す
		
		for(int i = 0; i < kosuu; i++){
			str = br.readLine()
			A[i] = Integer.perseInt(str)//引数に戻り値のあるメソッドを指定してよいかわからない
		}
		
		for(int i = 1; i < kosuu; i++){
			for(int j = i + 1; j < kosuu + 1; j++){
				for(int k = j + 1; k < kosuu + 2; k++){
					for(int i2 = 0; i2 < i; i2++) kei1 = kei1 + A[i2];
					if(m > kei1) m = kei1;
					for(int j2 = i; j2 < j; j2++) kei2 = kei2 + A[j2];
					if(m > kei2) m = kei2;
					for(int k2 = j; k2 < k; k2++) kei3 = kei3 + A[k2];
					if(m > kei3) m = kei3;
			
					if(m > M) M = m;
				}
			}
		}
		System.out.println(M);
	}
}


Compiler output:
Main.java:16: error: ';' expected
			str = br.readLine()
			                   ^
Main.java:17: error: ';' expected
			A[i] = Integer.perseInt(str)//??????????????????????????
			                            ^
2 errors
Language: Java

import java.io.*;

public class Main{
	public static void main(String[] args) throws IOException{
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = BufferedReader(is);
		
		String str = br.readLine();
		int kosuu = Integer.perseInt(str);
		int[] A = new int[kosuu];//配列の宣言の仕方自信なし
		int m = 2000000000, M = 0;
		int kei = 0;
		int kei1 = 0, kei2 = 0, kei3 = 0;//3つの切り分けた領域の合計を表す
		
		for(int i = 0; i < kosuu; i++){
			str = br.readLine();
			A[i] = Integer.perseInt(str);//引数に戻り値のあるメソッドを指定してよいかわからない
		}
		
		for(int i = 1; i < kosuu; i++){
			for(int j = i + 1; j < kosuu + 1; j++){
				for(int k = j + 1; k < kosuu + 2; k++){
					for(int i2 = 0; i2 < i; i2++) kei1 = kei1 + A[i2];
					if(m > kei1) m = kei1;
					for(int j2 = i; j2 < j; j2++) kei2 = kei2 + A[j2];
					if(m > kei2) m = kei2;
					for(int k2 = j; k2 < k; k2++) kei3 = kei3 + A[k2];
					if(m > kei3) m = kei3;
			
					if(m > M) M = m;
				}
			}
		}
		System.out.println(M);
	}
}


Compiler output:
Main.java:6: error: cannot find symbol
		BufferedReader br = BufferedReader(is);
		                    ^
  symbol:   method BufferedReader(InputStreamReader)
  location: class Main
Main.java:9: error: cannot find symbol
		int kosuu = Integer.perseInt(str);
		                   ^
  symbol:   method perseInt(String)
  location: class Integer
Main.java:17: error: cannot find symbol
			A[i] = Integer.perseInt(str);//??????????????????????????
			              ^
  symbol:   method perseInt(String)
  location: class Integer
3 errors
Language: Java

import java.io.*;

public class Main{
	public static void main(String[] args) throws IOException{
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);
		
		String str = br.readLine();
		int kosuu = Integer.perseInt(str);
		int[] A = new int[kosuu];//配列の宣言の仕方自信なし
		int m = 2000000000, M = 0;
		int kei = 0;
		int kei1 = 0, kei2 = 0, kei3 = 0;//3つの切り分けた領域の合計を表す
		
		for(int i = 0; i < kosuu; i++){
			str = br.readLine();
			A[i] = Integer.perseInt(str);//引数に戻り値のあるメソッドを指定してよいかわからない
		}
		
		for(int i = 1; i < kosuu; i++){
			for(int j = i + 1; j < kosuu + 1; j++){
				for(int k = j + 1; k < kosuu + 2; k++){
					for(int i2 = 0; i2 < i; i2++) kei1 = kei1 + A[i2];
					if(m > kei1) m = kei1;
					for(int j2 = i; j2 < j; j2++) kei2 = kei2 + A[j2];
					if(m > kei2) m = kei2;
					for(int k2 = j; k2 < k; k2++) kei3 = kei3 + A[k2];
					if(m > kei3) m = kei3;
			
					if(m > M) M = m;
				}
			}
		}
		System.out.println(M);
	}
}


Compiler output:
Main.java:9: error: cannot find symbol
		int kosuu = Integer.perseInt(str);
		                   ^
  symbol:   method perseInt(String)
  location: class Integer
Main.java:17: error: cannot find symbol
			A[i] = Integer.perseInt(str);//??????????????????????????
			              ^
  symbol:   method perseInt(String)
  location: class Integer
2 errors
Language: Java

import java.io.*;

public class Main0600{
	public static void main(String[] args) throws IOException{
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);
		
		String str = br.readLine();
		int N = Integer.parseInt(str);
		int[] A = new int[N];
		int m = 2000000000, M = 0;
		int kei = 0;
		int kei1 = 0, kei2 = 0, kei3 = 0;//3つの切り分けた領域の合計を表す
		int tmp;
		
		for(int i = 0; i < N; i++){
			str = br.readLine();
			A[i] = Integer.parseInt(str);
		}
		
		//主処理
		for(int n = 0; n < N; n++){
			for(int i = 1; i < N; i++){
				for(int j = i + 1; j < N + 1; j++){
						for(int i2 = 1; i2 <= i; i2++) kei1 = kei1 + A[i2 - 1];
						if(m > kei1) m = kei1;
						for(int j2 = i + 1; j2 <= j; j2++) kei2 = kei2 + A[j2 - 1];
						if(m > kei2) m = kei2;
						for(int k2 = j + 1; k2 <= N; k2++) kei3 = kei3 + A[k2 - 1];
						if(m > kei3) m = kei3;
						
						if(m > M) M = m;
						
						kei1 = 0;
						kei2 = 0;
						kei3 = 0;
						m = 2000000000;
				}
			}
			//1番目に切れ込みを入れるパターンしか計算されないので、バウムクーヘンを回す(配列を循環させる）
			tmp = A[0];
			for(int n2 = 0; n2 < N - 1; n2++) A[n2] = A[n2 + 1];
			A[N - 1] =tmp;
		}
		System.out.println(M);
	}
}


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

import java.io.*;

public class Main{
	public static void main(String[] args) throws IOException{
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);
		
		String str = br.readLine();
		int N = Integer.parseInt(str);
		int[] A = new int[N];
		long int m = 200000000000, M = 0;
		int kei = 0;
		int kei1 = 0, kei2 = 0, kei3 = 0;//3つの切り分けた領域の合計を表す
		int tmp;
		
		for(int i = 0; i < N; i++){
			str = br.readLine();
			A[i] = Integer.parseInt(str);
		}
		
		//主処理
		for(int n = 0; n < N; n++){
			for(int i = 1; i < N; i++){
				for(int j = i + 1; j < N + 1; j++){
						for(int i2 = 1; i2 <= i; i2++) kei1 = kei1 + A[i2 - 1];
						if(m > kei1) m = kei1;
						for(int j2 = i + 1; j2 <= j; j2++) kei2 = kei2 + A[j2 - 1];
						if(m > kei2) m = kei2;
						for(int k2 = j + 1; k2 <= N; k2++) kei3 = kei3 + A[k2 - 1];
						if(m > kei3) m = kei3;
						
						if(m > M) M = m;
						
						kei1 = 0;
						kei2 = 0;
						kei3 = 0;
						m = 200000000000;
				}
			}
			//1番目に切れ込みを入れるパターンしか計算されないので、バウムクーヘンを回す(配列を循環させる）
			tmp = A[0];
			for(int n2 = 0; n2 < N - 1; n2++) A[n2] = A[n2 + 1];
			A[N - 1] =tmp;
		}
		System.out.println(M);
	}
}


Compiler output:
Main.java:11: error: not a statement
		long int m = 200000000000, M = 0;
		^
Main.java:11: error: ';' expected
		long int m = 200000000000, M = 0;
		    ^
Main.java:11: error: integer number too large
		long int m = 200000000000, M = 0;
		             ^
Main.java:37: error: integer number too large
						m = 200000000000;
						    ^
4 errors
Language: Java

import java.io.*;

public class Main{
	public static void main(String[] args) throws IOException{
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);
		
		String str = br.readLine();
		int N = Integer.parseInt(str);
		int[] A = new int[N];
		long m = 200000000000, M = 0;
		int kei = 0;
		int kei1 = 0, kei2 = 0, kei3 = 0;//3つの切り分けた領域の合計を表す
		int tmp;
		
		for(int i = 0; i < N; i++){
			str = br.readLine();
			A[i] = Integer.parseInt(str);
		}
		
		//主処理
		for(int n = 0; n < N; n++){
			for(int i = 1; i < N; i++){
				for(int j = i + 1; j < N + 1; j++){
						for(int i2 = 1; i2 <= i; i2++) kei1 = kei1 + A[i2 - 1];
						if(m > kei1) m = kei1;
						for(int j2 = i + 1; j2 <= j; j2++) kei2 = kei2 + A[j2 - 1];
						if(m > kei2) m = kei2;
						for(int k2 = j + 1; k2 <= N; k2++) kei3 = kei3 + A[k2 - 1];
						if(m > kei3) m = kei3;
						
						if(m > M) M = m;
						
						kei1 = 0;
						kei2 = 0;
						kei3 = 0;
						m = 200000000000;
				}
			}
			//1番目に切れ込みを入れるパターンしか計算されないので、バウムクーヘンを回す(配列を循環させる）
			tmp = A[0];
			for(int n2 = 0; n2 < N - 1; n2++) A[n2] = A[n2 + 1];
			A[N - 1] =tmp;
		}
		System.out.println(M);
	}
}


Compiler output:
Main.java:11: error: integer number too large
		long m = 200000000000, M = 0;
		         ^
Main.java:37: error: integer number too large
						m = 200000000000;
						    ^
2 errors
Language: Java

import java.io.*;

public class Main{
	public static void main(String[] args) throws IOException{
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);
		
		String str = br.readLine();
		int N = Integer.parseInt(str);
		int[] A = new int[N];
		long m = 20000000000, M = 0;
		int kei = 0;
		int kei1 = 0, kei2 = 0, kei3 = 0;//3つの切り分けた領域の合計を表す
		int tmp;
		
		for(int i = 0; i < N; i++){
			str = br.readLine();
			A[i] = Integer.parseInt(str);
		}
		
		//主処理
		for(int n = 0; n < N; n++){
			for(int i = 1; i < N; i++){
				for(int j = i + 1; j < N + 1; j++){
						for(int i2 = 1; i2 <= i; i2++) kei1 = kei1 + A[i2 - 1];
						if(m > kei1) m = kei1;
						for(int j2 = i + 1; j2 <= j; j2++) kei2 = kei2 + A[j2 - 1];
						if(m > kei2) m = kei2;
						for(int k2 = j + 1; k2 <= N; k2++) kei3 = kei3 + A[k2 - 1];
						if(m > kei3) m = kei3;
						
						if(m > M) M = m;
						
						kei1 = 0;
						kei2 = 0;
						kei3 = 0;
						m = 20000000000;
				}
			}
			//1番目に切れ込みを入れるパターンしか計算されないので、バウムクーヘンを回す(配列を循環させる）
			tmp = A[0];
			for(int n2 = 0; n2 < N - 1; n2++) A[n2] = A[n2 + 1];
			A[N - 1] =tmp;
		}
		System.out.println(M);
	}
}


Compiler output:
Main.java:11: error: integer number too large
		long m = 20000000000, M = 0;
		         ^
Main.java:37: error: integer number too large
						m = 20000000000;
						    ^
2 errors