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

#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>

using namespace std;

long long int*** dp;

void func(int n,int s){
	for(int i = 1; i <= n; i++){
		for(int k = 0; k <= 100; k++){
			for(int p = 0; p <= s; p++)dp[i][k][p] = 0;
		}
	}

	for(int i = 0; i <= 100; i++){
		dp[1][i][i] = 1;
	}

	for(int i = 2; i <= n; i++){
		for(int k = 0; k <= 100; k++){
			for(int a = 0; a <= k-1; a++){
				for(int p = k; p <= s; p++){
					dp[i][k][p] += dp[i-1][a][p-k];
				}
			}
		}
	}

	int ans = 0;

	for(int i = 0; i <= 100; i++)ans += dp[n][i][s];

	printf("%lld\n",ans);

}

int main(){

	dp = new int**[10];
	for(int i = 1; i <= 9; i++){
		dp[i] = new int*[101];
		for(int k = 0; k <= 100; k++){
			dp[i][k] = new int[1001];
		}
	}

	int n,s;

	while(true){
		scanf("%d %d",&n,&s);
		if(n == 0 && s == 0)break;

		func(n,s);

	}

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:14: error: cannot convert 'int***' to 'long long int***' in assignment
   43 |         dp = new int**[10];
      |              ^~~~~~~~~~~~~
      |              |
      |              int***
a.cc:45:25: error: cannot convert 'int**' to 'long long int**' in assignment
   45 |                 dp[i] = new int*[101];
      |                         ^~~~~~~~~~~~~
      |                         |
      |                         int**
a.cc:47:36: error: cannot convert 'int*' to 'long long int*' in assignment
   47 |                         dp[i][k] = new int[1001];
      |                                    ^~~~~~~~~~~~~
      |                                    |
      |                                    int*
Language: C++

#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>

using namespace std;

int main(){

	long long int dp = new long long int**[10];
	for(int i = 1; i <= 9; i++){
		dp[i] = new long long int*[101];
		for(int k = 0; k <= 100; k++){
			dp[i][k] = new long long int[1001];
			for(int p = 0; p <= 1000; p++)dp[i][k][p] = 0;
		}
	}

	for(int i = 0; i <= 100; i++){
		dp[1][i][i] = 1;
	}

	for(int i = 2; i <= 9; i++){
		for(int k = 0; k <= 100; k++){
			for(int a = 0; a <= k-1; a++){
				for(int p = k; p <= 1000; p++){
					dp[i][k][p] += dp[i-1][a][p-k];
				}
			}
		}
	}

	long long int ans;
	int n,s;

	while(true){
		scanf("%d %d",&n,&s);
		if(n == 0 && s == 0)break;

		ans = 0;
		for(int i = 0; i <= 100; i++)ans += dp[n][i][s];

		printf("%lld\n",ans);

	}

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:50: error: invalid conversion from 'long long int***' to 'long long int' [-fpermissive]
   12 |         long long int dp = new long long int**[10];
      |                                                  ^
      |                                                  |
      |                                                  long long int***
a.cc:14:19: error: invalid types 'long long int[int]' for array subscript
   14 |                 dp[i] = new long long int*[101];
      |                   ^
a.cc:16:27: error: invalid types 'long long int[int]' for array subscript
   16 |                         dp[i][k] = new long long int[1001];
      |                           ^
a.cc:17:57: error: invalid types 'long long int[int]' for array subscript
   17 |                         for(int p = 0; p <= 1000; p++)dp[i][k][p] = 0;
      |                                                         ^
a.cc:22:19: error: invalid types 'long long int[int]' for array subscript
   22 |                 dp[1][i][i] = 1;
      |                   ^
a.cc:29:43: error: invalid types 'long long int[int]' for array subscript
   29 |                                         dp[i][k][p] += dp[i-1][a][p-k];
      |                                           ^
a.cc:29:58: error: invalid types 'long long int[int]' for array subscript
   29 |                                         dp[i][k][p] += dp[i-1][a][p-k];
      |                                                          ^
a.cc:43:55: error: invalid types 'long long int[int]' for array subscript
   43 |                 for(int i = 0; i <= 100; i++)ans += dp[n][i][s];
      |                                                       ^
Language: C++


#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
#include <algorithm>
#define max(a,b) {a > b ? a:b}
using namespace std;

//????´????????????§?????????????????????
#define P 101
#define MAX 1000000000
int cnt;
void rec(int prev_i, int n, int s) {


	if (n == 1) {
		if (s > prev_i && s <= 100) cnt++;
		return;
	}

/*
	if (n == 2) {
		if ((s - 1) / 2 - prev_i > 0) {
			cnt += (s - 1) / 2 - prev_i;
		}
		return;
	}
*/

	for (int i = max(prev_i + 1,0 s - 100* n); i < P; i++) {
		if (s - i*n < 0) return;
		rec(i, n - 1, s - i);
	}
}

void q97() {
	int n, s;
	for (; cin >> n >> s;) {
		if (!n && !s) break;
		cnt = 0;
		rec(-1, n, s);
		cout << cnt << endl;
	}
}

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

Compiler output:
a.cc: In function 'void rec(int, int, int)':
a.cc:31:39: error: expected '}' before 's'
   31 |         for (int i = max(prev_i + 1,0 s - 100* n); i < P; i++) {
      |                                       ^
a.cc:7:23: note: in definition of macro 'max'
    7 | #define max(a,b) {a > b ? a:b}
      |                       ^
a.cc:7:18: note: to match this '{'
    7 | #define max(a,b) {a > b ? a:b}
      |                  ^
a.cc:31:22: note: in expansion of macro 'max'
   31 |         for (int i = max(prev_i + 1,0 s - 100* n); i < P; i++) {
      |                      ^~~
a.cc:31:39: error: expected ';' before 's'
   31 |         for (int i = max(prev_i + 1,0 s - 100* n); i < P; i++) {
      |                                       ^
a.cc:7:23: note: in definition of macro 'max'
    7 | #define max(a,b) {a > b ? a:b}
      |                       ^
a.cc:31:39: error: expected ';' before 's'
   31 |         for (int i = max(prev_i + 1,0 s - 100* n); i < P; i++) {
      |                                       ^
a.cc:7:29: note: in definition of macro 'max'
    7 | #define max(a,b) {a > b ? a:b}
      |                             ^
a.cc:7:30: error: expected ')' before '}' token
    7 | #define max(a,b) {a > b ? a:b}
      |                              ^
a.cc:31:22: note: in expansion of macro 'max'
   31 |         for (int i = max(prev_i + 1,0 s - 100* n); i < P; i++) {
      |                      ^~~
a.cc:31:13: note: to match this '('
   31 |         for (int i = max(prev_i + 1,0 s - 100* n); i < P; i++) {
      |             ^
a.cc:7:30: error: expected primary-expression before '}' token
    7 | #define max(a,b) {a > b ? a:b}
      |                              ^
a.cc:31:22: note: in expansion of macro 'max'
   31 |         for (int i = max(prev_i + 1,0 s - 100* n); i < P; i++) {
      |                      ^~~
a.cc: At global scope:
a.cc:31:52: error: 'i' does not name a type
   31 |         for (int i = max(prev_i + 1,0 s - 100* n); i < P; i++) {
      |                                                    ^
a.cc:31:59: error: 'i' does not name a type
   31 |         for (int i = max(prev_i + 1,0 s - 100* n); i < P; i++) {
      |                                                           ^
a.cc:35:1: error: expected declaration before '}' token
   35 | }
      | ^
Language: C++

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
#include <algorithm>
#define max(a,b) {a > b ? a:b}
using namespace std;
//????´????????????§?????????????????????
#define P 101
#define MAX 1000000000
int cnt;
void rec(int prev_i, int n, int s) {
	//if (cnt > MAX) return;
	/*if (!n) {
		if (!s) cnt++;
		return;
	}*/
	if (n == 1) {
		if (s > prev_i && s <= 100) cnt++;
		return;
	}
	
	if (n == 2) {
		if (s > 100+99) return;
		int t = max(prev_i, s - 100 - 1);
		if ((s - 1) / 2 - t > 0) {
			cnt += (s - 1) / 2 - t;
		}
		return;
	}
	for (int i = max(prev_i + 1, s - 100* n); i < P; i++) {
		if (s - i*n < 0) return;
		rec(i, n - 1, s - i);
	}
}

void q97() {
	int n, s;
	for (; cin >> n >> s;) {
		if (!n && !s) break;
		cnt = 0;
		rec(-1, n, s);
		cout << cnt << endl;
	}
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
constexpr int MOD = 1000000000 + 7;
constexpr int INF = 2000000000;
using namespace std;


int main() {
	int dp[11][101][1001];
	memset(dp, 0, sizeof(dp));
	for (int i = 0; i < 10; i++) {
		for (int j = 0; j <= 100; j++) {
			if (i == 0 && j == 0)dp[0][0][0] = 1;
			else if (i == 0 || j == 0)continue;
			for (int d = 1; d + j <= 1000;d++) {
				dp[i][j][d + j] += dp[i - 1][j][d];
			}
		}
	}
	int a, b;
	while (cin >> a >> b && (a || b)) {
		if (a == 1 && b == 0)cout << 1 << endl;
		else {
			int ans = 0;
			for (int i = 0; i <=100 ; i++) {
				ans += dp[a][i][b];
			}
			cout << ans << endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'memset' was not declared in this scope
   21 |         memset(dp, 0, sizeof(dp));
      |         ^~~~~~
a.cc:14:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   13 | # include <list>
  +++ |+#include <cstring>
   14 | constexpr int MOD = 1000000000 + 7;
Language: C++

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

int x,y;
int  cnt[];

int mySet(int d,int sum,int n){
	int a=0;
	if(d==x){
		if(sum==y){
			return 1;
		}else{
			return 0;
		}
	}
	for(int j=n;j<=9;j++){
		a+=mySet(d+1,sum+j,j+1);
	}
	return a;
}

int main(void){
	while(1){
		cin>>x>>y;
		if(x==0&&y==0){
			break;
		}else{
			cout<<mySet(0,0,0)<<endl;
		}
	}
	return 0;
}

Compiler output:
a.cc:5:6: error: storage size of 'cnt' isn't known
    5 | int  cnt[];
      |      ^~~
Language: C++

#include<iostream>
using namespace std;

int memo[10][1001];

int solve(int n, int s, int p){

  if(!n && !s) return 1;
  if(n < 1 || s < 1) return 0;
  if(memo[n][s]) return memo[n][s];

  int ans = 0;
  for(int i=p;i<101;i++) ans += solve(n-1, s-i, i+1);

  return memo[n][s] = ans;
}

int main(){

  int n, s;

  while(true){
    cin >> n >> s;
    if(!n && !s) break;
    memset(memo, 0, sizeof(memo));

    cout << solve(n, s, 0) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:5: error: 'memset' was not declared in this scope
   25 |     memset(memo, 0, sizeof(memo));
      |     ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include <cstring>

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

long long memo[101][10][1001];

// x以下からちょうどk個でsを作る
long long solve(int x, int k, int s) {
  if(k == 0 && s == 0) return 1;
  if(s < 0) return 0;
  if(x < 0) return 0;
  if(k == 0) return 0;
  int &res = memo[x][k][s];
  if(res != -1) return res;
  return res = solve(x - 1, k, s) + solve(x - 1, k - 1, s - x);
}

int main() {
  memset(memo, -1, sizeof(memo));
  while(true) {
    int n, s; cin >> n >> s;
    if(n == 0 && s == 0) break;
    cout << solve(100, n, s) << endl;
  }
}

Compiler output:
a.cc: In function 'long long int solve(int, int, int)':
a.cc:15:26: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'long long int'
   15 |   int &res = memo[x][k][s];
      |              ~~~~~~~~~~~~^
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define between(a,x,b) ((a)<=(x)&&(x)<=(b))
#define F first
#define S second
#define INF 1 << 30

int dp[10][1001];

int main(){
  dp[0][0] = 1;
  for(int k = 0; k <= 100; ++k){
    //    for(int i = 0; i < 9; ++i){
    for(int j = 1000; j >= 0; --j){
      for(int i = 9; i > 0; --i){
	if( j - k < 0) break;
	dp[i][j] += dp[i-1][j-k];
	//	printf("%d %d %d %d", i, j, k, dp[i][j]);
      }
    }
  }

 
  int n, s;
  while(scanf("%d%d", &n, &s) && n+s)
    printf("%d\n", dp[n][s]);

Compiler output:
a.cc: In function 'int main()':
a.cc:41:30: error: expected '}' at end of input
   41 |     printf("%d\n", dp[n][s]);
      |                              ^
a.cc:25:11: note: to match this '{'
   25 | int main(){
      |           ^
Language: C

#include <stdio.h>
#define max(a,b) (a)>(b) ? (a):(b);
int n;
int a[100][100];
long psum[100][100][100];
main(){
	int i,j,k,l;
	long maxsum;
	int t1;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		for(j=0;j<n;j++)
			scanf("%d",&a[i][j]);

	maxsum=psum[0][0][0]=a[0][0];
	for(l=1;l<n;l++){
		psum[0][0][l]=psum[0][0][l-1]+a[0][l];
		maxsum=max(maxsum,psum[0][0][l]);
	}

	for(k=1;k<n;k++){
		t1=0;
		for(l=0;l<n;l++){
			psum[0][k][l]=psum[0][k-1][l];
			t1+=a[k][l];
			psum[0][k][l]+=t1;
			maxsum=max(maxsum,psum[0][k][l])
		}
	}

	for(j=1;j<n;j++)
		t1=0;
		for(k=0;k<n;k++){
			t1+=a[j-1][k];
			for(l=j;l<n;l++){
				psum[j][k][l]=psum[j-1][k][l];
				psum[j][k][l]-=t1;
				maxsum=max(maxsum,psum[j][k][l]);
			}
		}

	for(i=1;i<n;i++){
		t1=0;
		for(j=0;j<n;j++,t1+=a[i-1][j-1]){
			for(k=i;k<n;k++){
				t2=0;
				for(l=j;l<n;l++){
					t2+=a[i-1][l]
					psum[j][k][l]-=t2-t1;
					maxsum=max(maxsum,psum[j][k][l]);
				}
			}
		}
	}

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

Compiler output:
main.c:6:1: error: return type defaults to 'int' [-Wimplicit-int]
    6 | main(){
      | ^~~~
main.c: In function 'main':
main.c:46:33: error: 't2' undeclared (first use in this function); did you mean 't1'?
   46 |                                 t2=0;
      |                                 ^~
      |                                 t1
main.c:46:33: note: each undeclared identifier is reported only once for each function it appears in
main.c:48:54: error: expected ';' before 'psum'
   48 |                                         t2+=a[i-1][l]
      |                                                      ^
      |                                                      ;
   49 |                                         psum[j][k][l]-=t2-t1;
      |                                         ~~~~
Language: C++

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

class SumOf2DArray {
private:
  vector<vector<int> > a;
  vector<vector<ll> >  S;
  int N_, M_;
  
  void precalc() {
    for(int i=0; i<N_; i++)
      for(int j=0; j<M_; j++)
        S[i+1][j+1] = S[i+1][j] + a[i][j];
    
    for(int i=0; i<N_; i++)
      for(int j=0; j<M_; j++)
        S[i+1][j+1] += S[i][j+1];
  }
  
public:
  
  SumOf2DArray(const vector<vector<int> >& a) {
    N_ = a.size();
    M_ = a[0].size();
    this->a = a;
    this->S.assign(N_+1, vector<ll>(M_+1, 0));
    precalc();
  }
  
  /*
    a[i][j] -> a[k][l] の和を求める。
    戻り値：long long
   */
  ll sum(int i, int j, int k, int l) {
    return S[k+1][l+1]-S[k+1][j]-S[i][l+1]+S[i][j];
  }
  
  /*
    長方形区間の最大の和を求める。O(N^4)
   */
  ll maxSum() {
    ll res = LLONG_MIN;
    for(int i=0; i<N_; i++)
      for(int j=0; j<M_; j++)
        for(int k=i; k<N_; k++)
          for(int l=j; l<M_; l++)
            res = max(res, sum(i, j, k, l));
    return res;
  }
  
};

int main() {
   
  int N; cin >> N;
  vector<vector<int> > a; a.resize(N, vector<int>(N));
  for(int i=0; i<N; i++)
    for(int j=0; j<N; j++)
      cin >> a[i][j];
  
  SumOf2DArray s(a);
  cout << s.maxSum() << endl;
   
  return 0;
}

Compiler output:
a.cc: In member function 'll SumOf2DArray::maxSum()':
a.cc:46:14: error: 'LLONG_MIN' was not declared in this scope
   46 |     ll res = LLONG_MIN;
      |              ^~~~~~~~~
a.cc:4:1: note: 'LLONG_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <algorithm>
  +++ |+#include <climits>
    4 | using namespace std;
Language: C++

#include<iostream>

using namespace std;


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

int main(){
	int n;
	while(cin>>n){
		if(n==0)break;
		int data[101][101];
		rep(i,n){
			rep(j,n){
				cin>>data[i][j];
			}
		}

		int ans=-999999999;

		rep(i,n){
			rep(j,n){
				int dp[101][101];
				rep(k,101)rep(l,101)dp[k][l]=-999999999;
				dp[i][j]=data[i][j];

				for(int k=i;k<n;k++){
					for(int l=j;l<n;l++){
						if(l+1<n){
							int right=0;
							for(int loop=i;loop<=k;loop++) right+=data[loop][l+1];
							dp[k][l+1]=dp[k][l]+right;
							ans=max(ans,dp[k][l+1]);
						}
						if(k+1<n){
							int under=0;
							for(int loop=j;loop<=l;loop++) under+=data[k+1][loop];
							dp[k+1][l]=dp[k][l]+under;
							ans=max(ans,dp[k+1][l]);
						}
						if(l+1<n && k+1<n){}
							dp[k+1][l+1]=dp[k][l+1]+dp[k+1][l]-dp[k][l]+data[k+1][l+1];
							ans=max(ans,dp[k+1][l+1]);
						}
					}
				}
			}
		}
		cout<<ans<<endl;

	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:23: error: 'ans' was not declared in this scope; did you mean 'abs'?
   49 |                 cout<<ans<<endl;
      |                       ^~~
      |                       abs
a.cc: At global scope:
a.cc:52:9: error: expected unqualified-id before 'return'
   52 |         return 0;
      |         ^~~~~~
a.cc:53:1: error: expected declaration before '}' token
   53 | }
      | ^
Language: C++

int main() {
    int n;
    cin >> n; cin.ignore();

    long data[n][n];

    for (int i = 0; i < n; i++) {
        string strRow = "";
        getline(cin, strRow);
        vector<string> row = split(strRow, " ");
        for (int j = 0; j < row.size(); j++) {
            data[i][j] = stoi(row[j]);
        }
    }

    long max = -1000000000000;

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            for (int k = i; k < n; k++) {
                for (int l = j; l < n; l++) {
                    long sum = 0;
                    for (int a = i; a <= k; a++) {
                        for (int b = j; b <= l; b++) {
                            sum += data[a][b];
                        }
                    }
                    max = sum > max ? sum : max;
                }
            }
        }
    }

     cout << max << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> n; cin.ignore();
      |     ^~~
a.cc:8:9: error: 'string' was not declared in this scope
    8 |         string strRow = "";
      |         ^~~~~~
a.cc:9:22: error: 'strRow' was not declared in this scope
    9 |         getline(cin, strRow);
      |                      ^~~~~~
a.cc:9:9: error: 'getline' was not declared in this scope
    9 |         getline(cin, strRow);
      |         ^~~~~~~
a.cc:10:9: error: 'vector' was not declared in this scope
   10 |         vector<string> row = split(strRow, " ");
      |         ^~~~~~
a.cc:10:24: error: 'row' was not declared in this scope
   10 |         vector<string> row = split(strRow, " ");
      |                        ^~~
a.cc:10:30: error: 'split' was not declared in this scope
   10 |         vector<string> row = split(strRow, " ");
      |                              ^~~~~
a.cc:12:26: error: 'stoi' was not declared in this scope
   12 |             data[i][j] = stoi(row[j]);
      |                          ^~~~
a.cc:34:6: error: 'cout' was not declared in this scope
   34 |      cout << max << endl;
      |      ^~~~
a.cc:34:21: error: 'endl' was not declared in this scope
   34 |      cout << max << endl;
      |                     ^~~~
Language: C++

#include <cstdio>
#include <algorithm>

using namespace std;

int n, a[100][100], sum[100][100];

int main()
{
    scanf("%d", &n);
    
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; i++)
        {
            cin >> a[i][j];
        }
    }
    
    sum[0][0] = a[0][0];
    
    for(int i = 1; i < n; i++)
    {
        sum[0][i] = sum[0][i - 1] + a[0][i];
        sum[i][0] = sum[i - 1][0] + a[i][0];
    }
    
    for(int i = 1; i < n; i++)
    {
        for(int j = 1; j < n; j++)
        {
            sum[i][j] = sum[i - 1][j] + sum[i][j - 1] - sum[i - 1][j - 1];
        }
    }
    
    int ret = -100000001;
    
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; j++)
        {
            for(int k = i + 1; k <= n; k++)
            {
                for(int l = j + 1; l <= n; l++)
                {
                    ret = max(ret, sum[k - 1][l - 1] + sum[i][j] - sum[i][l - 1] - sum[k - 1][j];
                }
            }
        }
    }
    
    printf("%d\n", ret);
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: 'cin' was not declared in this scope
   16 |             cin >> a[i][j];
      |             ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <algorithm>
  +++ |+#include <iostream>
    3 | 
a.cc:46:97: error: expected ')' before ';' token
   46 |                     ret = max(ret, sum[k - 1][l - 1] + sum[i][j] - sum[i][l - 1] - sum[k - 1][j];
      |                              ~                                                                  ^
      |                                                                                                 )
Language: C++

#include <cstdio>
#include <algorithm>

using namespace std;

int n, a[100][100], sum[100][100];

int main()
{
    scanf("%d", &n);
    
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; i++)
        {
            cin >> a[i][j];
        }
    }
    
    sum[0][0] = a[0][0];
    
    for(int i = 1; i < n; i++)
    {
        sum[0][i] = sum[0][i - 1] + a[0][i];
        sum[i][0] = sum[i - 1][0] + a[i][0];
    }
    
    for(int i = 1; i < n; i++)
    {
        for(int j = 1; j < n; j++)
        {
            sum[i][j] = sum[i - 1][j] + sum[i][j - 1] - sum[i - 1][j - 1];
        }
    }
    
    int ret = -100000001;
    
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; j++)
        {
            for(int k = i + 1; k <= n; k++)
            {
                for(int l = j + 1; l <= n; l++)
                {
                    ret = max(ret, sum[k - 1][l - 1] + sum[i][j] - sum[i][l - 1] - sum[k - 1][j]);
                }
            }
        }
    }
    
    printf("%d\n", ret);
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: 'cin' was not declared in this scope
   16 |             cin >> a[i][j];
      |             ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <algorithm>
  +++ |+#include <iostream>
    3 |
Language: C++

#include<iostream>
using namespace std;

int S[110][110] = { 0 }, a[110][110];


int main(){
	int n,max=-50000,t;
	cin >> n;
	for (int i = 0; i < n; i++){
		for (int j = 0; j < n; j++){
			cin >> a[i][j];
			S[i + 1][j + 1] = S[i][j + 1] + S[i + 1][j];
		}
	}
	for (int i = 1; i <= n; i++){
		for (int j = 1; j <= n; j++){
			for (int k = 0; k < i; k++){
				for (int h = 0; h < j; h++){
					t = S[i][j] - S[k][j] - S[i][h] + S[k][h];
					if (max ??? t)max = t;
				}
			}
		}
	}
	cout << t<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:50: error: expected primary-expression before '?' token
   21 |                                         if (max ??? t)max = t;
      |                                                  ^
a.cc:21:51: error: expected primary-expression before '?' token
   21 |                                         if (max ??? t)max = t;
      |                                                   ^
a.cc:21:54: error: expected ':' before ')' token
   21 |                                         if (max ??? t)max = t;
      |                                                      ^
      |                                                      :
a.cc:21:54: error: expected primary-expression before ')' token
a.cc:21:54: error: expected ':' before ')' token
   21 |                                         if (max ??? t)max = t;
      |                                                      ^
      |                                                      :
a.cc:21:54: error: expected primary-expression before ')' token
a.cc:21:54: error: expected ':' before ')' token
   21 |                                         if (max ??? t)max = t;
      |                                                      ^
      |                                                      :
a.cc:21:54: error: expected primary-expression before ')' token
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <stdio.h>
#include <ctype.h>
#include <string>
#include <iostream>
#include <vector>
#include <stack>
#include <fstream>
#include <sstrea

int mat[SIZE + 1][SIZE + 1] = { 0 };

int maxSumSeq(int* x, int len)
{
	int mss, s;
	mss = s = 0;
	for (int i = 0; i < len; i++) {
		s += x[i];
		if (s < 0) s = 0;
		if (mss < s) mss = s;
	}
	return mss;
}

void AOJ0098()
{
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++)
		{
			cin >> mat[i][j];
		}
	}

	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++)
		{
			mat[i][j] += mat[i][j - 1];
		}
	}

	for (int j = 1; j <= n; j++) {
		for (int i = 1; i <= n; i++)
		{
			mat[i][j] += mat[i - 1][j];
		}
	}

	int maxSum = INT32_MIN;
	int sum;
	for (int i1 = 0; i1 < n; i1++) {
		for (int i2 = i1; i2 <= n; i2++) {
			for (int j1 = 0; j1 < n; j1++) {
				for (int j2 = 0; j2 <= n; j2++) {
					sum = mat[i2][j2] - mat[i1][j2] - mat[i2][j1] + mat[i1][j1];
					if (maxSum < sum) maxSum = sum;
				}
			}
		}
	}
	cout << maxSum;

	return;
}

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

Compiler output:
a.cc:11:17: error: missing terminating > character
   11 | #include <sstrea
      |                 ^
a.cc:11:10: fatal error: sstrea: No such file or directory
   11 | #include <sstrea
      |          ^
compilation terminated.
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <stdio.h>
#include <ctype.h>
#include <string>
#include <iostream>
#include <vector>
#include <stack>
#include <fstream>
#include <sstream>
#include <queue>
#include <exception>
#include <cmath>
#include <numeric>

#define SIZE 100

using namespace std;
typedef long long int lint;

int mat[SIZE + 1][SIZE + 1] = { 0 };

int maxSumSeq(int* x, int len)
{
	int mss, s;
	mss = s = 0;
	for (int i = 0; i < len; i++) {
		s += x[i];
		if (s < 0) s = 0;
		if (mss < s) mss = s;
	}
	return mss;
}

void AOJ0098()
{
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++)
		{
			cin >> mat[i][j];
		}
	}

	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++)
		{
			mat[i][j] += mat[i][j - 1];
		}
	}

	for (int j = 1; j <= n; j++) {
		for (int i = 1; i <= n; i++)
		{
			mat[i][j] += mat[i - 1][j];
		}
	}

	int maxSum = INT32_MIN;
	int sum;
	for (int i1 = 0; i1 < n; i1++) {
		for (int i2 = i1; i2 <= n; i2++) {
			for (int j1 = 0; j1 < n; j1++) {
				for (int j2 = 0; j2 <= n; j2++) {
					sum = mat[i2][j2] - mat[i1][j2] - mat[i2][j1] + mat[i1][j1];
					if (maxSum < sum) maxSum = sum;
				}
			}
		}
	}
	cout << maxSum;

	return;
}

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

Compiler output:
a.cc: In function 'void AOJ0098()':
a.cc:61:22: error: 'INT32_MIN' was not declared in this scope
   61 |         int maxSum = INT32_MIN;
      |                      ^~~~~~~~~
Language: C++

#include<iostream>
#include "fill.h"
using namespace std;

int A[100][100]={0};
int S[101][101]={0};


int main(){
    
    Fill(A,0);
    Fill(S,0);
    int n;
    cin>>n;

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

            cin>>A[i][j];
        
        }
    }

    for(int i=0;i<n;++i){
        for(int j=0;j<n;++j){
    
            int sum=0;
    
            for(int k=0;k<=i;++k){
                for(int l=0;l<=j;++l){
    
                    sum+=A[k][l];
    
                }
            }
    
            S[i+1][j+1]=sum;
            //cout<<sum<<" "; //for debug
    
        }
    }

    int maxsum=A[0][0];

    for(int i=0;i<n;++i){
        for(int j=0;j<n;++j){
            for(int k=i+1;k<n+1;++k){
                for(int l=j+1;l<n+1;++l){
    
                    int partsum=S[k][l]-S[k][j]-S[i][l]+S[i][j];
                    maxsum=(partsum>maxsum?partsum:maxsum);
    
                }
            }
        }
    }

    cout<<maxsum<<"\n";

}

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

# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0098
TLE n=85だと通らない
"""
import sys
from sys import stdin
from functools import lru_cache
input = stdin.readline


def calc_points(n, array):
    # 右下から(x, y)までの長方形に含まれる値の和
    global dp
    for y in range(n - 1, -1, -1):
        for x in range(n - 1, -1, -1):
            dp[y][x] = dp[y+1][x] + dp[y][x+1] - dp[y+1][x+1] + array[y][x]


# @lru_cache(maxsize=None)
def get_dp(y, x):
    return dp[y][x]


def solve(n, array):
    ans = float('-inf')
    calc_points(n, array)

    for sy in range(n + 1):
        for sx in range(n + 1):
            for ey in range(sy+1, n + 1):
                for ex in range(sx+1, n + 1):
                    s1 = get_dp(sy, sx)
                    s2 = get_dp(sy, ex)
                    s3 = get_dp(ey, sx)
                    s4 = get_dp(ey, ex)
                    s = s1 - s2 - s3 + s4
                    if s > ans:
                        ans = s
    return ans

dp = [[0] * (100 + 1) for _ in range(100 + 1)]
def main(args):
    array = []
    # n = 3
    # array.append([1, -2, 3])
    # array.append([-4, 5, 6])
    # array.append([7, 8, -9])

    n = int(input())
    for _ in range(n):
        array.append([int(x) for x in input().split()])
    ans = solve(n, array)
    print(ans)



if __name__ == '__main__':
    main(sys.argv[1:])



Compiler output:
a.cc:1:3: error: invalid preprocessing directive #-
    1 | # -*- coding: utf-8 -*-
      |   ^
a.cc:2:3: warning: missing terminating " character
    2 | """
      |   ^
a.cc:2:3: error: missing terminating " character
a.cc:5:3: warning: missing terminating " character
    5 | """
      |   ^
a.cc:5:3: error: missing terminating " character
a.cc:13:7: error: invalid preprocessing directive #\U000053f3\U00004e0b\U0000304b\U00003089
   13 |     # 右下から(x, y)までの長方形に含まれる値の和
      |       ^~~~~~~~
a.cc:20:3: error: invalid preprocessing directive #@
   20 | # @lru_cache(maxsize=None)
      |   ^
a.cc:26:17: warning: multi-character character constant [-Wmultichar]
   26 |     ans = float('-inf')
      |                 ^~~~~~
a.cc:45:7: error: invalid preprocessing directive #n
   45 |     # n = 3
      |       ^
a.cc:46:7: error: invalid preprocessing directive #array
   46 |     # array.append([1, -2, 3])
      |       ^~~~~
a.cc:47:7: error: invalid preprocessing directive #array
   47 |     # array.append([-4, 5, 6])
      |       ^~~~~
a.cc:48:7: error: invalid preprocessing directive #array
   48 |     # array.append([7, 8, -9])
      |       ^~~~~
a.cc:58:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   58 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:2:1: error: expected unqualified-id before string constant
    2 | """
      | ^~
Language: C++

//
//  main.cpp
//  Maximum Sum Sequence II
//
//  Created by 八代 光平 on 13/04/24.
//  Copyright (c) 2013年 八代 光平. All rights reserved.
//

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#define N 100

int sum(int top, int under, int left, int right, int a[N][N], int temp);
//int search(int top, int under, int left, int right, int max, int a[N][N], int n);

int main(int argc, const char * argv[])
{
    int n=0;
    scanf("%d",&n);
    int a[N][N]={0};
    
    for(int i=0; i<n; i++){
        for(int j=0; j<n; j++){
            scanf("%d",&a[i][j]);
        }
    }
    /*---------------*/
    
    
    int max = a[0][0];
    
    for(int i=0; i<n; i++){
        for(int j=0; j<n; j++){
            for(int k=i; k<n; k++){
                int l=j;
                int temp=0;
                while(l<n){
                    temp=sum(i, k, j, l, a);
                    if(temp>max){
                        max=temp;
                    }else if(temp<0){
                        l=n;
                    }
                    l++;
                }
            }
        }
    }
    
    /*---------------*/
    printf("%d\n",max);
}


int sum(int top, int under, int left, int right, int a[N][N], int temp){
    //int temp=0;
    for(int i=top; i<=under; i++){
        //for(int j=left; j<=right; j++){
            temp += a[i][right];
        //}
    }
    //printf("%d,top:%d,under:%d,left:%d,right:%d\n",temp,top,under,left,right);
    return temp;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:39:29: error: too few arguments to function 'int sum(int, int, int, int, int (*)[100], int)'
   39 |                     temp=sum(i, k, j, l, a);
      |                          ~~~^~~~~~~~~~~~~~~
a.cc:14:5: note: declared here
   14 | int sum(int top, int under, int left, int right, int a[N][N], int temp);
      |     ^~~
Language: Java



	public static void main(String[] args) throws java.io.IOException {

		 BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		 String line;
		 
		 String[] nq = in.readLine().split(" ");
		 int n= Integer.parseInt(nq[0]);
		 int q= Integer.parseInt(nq[1]);
		
		 String[] av;
		 
		 int a;
		 int v;
		 
		 int[] hist = new int[n];
		 for(int i=0;i<n;i++){
			 hist[i]=0;
		 }
		 
		 int top=1;
		 int second=1;
		 
		 while ((line = in.readLine()) != null) {
		
			 av = line.split(" ");
			 a= Integer.parseInt(av[0]);
			 v= Integer.parseInt(av[1]);
			 
			 hist[a-1]+=v;
			 
			 if(compare(a-1,top-1,hist)){
				 second =top;
				 top = a;
			 }else if(compare(second-1,top-1,hist)){
				 int tmp=top;
				 top = second;
				 second=tmp;
			 }
			
			 System.out.println(top+" "+hist[top-1]);
			 
		 }
		 
	}
	
	private static boolean compare(int a, int b, int[] list){
		
		if(list[a]>list[b]){
			return true;
		}else if(list[a]==list[b]&&a<b){
			return true;
		}
		
		return false;
		
	}
	
}

Compiler output:
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
	public static void main(String[] args) throws java.io.IOException {
	              ^
  (use --enable-preview to enable unnamed classes)
Main.java:60: error: class, interface, enum, or record expected
}
^
2 errors
Language: Java



	public static void main(String[] args) throws java.io.IOException {

		 BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		 String line;
		 
		 String[] nq = in.readLine().split(" ");
		 int n= Integer.parseInt(nq[0]);
		 int q= Integer.parseInt(nq[1]);
		
		 String[] av;
		 
		 int a;
		 int v;
		 
		 int[] hist = new int[n];
		 for(int i=0;i<n;i++){
			 hist[i]=0;
		 }
		 
		 int top=1;
		 int second=1;
		 
		 while ((line = in.readLine()) != null) {
		
			 av = line.split(" ");
			 a= Integer.parseInt(av[0]);
			 v= Integer.parseInt(av[1]);
			 
			 hist[a-1]+=v;
			 
			 if(true){
				 second =top;
				 top = a;
			 }else if(true){
				 int tmp=top;
				 top = second;
				 second=tmp;
			 }
			
			 System.out.println(top+" "+hist[top-1]);
			 
		 }
		 
	}
	

	
}

Compiler output:
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
	public static void main(String[] args) throws java.io.IOException {
	              ^
  (use --enable-preview to enable unnamed classes)
Main.java:50: error: class, interface, enum, or record expected
}
^
2 errors
Language: Java



	public static void main(String[] args) throws java.io.IOException {

		 BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		 String line;
		 
		 String[] nq = in.readLine().split(" ");
		 int n= Integer.parseInt(nq[0]);
		 int q= Integer.parseInt(nq[1]);
		
		 String[] av;
		 
		 int a;
		 int v;
		 
		 int[] hist = new int[n];
		 for(int i=0;i<n;i++){
			 hist[i]=0;
		 }
		 
		 int top=1;
		 int second=1;
		 
		 while ((line = in.readLine()) != null) {
		
			 av = line.split(" ");
			 a= Integer.parseInt(av[0]);
			 v= Integer.parseInt(av[1]);
			 
			 hist[a-1]+=v;
			 
			
			 System.out.println(top+" "+hist[top-1]);
			 
		 }
		 
	}
	

	
}

Compiler output:
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
	public static void main(String[] args) throws java.io.IOException {
	              ^
  (use --enable-preview to enable unnamed classes)
Main.java:42: error: class, interface, enum, or record expected
}
^
2 errors
Language: Java


//Surf Smelt Fishing Contest II
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

class Main {

	public static void main(String[] args) throws java.io.IOException {

		 BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		 String line;
		 
		 String[] nq = in.readLine().split(" ");
		 int n= Integer.parseInt(nq[0]);
		 int q= Integer.parseInt(nq[1]);
		
		 String[] av;
		 
		 int a;
		 int v;
		 
		 int[] hist = new int[n];
		 for(int i=0;i<n;i++){
			 hist[i]=-1;
		 }
		 
		 int top=0;
		 int second=0;
		 
		 int count=0;
		 while ((line = in.readLine()) != null) {
		
			 av = line.split(" ");
			 a= Integer.parseInt(av[0]);
			 v= Integer.parseInt(av[1]);
			 
			 if(hist[a]==-1){
				 hist[a]++;
			 }
			 hist[a]+=v;
			 
//			 if(count==0||count==1){
			 if(true){
				 for(int i=0;i<n;i++){
					 if(compare(a,top,hist)){
						 second=top;
						 top=a;
					 }
				 }
			 }else{
			 
			 if(compare(a,top,hist)){
				 second =top;
				 top = a;
			 }else if(top!=second&&compare(second,top,hist)){
				 int tmp=top;
				 top = second;
				 second=tmp;
			 }
			 }
			 System.out.println((top+1)+" "+hist[top]);
			 count++;
		 }
		 
	}

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


//Surf Smelt Fishing Contest II
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

class Main {

	public static void main(String[] args) throws java.io.IOException {

		 BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		 String line;
		 
		 String[] nq = in.readLine().split(" ");
		 int n= Integer.parseInt(nq[0]);
		 int q= Integer.parseInt(nq[1]);
		
		 String[] av;
		 
		 int a;
		 int v;
		 
		 int[] hist = new int[n];
		 for(int i=0;i<n;i++){
			 hist[i]=-1;
		 }
		 
		 int top=0;
		 int second=0;
		 
		 int count=0;
		 while ((line = in.readLine()) != null) {
		
			 av = line.split(" ");
			 a= Integer.parseInt(av[0])-1;
			 v= Integer.parseInt(av[1]);
			 
			 if(hist[a]==-1){
				 hist[a]++;
			 }
			 hist[a]+=v;
			 
//			 if(count==0||count==1){
			 if(true){
				 for(int i=0;i<n;i++){
					 if(compare(a,top,hist)){
						 second=top;
						 top=a;
					 }
				 }
			 }else{
			 
			 if(compare(a,top,hist)){
				 second =top;
				 top = a;
			 }else if(top!=second&&compare(second,top,hist)){
				 int tmp=top;
				 top = second;
				 second=tmp;
			 }
			 }
			 System.out.println((top+1)+" "+hist[top]);
			 count++;
		 }
		 
	}

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


//Surf Smelt Fishing Contest II
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

class Main {

	public static void main(String[] args) throws java.io.IOException {

		 BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		 String line;

		 String[] nq = in.readLine().split(" ");
		 int n= Integer.parseInt(nq[0]);
		 int q= Integer.parseInt(nq[1]);

		 String[] av;

		 int a;
		 int v;

		 int[] hist = new int[n];
		 for(int i=0;i<n;i++){
			 hist[i]=0;
		 }

		 int top=1;
		 int second=1;

		 int count=0;
		 while ((line = in.readLine()) != null) {

			 av = line.split(" ");
			 a= Integer.parseInt(av[0]);
			 v= Integer.parseInt(av[1]);

			 hist[a-1]+=v;

			 top=1;
			 for(int i=0;i<n;i++){
				 if(compare(i,top-1,hist)){
					 second=top;
					 top=i;
				 }
			 }

////			 if(count==0||count==1){
//			 if(true){
//				 for(int i=0;i<n;i++){
//					 if(compare(a,top,hist)){
//						 second=top;
//						 top=a;
//					 }
//				 }
//			 }else{
//
//			 if(compare(a,top,hist)){
//				 second =top;
//				 top = a;
//			 }else if(top!=second&&compare(second,top,hist)){
//				 int tmp=top;
//				 top = second;
//				 second=tmp;
//			 }
//			 }
			 System.out.println(top+" "+hist[top-1]);
			 count++;
		 }

	}

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


//Surf Smelt Fishing Contest II
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

class Main {

	public static void main(String[] args) throws java.io.IOException {

		 BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		 String line;

		 String[] nq = in.readLine().split(" ");
		 int n= Integer.parseInt(nq[0]);
		 int q= Integer.parseInt(nq[1]);

		 String[] av;

		 int a;
		 int v;

		 int[] hist = new int[n];
		 for(int i=0;i<n;i++){
			 hist[i]=0;
		 }

		 int top=1;
		 int second=1;

		 int count=0;
		 while ((line = in.readLine()) != null) {

			 av = line.split(" ");
			 a= Integer.parseInt(av[0]);
			 v= Integer.parseInt(av[1]);

			 hist[a-1]+=v;


////			 if(count==0||count==1){
//			 if(true){
//				 for(int i=0;i<n;i++){
//					 if(compare(a,top,hist)){
//						 second=top;
//						 top=a;
//					 }
//				 }
//			 }else{
//
//			 if(compare(a,top,hist)){
//				 second =top;
//				 top = a;
//			 }else if(top!=second&&compare(second,top,hist)){
//				 int tmp=top;
//				 top = second;
//				 second=tmp;
//			 }
//			 }
			 System.out.println(top+" "+hist[top-1]);
			 count++;
		 }

	}

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


//Surf Smelt Fishing Contest II
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

class Main {

	public static void main(String[] args) throws java.io.IOException {

		 BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		 String line;

		 String[] nq = in.readLine().split(" ");
		 int n= Integer.parseInt(nq[0]);
		 int q= Integer.parseInt(nq[1]);

		 String[] av;

		 int a;
		 int v;

		 int[] hist = new int[n];
		 for(int i=0;i<n;i++){
			 hist[i]=0;
		 }

		 int top=1;
		 int second=1;

		 int count=0;
		 while ((line = in.readLine()) != null) {

			 av = line.split(" ");
			 a= Integer.parseInt(av[0]);
			 v= Integer.parseInt(av[1]);




////			 if(count==0||count==1){
//			 if(true){
//				 for(int i=0;i<n;i++){
//					 if(compare(a,top,hist)){
//						 second=top;
//						 top=a;
//					 }
//				 }
//			 }else{
//
//			 if(compare(a,top,hist)){
//				 second =top;
//				 top = a;
//			 }else if(top!=second&&compare(second,top,hist)){
//				 int tmp=top;
//				 top = second;
//				 second=tmp;
//			 }
//			 }
			 System.out.println(top+" "+hist[top-1]);
			 count++;
		 }

	}

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


//Surf Smelt Fishing Contest II
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

class Main {

	public static void main(String[] args) throws java.io.IOException {

		 BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		 String line;

		 String[] nq = in.readLine().split(" ");
		 int n= Integer.parseInt(nq[0]);
		 int q= Integer.parseInt(nq[1]);

		 String[] av;

		 int a;
		 int v;

		 int[] hist = new int[n];
		 for(int i=0;i<n;i++){
			 hist[i]=0;
		 }

		 int top=1;
		 int second=1;

		 int count=0;
		 while ((line = in.readLine()) != null) {

			 av = line.split(" ");
			 a= Integer.parseInt(av[0]);
			 v= Integer.parseInt(av[1]);




////			 if(count==0||count==1){
//			 if(true){
//				 for(int i=0;i<n;i++){
//					 if(compare(a,top,hist)){
//						 second=top;
//						 top=a;
//					 }
//				 }
//			 }else{
//
//			 if(compare(a,top,hist)){
//				 second =top;
//				 top = a;
//			 }else if(top!=second&&compare(second,top,hist)){
//				 int tmp=top;
//				 top = second;
//				 second=tmp;
//			 }
//			 }

		 }

	}

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


//Surf Smelt Fishing Contest II
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

class Main {

	public static void main(String[] args) throws java.io.IOException {

		 BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		 String line;

		 String[] nq = in.readLine().split(" ");
		 int n= Integer.parseInt(nq[0]);
		 int q= Integer.parseInt(nq[1]);

		 String[] av;

		 int a;
		 int v;

		 int[] hist = new int[n];
		 for(int i=0;i<n;i++){
			 hist[i]=0;
		 }

		 int top=1;
		 int second=1;

		 int count=0;
		 while ((line = in.readLine()) != null) {

			 av = line.split(" ");
			 a= Integer.parseInt(av[0]);
			 v= Integer.parseInt(av[1]);


		 }

	}

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


//Surf Smelt Fishing Contest II
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

class Main {

	public static void main(String[] args) throws java.io.IOException {

		 BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		 String line;

		 String[] nq = in.readLine().split(" ");
		 int n= Integer.parseInt(nq[0]);
		 int q= Integer.parseInt(nq[1]);

		 String[] av;

		 int a;
		 int v;

		 int[] hist = new int[n];
		 for(int i=0;i<n;i++){
			 hist[i]=0;
		 }

		 int top=1;
		 int second=1;

		 int count=0;


	}

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


//Surf Smelt Fishing Contest II
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

class Main {

	public static void main(String[] args) throws java.io.IOException {

		 BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		 String line;

		 String[] nq = in.readLine().split(" ");
		 int n= Integer.parseInt(nq[0]);
		 int q= Integer.parseInt(nq[1]);

		 String[] av;

		 int a;
		 int v;


		 int top=1;
		 int second=1;

		 int count=0;


	}

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


//Surf Smelt Fishing Contest II
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

class Main {

	public static void main(String[] args) throws java.io.IOException {


		 String[] av;

		 int a;
		 int v;


		 int top=1;
		 int second=1;

		 int count=0;


	}

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