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

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

using namespace std;
#define MAX 100
typedef pair<int,int> pii;
typedef pair<double,pii> pp;

struct union_find {
    int rnk[MAX], par[MAX];

    union_find(int n) { for(int i = 0; i < n; i++) rnk[i] = 1, par[i] = i; }

    int find(int x) {
        if(x == par[x]) return x;
        else return par[x] = find(par[x]);
    }
    bool unite(int x, int y) {
        x = find(x); y = find(y);
        if(x == y) return false;
        if(rnk[x] > rnk[y]) par[y] = x;
        else{
            par[x] = y;
            if(rnk[x] == rnk[y]) rnk[y]++;
        }
        return true;
    }
};

inline double cor(vector<double> a, vector<double> b) {
    double ret = sqrt((a[0]-b[0])*(a[0]-b[0]) + (a[1]-b[1])*(a[1]-b[1]) + (a[2]-b[2])*(a[2]-b[2]));
    ret -= a[3]+b[3];
    if (ret <= 0) return 0;
    else return ret;
}

int main(void) {
    int n;
    while (cin>>n && n) {
        vector<vector<double> > v(n, vector<double>(4));
        for (int i = 0; i < n; i++) cin >> v[i][0] >> v[i][1] >> v[i][2] >> v[i][3];
        
        vector<vector<double> > l(n, vector<double>(n));
        priority_queue<pp, vector<pp>, greater<pp> > que;
        union_find uf(n);
        for (int i = 0; i < n-1; i++) {
            for (int j = i+1; j < n; j++) {
                pp t = make_pair(cor(v[i],v[j]), make_pair(i,j));
                que.push(t);
            }
        }
        double ans = 0;
        while (!que.empty()) {
            pp t = que.top();
            que.pop();
            if (uf.unite(t.second.first, t.second.second)) ans += t.first;
        }
        printf("%.8lf\n", ans);
    }
}

Compiler output:
a.cc: In function 'double cor(std::vector<double>, std::vector<double>)':
a.cc:35:18: error: 'sqrt' was not declared in this scope
   35 |     double ret = sqrt((a[0]-b[0])*(a[0]-b[0]) + (a[1]-b[1])*(a[1]-b[1]) + (a[2]-b[2])*(a[2]-b[2]));
      |                  ^~~~
Language: C++

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <math.h>
using namespace std;
#define INF 1<<28
const double eps=1e-8 ;

double sqrt1(double a)
{
    return a*a;
}
double x[123],y[123],z[142],r[231];

double dis(int i,int j)
{
    return sqrt(sqrt1(x[i]-x[j])+sqrt1(y[i]-y[j])+sqrt1(z[i]-z[j]));
}

int vis[1230];

double map[123][123];
double d[1001];

int n;

int prim()
{
    double ans = 0 ;
    for(int i = 1 ; i <= n ; i++)
    {
        d[i] = INF ;
        vis[i] = false ;
    }
    d[1] = 0 ;
    for(int i = 1 ; i <= n ; i++)
    {
        int minn = INF ;
        int flag = 0 ;
        for(int j = 1 ; j <= n ; j++)
        {
            if(minn > d[j]&&!vis[j])
            {
                minn = d[j] ;
                flag = j ;
            }
        }
        if(minn >= INF)
            break;
        ans += minn ;
        vis[flag] = true ;
        for(j = 1 ; j <= n ; j++)
        {
            if(!vis[j]&&d[j]>map[flag][j])
                d[j] = map[flag][j] ;
        }
    }
    printf("%.3lf\n",ans);
}

int main()
{
	while(cin>>n)
	{
		if(n==0)break;
		memset(map,0,sizeof(map));
		for(int i=1;i<=n;i++)
		{
			cin>>x[i]>>y[i]>>z[i]>>r[i];
		}
		
		for(int i=1;i<=n;i++)
		{
			for(int j=1;j<=n;j++)
			{
				//printf("%lf----------\n",dis(i,j));
				if(dis(i,j)-r[i]-r[j]<=0)
				map[i][j]=0;
				else if(dis(i,j)-r[i]-r[j]>eps)
				map[i][j]=dis(i,j)-r[i]-r[j];
			}
		}
		
		prim();
	}
	return 0;
}

Compiler output:
a.cc: In function 'int prim()':
a.cc:53:13: error: 'j' was not declared in this scope
   53 |         for(j = 1 ; j <= n ; j++)
      |             ^
a.cc:60:1: warning: no return statement in function returning non-void [-Wreturn-type]
   60 | }
      | ^
Language: C++

#include<iostream>
#include<vector>
#include<cfloat>
#include<cmath>
#include<set>
using namespace std;

#define NONE DBL_MAX

struct Sphere{
  double x,y,z,r;
};

double dist(Sphere a, Sphere b)
{
  double d=sqrt( pow(a.x-b.x,2.0)+pow(a.y-b.y,2.0)+pow(a.z-b.z,2.0) );
  return a.r+b.r<d?d-a.r-b.r:0.0;
}

double prim(vector< vector<double> >v)
{
  double sum=0.0;
  int n=v.size();
  set<int>selected;
  set<int>::iterator it;
  double mincost;
  int mini;
  selected.insert(0);
  while(selected.size()!=n){
    mincost=INT_MAX;
    for(it=selected.begin();it!=selected.end();it++){
      for(int i=0;i<n;i++){
        if(selected.find(i)!=selected.end())continue;
        if(v[*it][i]==NONE)continue;
        if(v[*it][i]>=mincost)continue;
        mincost=v[*it][i];
        mini=i;
       }
     }
    if(mini==NONE)break;
    sum+=mincost;
    selected.insert(mini);
  }
  return sum;
}

int main()
{
  int n;
  double x,y,z,r;
  while(cin>>n,n){
    vector<Sphere>list(n);
    vector< vector<double> >A(n,vector<double>(n,NONE));
    for(int i=0;i<n;i++)cin>>list[i].x>>list[i].y>>list[i].z>>list[i].r;
    for(int i=0;i<n;i++){
      for(int j=i+1;j<n;j++){
	A[i][j]=A[j][i]=dist(list[i],list[j]);
      }
    }
    printf("%.3f\n",prim(A));
  }
}

Compiler output:
a.cc: In function 'double prim(std::vector<std::vector<double> >)':
a.cc:30:13: error: 'INT_MAX' was not declared in this scope
   30 |     mincost=INT_MAX;
      |             ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include<set>
  +++ |+#include <climits>
    6 | using namespace std;
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
struct station{
	double x,y,z,r;
};
double dist(station &a,station &b){
	return pow(pow(a.x-b.x,2)+pow(a.y-b.y,2)+pow(a.z-b.z,2),0.5)-a.r-b.r;
}
int uft[100];
void init(){
	for(int i = 0; i < 100; ++i) uft[i] = i;
}
int find(int v){
	if(uft[v] == v) return v;
	else return uft[v] = find(uft[v]);
}
void uni(int v,int w){
	uft[find(w)] = find(v);
}
typedef pair<double,pair<int,int> > P;
int main(){
	int n;
	while(cin >> n,n){
		init();
		station s[100];
		for(int i = 0; i < n; ++i){
			cin >> s[i].x >> s[i].y >> s[i].z >> s[i].r;
		}
		P p[10000];
		int m = 0;
		for(int i = 0; i < n; ++i)for(int j = 0; j < n; ++j){
			double d = dist(s[i],s[j]);
			if(d > 0) p[m++] = P(d,pair<int,int>(i,j));
			else uni(i,j);
		}
		sort(p,p+m);
		double sum = 0;
		for(int i = 0; i < m; ++i){
			if(find(p[i].second.first) != find(p[i].second.second)){
				sum += p[i].first;
				uni(p[i].second.first,p[i].second.second);
			}
		}
		printf("%.3f\n",sum);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:17: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   37 |                 sort(p,p+m);
      |                 ^~~~
      |                 sqrt
Language: C++

//kruskal tree
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
using namespace std;
#define M 9999
int parent[M],a[M],b[M];
pair<double,int>node[M];
int root(int a){return parent[a]==a?a:parent[a]=root(parent[a]);}
int unite(int a,int b){
	int x=root(a),y=root(b);
	if(x==y)return 0;
	parent[x]=y;
	return 1;
}
int main(){
	int i,j,k,m,n;
	double x,y,z,r;
	for(;cin>>n,n;){
		vector<vector<double> >v;
		for(i=0;i<n;i++)scanf("%lf%lf%lf%lf",x,y,z,r),v.push_back({x,y,z,r});
		for(i=0;i<n;i++)parent[i]=i;
		for(m=i=0;i<n;i++)for(j=i+1;j<n;j++){
			for(x=k=0;k<3;k++)x+=(v[i][k]-v[j][k])*(v[i][k]-v[j][k]);
			x=sqrt(x)-v[i][3]-v[j][3];
			if(x<=0)unite(i,j);
			else a[m]=i,b[m]=j,node[m].first=x,node[m++].second=m;
		}
		sort(node,node+m);
		for(x=i=0;i<m;i++)if(unite(a[node[i].second],b[node[i].second]))x+=node[i].first;
		printf("%.3f\n",x);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: 'cin' was not declared in this scope
   20 |         for(;cin>>n,n;){
      |              ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #include <cstdio>
  +++ |+#include <iostream>
    6 | using namespace std;
Language: C++

//kruskal tree
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
using namespace std;
#define M 9999
int parent[M],a[M],b[M];
pair<double,int>node[M];
int root(int a){return parent[a]==a?a:parent[a]=root(parent[a]);}
int unite(int a,int b){
	int x=root(a),y=root(b);
	if(x==y)return 0;
	parent[x]=y;
	return 1;
}
int main(){
	int i,j,k,m,n,q;
	double x,y,z,r,t;
	for(;scanf("%d",&n),n;){
		vector<vector<double> >v(n);
		for(q=m=i=0;i<n;i++){
			scanf("%lf%lf%lf%lf",&x,&y,&z,&r),v[i]=push_back({x,y,z,r}),parent[i]=i;
			for(j=0;j<i;j++){
				for(x=k=0;k<3;k++)x+=(t=v[i][k]-v[j][k])*t;
				x=sqrt(x)-v[i][3]-v[j][3];
				if(x<=0){if(unite(i,j))q++;}
				else a[m]=i,b[m]=j,node[m].first=x,node[m++].second=m;
			}
		}
		sort(node,node+m);
		for(x=i=0;i<m&&q<n-1;i++)if(unite(a[node[i].second],b[node[i].second]))x+=node[i].first,q++;
		printf("%.3f\n",x);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:64: error: 'push_back' was not declared in this scope
   23 |                         scanf("%lf%lf%lf%lf",&x,&y,&z,&r),v[i]=push_back({x,y,z,r}),parent[i]=i;
      |                                                                ^~~~~~~~~
Language: C++

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <stdio.h>
#include <complex>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef vector<LL> VLL;

//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define MT(a,b,c) MP(a, MP(b, c))
#define T1 first
#define T2 second.first
#define T3 second.second

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

double x[111], y[111], z[111], r[111];
double d[111][111];
int visit[111];

int main(){
	int n;
	while(cin>>n, n){
		memset(visit, 0, sizeof(visit));
		REP(i,n)cin>>x[i]>>y[i]>>z[i]>>r[i];
		REP(i,n)FOR(j,i+1,n)d[i][j] = d[j][i] = max(sqrt(pow(x[i]-x[j], 2.0)+pow(y[i]-y[j], 2.0)+pow(z[i]-z[j], 2.0))-r[i]-r[j], 0.0);
		priority_queue<pair<double, PII>, vector<pair<double,PII> >, greater<pair<double,PII> > > q;
		visit[0]=1;
		FOR(i,1,n)q.push(MP(d[0][i], MP(0, i)));
		double ret = 0.0;
		while(!q.empty()){
			pair<double, PII> tmp;
			tmp = q.top();
			q.pop();
			if(visit[tmp.second.second])continue;
			ret += tmp.first;
			visit[tmp.second.second] = 1;
			REP(i,n)if(i!=tmp.second.second)q.push(MP(d[tmp.second.second][i], MP(tmp.second.second, i)));
		}
		printf("%.3f\n", ret;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:88:37: error: expected ')' before ';' token
   88 |                 printf("%.3f\n", ret;
      |                       ~             ^
      |                                     )
Language: C++

#include<iostream>
#include<stdio>
#include<cmath>

using namespace std;
double x[100], y[100], z[100], r[100];
int n,m,MX=(1<<20),a,b,c,t,mn,hozon;
double map[100][100];
double sumcor;
int p[100];
double d[100];
int visited[100];

// i, j の距離を求める
double compute(int i, int j) {
  double ret;

  ret = sqrt( (x[i] - x[j])*(x[i] - x[j]) + (y[i] - y[j])*(y[i] - y[j]) + (z[i] - z[j])*(z[i] - z[j]) ) - (r[i] + r[j]);

  if (ret < 0) ret = 0;

  return ret;
}

int main() {
  double res = 0;

  while(1) {
    cin >> n;
    if (n == 0) break;

    for(int i=0; i < n; i++) {
      cin >> x[i]; cin >> y[i]; cin >> z[i]; cin >> r[i];
    }
      visited[t] = 1;

    // init p, d, visited, map, res
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
	map[i][j] = MX;
      }
      p[i] = 0;
      d[i] = MX;
      visited[i] = 0;
    }
    res = 0;

    // ２つのセル間の距離を算出
    for(int i = 0; i < n; i++) {
      for(int j = 0; j < n; j++) {
	if (i == j) continue;

	map[i][j] = compute(i, j);
      }
    }
    
    d[0] = 0;
    t = 0;
    while(1){
      mn = MX;
      // Target更新
      for (int i = 0; i < n; i++) {
	if (d[i] < mn && visited[i] == 0) {
	  mn = d[i];
	  t  = i;
	}
      }

      if ( mn == MX ) break; // 終了判定

      visited[t] = 1;
      res += d[t];

      //
      for(int v = 0; v < n; v++){
	if(map[t][v] < d[v] && visited[v] == 0){
	  d[v] = map[t][v];
	  p[v] = t;
	}
      }
    }
    
    printf("%lf\n", res);
  }

  return 0;
}

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

#include<iostream>
#include<vector>
#include<queue>
#include<set>
using namespace std;
#define FOR(i, b, e) for ( int i = b; i <= e; i++ )
#define rep(i, n) for ( int i = 0; i < (int)n; i++)
#define MAX 10

int cnt, H, W, limit, maxw;
int T[MAX][MAX], K[MAX][MAX], C[MAX][MAX], X[MAX][MAX];
vector<pair<int, int> > v;

int MD(){
  int sum = 0;
  rep(i, H) rep(j, W){
    if ( C[i][j] && X[i][j] == 0 ) sum++;
  }
  return sum/(maxw*maxw);
}

bool dfs(int pos, int cost){
  bool solved = true;
  rep(i, H) rep(j, W) if ( C[i][j] && X[i][j] == 0 ) solved = false;
  if ( solved ) return true;
  if ( pos >= v.size() ) return false;
  if ( cost + MD() >= limit ) return false;

  for ( int i = v[pos].first+1; i < H; i++ ) rep(j, W){
      if ( C[i][j] && X[i][j] == 0 ) return false;
    }

  int tmp[MAX][MAX];

  if ( dfs(pos+1, cost) ) return true;

  rep(i, H) rep(j, W) tmp[i][j] = X[i][j];
  int pi = v[pos].first;
  int pj = v[pos].second;
  int w = T[pi][pj];
  FOR(y, pi-w+1, pi) FOR(x, pj-w+1, pj) X[y][x]++;

  if ( dfs(pos+1, cost+1) ) return true;
  rep(i, H) rep(j, W) X[i][j] = tmp[i][j];

  return false;
}

int idp(){
  if ( maxw == 0 ) return 0;
  for ( limit = MD(); limit < 100; limit++){
    if ( dfs(0, 0) ) return limit;
  }
}

void compute(){

  bool U[MAX][MAX], V[MAX][MAX];

  rep(i, H) rep(j, W) U[i][j] = true;
  rep(i, H) rep(j, W) V[i][j] = false;
  rep(i, H) rep(j, W) T[i][j] = K[i][j] = X[i][j] = 0;
  rep(i, H) T[i][0] = (C[i][0])?1:0;
  rep(j, W) T[0][j] = (C[0][j])?1:0;

  FOR(i, 1, H-1) FOR(j, 1, W-1){
    if ( C[i][j] ){
      T[i][j] = min(T[i-1][j-1], min(T[i-1][j], T[i][j-1])) +1;
    } else T[i][j] = 0;
  }

  rep(i, H) rep(j, W){
    int w = T[i][j];
    FOR(pi, i-(w-1), i) FOR(pj, j-(w-1), j) {
      if ( i == pi && j == pj ) continue;
      int l = max(i-pi, j-pj);
      if ( w-l >= T[pi][pj] ) U[pi][pj] = false;
    }
  }

  rep(i, H) rep(j, W){
    if ( U[i][j] && T[i][j] ){
      FOR(y, i-T[i][j]+1, i) FOR(x, j-T[i][j]+1, j) K[y][x]++;
    }
  }

  v.clear();
  rep(i, H) rep(j, W){
    if ( U[i][j] && T[i][j] ){
      bool f = false;
      FOR(y, i-T[i][j]+1, i) FOR(x, j-T[i][j]+1, j){
	if ( K[y][x] == 1 ) f = true;
      }
      if ( f ){
	FOR(y, i-T[i][j]+1, i) FOR(x, j-T[i][j]+1, j) X[y][x]++;
	cnt++;
	T[i][j] = 0;
      }
    }
  }
  maxw = 0;
  rep(i, H) rep(j, W){
    if ( T[i][j] > 0 && U[i][j]){
      maxw = max(maxw, T[i][j]);
      v.push_back(make_pair(i, j));
    }
  }

  reverse(v.begin(), v.end());
}

main(){
  while( cin >> W >> H ){
    if ( W == 0 && H == 0 ) break;
    rep(i, H) rep(j, W) cin >> C[i][j];
    cnt = 0;
    compute();
    cout << idp() + cnt << endl;
  }
}

Compiler output:
a.cc: In function 'void compute()':
a.cc:109:3: error: 'reverse' was not declared in this scope
  109 |   reverse(v.begin(), v.end());
      |   ^~~~~~~
a.cc: At global scope:
a.cc:112:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
  112 | main(){
      | ^~~~
a.cc: In function 'int idp()':
a.cc:54:1: warning: control reaches end of non-void function [-Wreturn-type]
   54 | }
      | ^
Language: C++

#include<iostream>
#include<vector>
#include<set>
#include<algorithm>
#include<functional>

#define N 11
#define INF (1<<27)

using namespace std;

const int di[] = {-1,1,1,-1};
const int dj[] = {1,1,-1,-1};
int maxSizes[N][N];
int oneCount;
set<int,greater<int> > squareSizes;
int bestAns = INF;
int minHW;

int getHeuristic(int H, int W, int M[N][N])
{
  int maxSize = *(squareSizes.begin());  
  maxSize *= maxSize;
  return (oneCount / maxSize) + (oneCount%maxSize>0);
}

void calc(int H, int W, int M[N][N]){
  for(int i = 0; i < H; ++i){
    for(int j = 0; j < W; ++j){
      if(M[i][j] == 1) oneCount++;
      int size = 0;
      for(size = 1; size <= minHW; ++size){
	for(int m = i; m<size+i; m++){
	  for(int n = j; n<size+j; n++){
	    if( m<0||n<0||m>=H||n>=W||M[m][n]==0 ){
	      --size;
	      goto next;
	    }
	  }
	}
	if(i+size>=H||j+size>=W)break;
      next:;
	maxSizes[i][j] = size;
	squareSizes.insert( size );
      }
    }
  }
  return ;
}

void solve(int H, int W, int pos, int M[N][N], int depth){
 
  /*
  printf("now i = %d, now j = %d, h = %d\n", pos/W, pos%W,getHeuristic(H,W,M));
  for(int k = 0; k < H; ++k){
    for(int l = 0; l < W; ++l){
      if(l>0)putchar(' ');
      printf("%d", M[k][l]);
    }
    putchar('\n');
  }
  putchar('\n');
  */

  // completed.
  bool bComp=true;
  for(int i = 0; i < H; ++i){
    for(int j = 0; j < W; ++j){
      if(M[i][j]==1){
	bComp=false;
	goto end;
      }
    }
  }
 end:;
  if(bComp){
    bestAns = min(bestAns, depth);
    return ;
  }

  // back
  if(depth+getHeuristic(H,W,M)>=bestAns){
    return ;
  }

  // embed carpet
  for(int p = pos; p < H*W; ++p){
    int i = p / W;
    int j = p % W;
    if( M[i][j] == 0 ){
      continue;
    }else if( M[i][j] >= 1 ){
      int size = maxSizes[i][j];
      bool valid=false;
      for(int m = i; m<size+i; m++){
	for(int n = j; n<size+j; n++){
	  if(M[m][n]==1){
	    valid=true;
	    M[m][n]=depth;
	  }
	}
      }
      if( valid ){
	squareSize.erase( squareSize.find( size ) );
	solve(H,W,p+1,M,depth+1);
	squareSize.insert( size );
      }
      for(int m = i; m<size+i; m++){
	for(int n = j; n<size+j; n++){
	  if(M[m][n]==depth){
	    M[m][n]=1;
	  }
	}
      }
      if( M[i][j] > 1 )
	solve(H,W,p+1,M,depth+1);
      return ;
    }
  }
}

int main()
{
  while(true){
    int cnt=0;
    int W,H;
    scanf("%d%d", &W, &H);
    if(W==H&&H==0)break;
    int M[N][N];
    
    for(int i = 0; i < H; ++i){
      for(int j = 0; j < W; ++j){
	scanf("%d", &M[i][j]);
      }
    }

    bestAns=INF;
    minHW = min(H,W);
    oneCount = 0;
    squareSizes.clear();    
    calc(H,W,M);
    solve(H,W,0,M,2);
    printf("%d\n", bestAns-2);
  }
  return 0;
}

Compiler output:
a.cc: In function 'void solve(int, int, int, int (*)[11], int)':
a.cc:104:9: error: 'squareSize' was not declared in this scope; did you mean 'squareSizes'?
  104 |         squareSize.erase( squareSize.find( size ) );
      |         ^~~~~~~~~~
      |         squareSizes
Language: Java

import java.util.Scanner;

	public static void main(String[] args)
	{
		Scanner stdIn = new Scanner(System.in);
		int[] x = new int[50];
		int[] y = new int[50];
		
		while(true)
		{
			int n = stdIn.nextInt();
			int r = stdIn.nextInt();
			
			if(n==0 && r==0)
			{
				break;
			}
			
			for(int i=0;i<n;i++)
			{
				x[i] = n-i;
			}
			
			for(int i=0;i<r;i++)
			{
				int s = stdIn.nextInt();
				int t = stdIn.nextInt();
				
				if(s+t<=n+1)
				{
					for(int j=0;j<t;j++)
					{
						y[j] = x[s+j-1];
					}	
				
					for(int j=0;j<s;j++)
					{
						y[t+j] = x[j];
					}	
				
					for(int j=0;j<s+t;j++)
					{
						x[j] = y[j];
					}
				}
				
			}
			
			System.out.println(x[0]);
			
		}
	}

}

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

import java.util.Scanner;
public class Icpc{
	public static void main(String[]args){
		Scanner sc=new Scanner(System.in);
		for(int i=0;i>-1;i++){
			int num=sc.nextInt();
			if(num==0){
				break;
			}else{
			int ave=0;
			int max=0;
			int min=1000;
			int sum=0;
				int[] score =new int[num];
				//Input scores
				for(int j=0;j<num;j++){
					score[j]=sc.nextInt();
					if(j==0){
						max=score[0];
						min=score[0];
					}
					sum+=score[j];
					if(score[j]>max){
						max=score[j];
					}else if(score[j]<min){
						min=score[j];
					}
					ave=(sum-max-min)/(num-2);

				}
				System.out.println(ave);
				}
		}
	}
}

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

import java.util.Scanner;



public class Main{

public static void main(String[] args){

	int n,r,i,p,c;

	String hana,tempa,tampb;

	Scanner sc = new Scanner(System.in);
	hana=null;
	tempa=null;
	tempb=null;

	while(true){

		n=sc.nextInt();
		r=sc.nextInt();

		if(n==0&&r==0){

			break;

		}
		for(i=0;i<n;i++){
			hana.charAt(i)='1'+i;
		}

		for(i=0;i<r;i++){

			p=sc.nextInt();
			c=sc.nextInt();
			tempa=hana.substring(0,p-1);
			tempb=hana.substring(p-1+c,s.length());

			hana=hana.substring(p-1,p-1+c);

			hana=hana+tempa+tempb;

		}

		System.out.printf("%c\n",hana.charAt(0));
		hana=null;

	}



}

}

Compiler output:
Main.java:16: error: cannot find symbol
	tempb=null;
	^
  symbol:   variable tempb
  location: class Main
Main.java:29: error: unexpected type
			hana.charAt(i)='1'+i;
			           ^
  required: variable
  found:    value
Main.java:37: error: cannot find symbol
			tempb=hana.substring(p-1+c,s.length());
			^
  symbol:   variable tempb
  location: class Main
Main.java:37: error: cannot find symbol
			tempb=hana.substring(p-1+c,s.length());
			                           ^
  symbol:   variable s
  location: class Main
Main.java:41: error: cannot find symbol
			hana=hana+tempa+tempb;
			                ^
  symbol:   variable tempb
  location: class Main
5 errors
Language: Java

import java.util.*;

public class prob1129 {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner in = new Scanner(System.in);
		while(true){
			int n = in.nextInt();
			int r = in.nextInt();
			if(n*r==0){
				break;
			}

			Vector<Integer> card = new Vector<Integer>();
			for (int i = 1; i <= n; i++) {
				card.add(i);
			}
			for (int i = 0; i < r; i++) {
				int p = in.nextInt();
				int c = in.nextInt();

				int pp = n-p-c+1;
				for (int j = pp; c>0; c--) {
					card.add(card.get(pp));
					card.remove(j);
				}
			}
			System.out.println(card.elementAt(n-1));
		}

	}

}

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

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class MAIN {

	static Scanner br = new Scanner(System.in);
	static List<Integer> tmp = new ArrayList<Integer>();

	public static void main(String[] args) throws IOException {
		int yamahuda[];

		while (true) {
			// ?±±???????????°n
			int n = br.nextInt();
			yamahuda = new int[n];
			// ??????????????°r
			int r = br.nextInt();

			// 0 0?????´???break;
			if (n == 0 && r == 0) {
				break;
			}

			// ?±±????????????n????????????
			for (int i = 0; i < n; i++) {
				yamahuda[i] = n - i;
			}
			// ?±±???????????£?????????
			for (int i = 0; i < r; i++) {
				shuffle(yamahuda);
			}
			System.out.println(yamahuda[0]);

		}
	}

	public static int[] shuffle(int[] yamahuda) throws IOException {
		// p??¨c?????\???
		int p = br.nextInt();
		int c = br.nextInt();
		tmp.clear();
		if (p - 1 < c) {

			// ?????????????±±???????????????????????????tmp???????´?
			for (int i = 0; i < c; i++) {
				tmp.add(yamahuda[p - 1 + i]);
			}
			for (int i = 0; i < p - 1; i++) {
				yamahuda[c + i] = yamahuda[i];
			}
			for (int i = 0; i < c; i++) {
				yamahuda[i] = tmp.get(i);
			}
		} else {
			// ???????????????
			for (int i = 0; i < p - 1; i++) {
				tmp.add(yamahuda[i]);
			}
			for (int i = 0; i < c; i++) {
				yamahuda[i] = yamahuda[p - 1 + i];
			}
			for (int i = 0; i < p - 1; i++) {
				yamahuda[c + i] = tmp.get(i);
			}
		}
		return yamahuda;
	}

}

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

import java.util.ArrayList;
import java.util.Scanner;

public class test {
	public static void main(String[] args) {
		solve();
	}

	private static void solve() {
		// TODO ?????????????????????????????????????????????
		Scanner scn = new Scanner(System.in);
		ArrayList<Integer> deck = new ArrayList<Integer>();
		ArrayList<Integer> deckout = new ArrayList<Integer>();
		while(true){
			int n = scn.nextInt();
			int r = scn.nextInt();
			if(n==0&&r==0) break;
			for(int k=0;k<n;k++){
				deck.add(n-k);
			}
			for(int k=0;k<r;k++){
				int p = scn.nextInt();
				int c = scn.nextInt();
				for(int i=0;i<c;i++){
					deck.add(0,deck.remove(p-2+c));
				}
			}
			deckout.add(deck.get(0));
			deck.clear();
			
		}
		for(Integer i:deckout){
			System.out.println(i);
		}

		scn.close();
	}
}

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

import java.util.Scanner;

class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);

    while(true) {
      int n = sc.nextInt();
      int r = sc.nextInt();
      int cards[] = new int[n];

      if(n == 0 && r == 0) {
        break;
      }

      for(int i = 0; i < n; i++) {
        cards[i] = n - i;
      }

      for(int i = 0; i < r; i++) {
        int p = sc.nextInt();
        int c = sc.nextInt();
        int temp[] = new int[c];

        for(int j = 0; j < c; j++) {
          temp[j] = cards[p - 1 + j];
        }
        for(int j = p - 2; j >= 0; j--) {
          cards[c + j] = cards[j];
        }
        for(int j = 0; j < c; j++) {
          cards[j] = temp[j];
        }
      }
      System.out.crintln(cards[0]);
    }
  }
}

Compiler output:
Main.java:35: error: cannot find symbol
      System.out.crintln(cards[0]);
                ^
  symbol:   method crintln(int)
  location: variable out of type PrintStream
1 error
Language: Java

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int n = sc.nextInt();
			int r = sc.nextInt();
			if (n==0&&r==0) {
				break; 
			}
			int[] a=new int[n];
			for(int i=0;i<n;i++){
				a[i]=i+1;
			}
			for(int j=0;j<r;j++){
				int p=sc.nextInt();
				int c=sc.nextInt();
				int[] buffer=new int[n];
				for(int i=0;i<c;i++){
					buffer[i]=a[n-p-i];
				}
				for(int i=1;i<p;i++){
					a[n-p-c+i]=a[n-p+i];
				}
				for(int i=0;i<c;i++){
					a[n-i-1]=buffer[i];
				}
			}
			System.out.println(a[n-1]);
		}
	}

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

import java.util.Scanner;

public class Test {
    static Scanner input = new Scanner(System.in);

    public static void main(String[] prgs) {
        int[] before = new int[51];
        int[] temp = new int[51];
        while(input.hasNext()) {
            int n = input.nextInt(), r = input.nextInt();
            if(n == 0 && r == 0)
                break;
            for(int i = n, j = 1; i >= 1 && j <= n; i--, j++) {      //Initialize
                before[j] = i;
            }
            for(int i = 1; i <= r; i++) {
                int p = input.nextInt(), c = input.nextInt();
                for(int j = 1; j <= p - 1; j++) {
                    temp[j] = before[j];
                }
                for(int k = p; k <= p + c - 1; k++) {
                    before[k - p + 1] = before[k];
                }
                for(int j = c + 1, k = 1; j <= p + c - 1 && k <= p - 1; j++, k++) {
                    before[j] = temp[k];
                }
            }
            System.out.println(before[1]);
        }
    }
}



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

public class Main {
	public static void main(String[] agrs) {
	    Scanner sc = new Scanner(System.in);
	        for(;;){
	            int n = sc.nextInt();//输入数组数
	            int r = sc.nextInt();//输入循环几次	             
	            if( n==0 && r==0) {
	                break;
	            }	             
	            int[] input = new int[n];
	            for(int i = 0; i < n ; i++){
	                input[i] = n - i;
	            }	             
	            for(int i = 0; i < r ; i++){
	                int p = sc.nextInt()-1;//输入顶牌交换的地方
	                int c = sc.nextInt();    //下层交换地方             
	                int[] deck = input.clone();	                 
	                for(int j = 0 ; j < c ; j++){
	                    deck[j] = input[j+p];
	                }
	                for(int j = 0; j < p ; j ++){
	                    deck[j+c] = input[j];
	                }
	                input = deck;
	            }
	            System.out.println(input[0]);
	        }
	}
	}



Compiler output:
Main.java:3: error: cannot find symbol
	    Scanner sc = new Scanner(System.in);
	    ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
	    Scanner sc = new Scanner(System.in);
	                     ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

public class Main {
	public static void main(String[] agrs) {
	    Scanner sc = new Scanner(System.in);
	        for(;;){
	            int n = sc.nextInt();
	            int r = sc.nextInt();  
	            if( n==0 && r==0) {
	                break;
	            }	             
	            int[] input = new int[n];
	            for(int i = 0; i < n ; i++){
	                input[i] = n - i;
	            }	             
	            for(int i = 0; i < r ; i++){
	                int p = sc.nextInt()-1;
	                int c = sc.nextInt();             
	                int[] deck = input.clone();	                 
	                for(int j = 0 ; j < c ; j++){
	                    deck[j] = input[j+p];
	                }
	                for(int j = 0; j < p ; j ++){
	                    deck[j+c] = input[j];
	                }
	                input = deck;
	            }
	            System.out.println(input[0]);
	        }
	}
	}



Compiler output:
Main.java:3: error: cannot find symbol
	    Scanner sc = new Scanner(System.in);
	    ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
	    Scanner sc = new Scanner(System.in);
	                     ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(true) {
            int n = sc.nextInt();
            int r = sc.nextInt();
            if(n==0 && r==0) break;
            int i,j;
            int huda[] = new int[n];
            for(i=0;i<n;i++){
                huda[i] = n-i;
            }
            for(i=0;i<r;i++) {
                int p = sc.nextInt();
                int c = sc.nextInt();
                int rep[] = new int[c];
                for(j=0;j<c;j++){
                    rep[j] = huda[j+p];
                }
                for(j=p-1;j>=0;j--){
                    huda[j] = huda[j+c];
                }
                for(j=0;j<c;j++){
                    huda[j] = rep[j];
                }
            }
            System.out.println(huda[0]);
        }
    }
}



Compiler output:
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    try(Scanner sc = new Scanner(System.in)){
      while(true){
        int n = sc.nextInt();
        int r = sc.nextInt();
        if(n==0 && r==0) break;


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


        for(int i=0;i<r;i++){

          int p = sc.nextInt();
          int c = sc.nextInt();

          int[] new_card = new int[p-1];
          for(int j=0;j<p-1;j++){
            new_card[j] = card[j];
          }
          for(int j=0;j<c;j++){
            card[j] = card[p-1+j];
          }
          for(int j=0;j<p-1;j++){
            card[c+j] = new_card[j];
          }
        }
        System.out.println(card[i]);
      }
    }
  }
}



Compiler output:
Main.java:34: error: cannot find symbol
        System.out.println(card[i]);
                                ^
  symbol:   variable i
  location: class Main
1 error
Language: Java

import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    try(Scanner sc = new Scanner(System.in)){
      while(true){
        int n = sc.nextInt();
        int r = sc.nextInt();
        if(n==0 && r==0) break;


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


        for(int i=0;i<r;i++){

          int p = sc.nextInt();
          int c = sc.nextInt();

          int[] new_card = new int[p-1];
          for(int j=0;j<p-1;j++){
            new_card[j] = card[j];
          }
          for(int j=0;j<c;j++){
            card[j] = card[p-1+j];
          }
          for(int j=0;j<p-1;j++){
            card[c+j] = new_card[j];
          }
        }
        System.out.println(card[i]);
      }
    }
  }
}




Compiler output:
Main.java:34: error: cannot find symbol
        System.out.println(card[i]);
                                ^
  symbol:   variable i
  location: class Main
1 error
Language: Java

import java.util.Scanner;

public class Main5{
  public static void main(String[] args){
    try(Scanner sc = new Scanner(System.in)){
      while(true){
        int n = sc.nextInt();
        int r = sc.nextInt();
        if(n==0 && r==0) break;


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


        for(int i=0;i<r;i++){

          int p = sc.nextInt();
          int c = sc.nextInt();

          int[] new_card = new int[p-1];
          for(int j=0;j<p-1;j++){
            new_card[j] = card[j];
          }
          for(int j=0;j<c;j++){
            card[j] = card[p-1+j];
          }
          for(int j=0;j<p-1;j++){
            card[c+j] = new_card[j];
          }
        }
        System.out.println(card[0]);
      }
    }
  }
}



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

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();//枚数
		int r = sc.nextInt();//回数
		int[] huda = new int[n];
		for(int i=0;i<n;i++) huda[i] = i+1;

		for(int i=0;i<r;i++){
			int p = sc.nextInt();//上から何枚
			int c = sc.nextInt();//ここまで
			int[] temp = new int[p];
			for(int i=0;i<p;i++) temp[i] = huda[i];
			for(int i=0;i<c;i++) huda[i] = huda[i+p-1];
			for(int i=0;i<p;i++) huda[c+i] = temp[i];
		}
		System.out.println(huda[0]);
	}
}


Compiler output:
Main.java:15: error: variable i is already defined in method main(String[])
			for(int i=0;i<p;i++) temp[i] = huda[i];
			        ^
Main.java:16: error: variable i is already defined in method main(String[])
			for(int i=0;i<c;i++) huda[i] = huda[i+p-1];
			        ^
Main.java:17: error: variable i is already defined in method main(String[])
			for(int i=0;i<p;i++) huda[c+i] = temp[i];
			        ^
3 errors
Language: Java

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();//枚数
		int r = sc.nextInt();//回数
		if(0==n && 0==r) break;
		int[] huda = new int[n];
		for(int i=0;i<n;i++) huda[i] = i+1;

		for(int i=0;i<r;i++){
			int p = sc.nextInt();//上から何枚
			int c = sc.nextInt();//ここまで
			int[] temp = new int[p];
			for(int i=0;i<p;i++) temp[i] = huda[i];
			for(int i=0;i<c;i++) huda[i] = huda[i+p-1];
			for(int i=0;i<p;i++) huda[c+i] = temp[i];
		}
		System.out.println(huda[0]);
	}
}


Compiler output:
Main.java:8: error: break outside switch or loop
		if(0==n && 0==r) break;
		                 ^
Main.java:16: error: variable i is already defined in method main(String[])
			for(int i=0;i<p;i++) temp[i] = huda[i];
			        ^
Main.java:17: error: variable i is already defined in method main(String[])
			for(int i=0;i<c;i++) huda[i] = huda[i+p-1];
			        ^
Main.java:18: error: variable i is already defined in method main(String[])
			for(int i=0;i<p;i++) huda[c+i] = temp[i];
			        ^
4 errors
Language: Java

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true){
			int n = sc.nextInt();//枚数
			int r = sc.nextInt();//回数
			if(0==n && 0==r) break;
			int[] huda = new int[n];
			for(int i=0;i<n;i++) huda[i] = i+1;

			for(int i=0;i<r;i++){
				int p = sc.nextInt();//上から何枚
				int c = sc.nextInt();//ここまで
				int[] temp = new int[p];
				for(int i=0;i<p;i++) temp[i] = huda[i];
				for(int i=0;i<c;i++) huda[i] = huda[i+p-1];
				for(int i=0;i<p;i++) huda[c+i] = temp[i];
			}
			System.out.println(huda[0]);
		}
	}
}


Compiler output:
Main.java:17: error: variable i is already defined in method main(String[])
				for(int i=0;i<p;i++) temp[i] = huda[i];
				        ^
Main.java:18: error: variable i is already defined in method main(String[])
				for(int i=0;i<c;i++) huda[i] = huda[i+p-1];
				        ^
Main.java:19: error: variable i is already defined in method main(String[])
				for(int i=0;i<p;i++) huda[c+i] = temp[i];
				        ^
3 errors
Language: Java

import java.util.Scanner;
public class Main{
    public static void main(String[]argc){
        Scanner sc = new Scanner(System.in);
        int[] card1 = new int[50];
        int[] card2 = new int[50;
        while(true){
            int n = sc.nextInt();
            int r = sc.nextInt();
            if(n==0&&r==0)
                break;
            for(int i=0;i<n;i++){
                card1[i] = n-i;
            }
            for(int x=0;x<r;x++){
                int p = sc.nextInt();
                int c = sc.nextInt();
                for(int j=0;j<p-1;j++){
                    card2[j] = card1[j];
                }
                for(int k=0;k<c;k++){
                    card1[k] = card1[k+p-1];
                }
                for(int m=c;m<c+p-1;m++){
                    card1[m] = card2[m-c];
                }
            }
            System.out.println(card1[0]);
        }
    }
}


Compiler output:
Main.java:6: error: ']' expected
        int[] card2 = new int[50;
                                ^
1 error
Language: Java



import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class HanafudaShuffle {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		List<Integer> array = new ArrayList<Integer>();
		while (true) {
			int N = sc.nextInt();
			int r = sc.nextInt();
			if (N == 0 && r == 0) {
				break;
			}
			array.clear();
			for (int i = 0; i < N; i++) {
				array.add(N - i);
			}

			while (!(r == 0)) {
				r--;
				int p = sc.nextInt();
				int c = sc.nextInt();
				int pop = 0;
				for (int ii = 0; ii < r; ii++) {
					array.add(0, array.get(p + c - 2));
					array.remove(p + c-1);


				}
			}
			System.out.println((array.get(0)+1));
		}
	}
}



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

import java.util.ArrayList;
import java.util.Scanner;

class M1129 {
    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        while (true){
            int n=scan.nextInt();
            int r=scan.nextInt();
            if(n==0 && r==0){
                break;
            }
            ArrayList list=new ArrayList();
            for (int i=0;i<n;i++){
                list.add(n-i);
            }
            for (int i=0;i<r;i++){
//                for(int j=0;j<list.size();j++){
//                    System.out.print(list.get(j)+" ");
//                }
//                System.out.println("");
                int p=scan.nextInt();
                int c=scan.nextInt();
                for (int j=0;j<c;j++){
                    //data[p-1+j],data[0+j]
                    int temp= (int) list.get(p-1+j);
                    list.remove(p-1+j);
                    list.add(0+j,temp);
                }
            }
            System.out.println(list.get(0));
        }
    }
}


Compiler output:
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Language: Java

import java.util.Scanner;
 
public class Main{
    public static void main(String[] args){
        int p,n,r,c,i,j,k;
        int[] card = new int[51];
        int[] dummy = new int[51];
        Scanner s = new Scanner(System.in);
        while(true){
            n = s.nextInt();
            r = s.nextInt();
            if(n==0&&r==0)break;
            for(i=0;i<n;i++)card[i]=n-i;
            for(i=0;i<r;i++){
                p = s.nextInt();
                c = s.nextInt();
                for(j=0;j<p-1;j++)dummy[j]=card[j];
                for(j=0;j<c;j++)card[j]=card[j+p-1];
                for(j=0;j<p-1;j++)card[j+c]=dummy[j];
            }
            System.out.println(card[0]);
        }
    }
}

Compile Error Logs:

ステータス
Judge: 1/1	JAVA	CPU: 00:17 sec	Memory: 38220 KB	Length: 709 B	2018-04-23 13:55
テストケースの判定結果
Case #	Verdict	CPU Time	Memory	In	Out	Case Name
Case #1	: Accepted	00:17	38220	17774	1052	judge_data

< prev |		/		| next >	 		
 
Judge Input #  ( | )		Judge Output #  ( | )



Compiler output:
Main.java:26: error: class, interface, enum, or record expected
Compile Error Logs:
^
Main.java:31: error: illegal character: '#'
Case #	Verdict	CPU Time	Memory	In	Out	Case Name
     ^
Main.java:32: error: illegal character: '#'
Case #1	: Accepted	00:17	38220	17774	1052	judge_data
     ^
Main.java:36: error: illegal character: '#'
Judge Input #  ( | )		Judge Output #  ( | )
            ^
Main.java:36: error: illegal character: '#'
Judge Input #  ( | )		Judge Output #  ( | )
                    		             ^
5 errors
Language: Java

import java.util.*;
public class Hanafuda_Shuffle {
	static int n, r, p, c;
	static Scanner sc = new Scanner(System.in);
	static int[] Hanafuda, temp;
	
	public static void main(String[] args) {
		while(read()){
			
		}
	}
	static boolean read(){
		/**
		 * ScannerNXÌnextInt()Å®lÌÇÝÝªÅ«Ü·B
		 */
		n = sc.nextInt(); r = sc.nextInt();
		/**
		 * âè¶æèAnÆrªÆàÉ0ÈçfalseðÔµÜ·B@
		 */
		if(n == 0 && r == 0)
			return false;
		/**
		 * ÔDÌzñAHanafudaÆAêIÉDððï³¹ézñ
		 * tempðõµÜ·B¡ñA0 < n <= 50 ÈÌÅ50ÜÅõ·éÆ
		 * âèÍð¯Ü·ªAHanafuda[0]ðg¢½­È¢ÌÅ51ÜÅpÓµÜ·B
		 */
		Hanafuda = new int[51];
		temp = new int[51];
		/**
		 * HanafudazñÌú»B
		 * Hanafuda[n]ÉÍ1AHanafuda[1]ÉÍnðüêÜ·B
		 */
		for(int i = 1; i <= n; i++){
			Hanafuda[i] = n - i + 1;
			temp[i] = 0;
		}
		/**
		 * rñApÆcª±­ÌÅnextInt()ÅÇÝÝÜ·B
		 * pÆcðêñÇÝÞ½ÑÉAVbt·éÌÅA
		 * »Ì½ÑÉsolve()ÖðÄÑÜ·B
		 */
		for(int i = 0; i < r; i++){
			p = sc.nextInt(); c = sc.nextInt();
			solve();
		}
		/**
		 * rñÇÝñÅAVbtµ½ ÆÅAêÔãÌDð\¦µÜ·B
		 */
		System.out.println(Hanafuda[1]);
		/**
		 * ±êÅªIíÁ½ÌÅtrueðÔµÜ·B
		 */
		return true;
	}
	static void solve(){
		/**
		 * HanafudazñÌã©çp-1ÚÜÅðAtempzñÉÞð³¹Ü·B
		 */
		for(int i = 1; i <= p-1; i++)
			temp[i] = Hanafuda[i];
		/**
		 * HanafudazñÌpÚ©çp+c-1ÚÜÅðÚ®µÜ·B
		 */
		for(int i = p; i < p+c; i++)
			Hanafuda[i-p+1] = Hanafuda[i];
		/**
		 * tempzñÉ¦ªµÄ¨¢½J[hðA é×«êÉßµÜ·B
		 * ¼OÌìÆÅHanafuda[c]ÜÅªÜÁÄ¢éÌÅA
		 * ÍHanafuda[c+1]©çÅ·B
		 */
		for(int i = 1; i <= p-1; i++)
			Hanafuda[c+i] = temp[i];
	}

}

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

import java.util.*;
public class P1129 {
	Scanner sc;
	void run() {
		sc = new Scanner(System.in);
		while(true) {
			int n = sc.nextInt();
			int r = sc.nextInt();
			
			LinkedList<Integer> list = new LinkedList<Integer>();
			for (int i=0;i<n;i++) 
				list.add(i+1);
			for (int i=0;i<r;i++) {
				int p = sc.nextInt();
				int c = sc.nextInt();
				for (int j=0;j<c;j++) {
					list.addLast(list.remove(n-(p-1+c)));
				}
			}
			System.out.println(list.getLast());
		}
	}
	public static void main(String[] args) {
		new P1129().run();
	}
}

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

import java.util.*;
    
public class Main {
  private static Scanner sc = new Scanner(System.in);
  public static void main(String...args) {
    while(sc.hasNext()) {
      final int n = sc.nextInt();
      final int r = sc.nextInt();
      if (n == 0 && r == 0)
        break;
      solve(n, r);
    }
  }
  private static int case_num = 1;
  private static void solve(final int n, final int r) {
    final int[] p = new int[r];
    final int[] c = new int[r];
    for(int i = 0; i < n; i++) {
      p[i] = sc.nextInt();
      c[i] = sc.nextInt();
    }
    int ans = 0;
    for(int i = r - 1; i >= 0; i--)
      if(ans < p - 1)
        ans += c;
      else if(ans <= p + c)
        ans -= p - 1;
    System.out.println(ans+1);
  }
}

Compiler output:
Main.java:24: error: bad operand types for binary operator '-'
      if(ans < p - 1)
                 ^
  first type:  int[]
  second type: int
Main.java:25: error: bad operand types for binary operator '+'
        ans += c;
            ^
  first type:  int
  second type: int[]
Main.java:26: error: bad operand types for binary operator '+'
      else if(ans <= p + c)
                       ^
  first type:  int[]
  second type: int[]
Main.java:27: error: bad operand types for binary operator '-'
        ans -= p - 1;
                 ^
  first type:  int[]
  second type: int
4 errors