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

#include <bits/stdc++.h>
#define mk_pii(a,b,c) make_pair((a),make_pair((b),(c)))
using namespace std;
int main(){
        vector<pair<int,pair<int,int>>> v;
        for(int i=1;i<150;i++){
                for(int j=1;j<150;j++){
                        if(i < j){
                                v.emplace_back(mk_pii(i*i+j*j,i,j));
                        }
                }
        }
        sort(v.begin(),v.end());
        int h,w;
        while(cin >> h >> w,h || w){
                int x = h*h+w*w;
                for(int unsigned i = 0;i<v.size();i++){
                        if(v[i].first > x || (v[i].first == x && v[i].second.fir                                                                              st > h)){
                                cout << v[i].second.first << " " << v[i].second.                                                                              second << endl;
                                break;
                        }
                }
        }

        return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:78: error: 'struct std::pair<int, int>' has no member named 'fir'; did you mean 'first'?
   18 |                         if(v[i].first > x || (v[i].first == x && v[i].second.fir                                                                              st > h)){
      |                                                                              ^~~
      |                                                                              first
a.cc:18:81: error: expected ')' before 'st'
   18 |                         if(v[i].first > x || (v[i].first == x && v[i].second.fir                                                                              st > h)){
      |                                              ~                                  ^                                                                             ~~
      |                                                                                 )
a.cc:21:26: error: expected ')' before '}' token
   21 |                         }
      |                          ^
      |                          )
   22 |                 }
      |                 ~         
a.cc:18:27: note: to match this '('
   18 |                         if(v[i].first > x || (v[i].first == x && v[i].second.fir                                                                              st > h)){
      |                           ^
a.cc:22:17: error: expected primary-expression before '}' token
   22 |                 }
      |                 ^
Language: C++

// ConsoleApplication10.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//

#include "stdafx.h"
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

struct Rectangle {
	int h;
	int w;
	bool operator<(const Rectangle& o) {
		return h*h + w*w == o.h*o.h + o.w*o.w ? h < o.h : h*h + w*w < o.h*o.h + o.w*o.w;
	}
};

int main()
{
	vector<Rectangle> rs;
	for (int h = 1; h <= 150; h++) {
		for (int w = h+1; w <= 150; w++) {
			struct Rectangle r = { h,w };
			rs.push_back(r);
		}
	}
	sort(rs.begin(), rs.end());

	int h = -1, w = -1;
	while (1) {
		cin >> h >> w;
		if (h == 0 && w == 0)break;
		for (int i = 0; i < rs.size();i++) {
			if (rs[i].h*rs[i].h + rs[i].w*rs[i].w > h*h + w*w || rs[i].h > h) {
				printf("%d %d\n", rs[i].h, rs[i].w);
				break;
			}
		}
	}
	return 0;
}

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

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

#define rep(i, n) for (int i = 0; i < (n); i++)
#define REP(i, s, n) for (int i = (s); i < (n); i++)
#define all(co) begin(co), end(co)

int main() {
	int h, w;
while (cin >> h >> w && h) {
	int l = h * h + w * w;
	usint t = tuple<int, int, int>;
	t ans = t(1<<29,-1,-1);
	REP(i, 1, 102) REP(j, i, 102) {
		int dl = l - (i * i + j * j);
		if(dl > 0 && get<0>(ans) > dl) ans = t(dl, i, j);
	}
	sort(all(v));
	cout << get<1>(v[0]) << " " << get<2>(v[0]) << endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'usint' was not declared in this scope; did you mean 'uint'?
   12 |         usint t = tuple<int, int, int>;
      |         ^~~~~
      |         uint
a.cc:13:9: error: 't' was not declared in this scope
   13 |         t ans = t(1<<29,-1,-1);
      |         ^
a.cc:16:37: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |                 if(dl > 0 && get<0>(ans) > dl) ans = t(dl, i, j);
      |                                     ^~~
      |                                     abs
a.cc:18:18: error: 'v' was not declared in this scope
   18 |         sort(all(v));
      |                  ^
a.cc:6:23: note: in definition of macro 'all'
    6 | #define all(co) begin(co), end(co)
      |                       ^~
Language: C++

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

#define rep(i, n) for (int i = 0; i < (n); i++)
#define REP(i, s, n) for (int i = (s); i < (n); i++)
#define all(co) begin(co), end(co)

int main() {
	int h, w;
while (cin >> h >> w && h) {
	int l = h * h + w * w;
	using t = tuple<int, int, int>;
	t ans = t(1<<29,-1,-1);
	REP(i, 1, 102) REP(j, i, 102) {
		int dl = l - (i * i + j * j);
		if(dl > 0 && get<0>(ans) > dl) ans = t(dl, i, j);
	}
	sort(all(v));
	cout << get<1>(v[0]) << " " << get<2>(v[0]) << endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:18: error: 'v' was not declared in this scope
   18 |         sort(all(v));
      |                  ^
a.cc:6:23: note: in definition of macro 'all'
    6 | #define all(co) begin(co), end(co)
      |                       ^~
Language: C++

int main(void) {
	unsigned int h, w, d, mh, mw, md, i, j, nd;
	while(1) {
		std::cin >> h >> w;
		if (!h && !w) return 0;
		d = h * h + w * w, md = (unsigned int)-1;
		for (i = 1; i < 150; i++) {
			for (j = i + 1; j < 150; j++) {
				nd = i * i + j * j;
				if (d < nd || (d == nd && h < i)) break;
			}
			if (j < 150 && nd < md) md = nd, mh = i, mw = j;
		}
		std::cout << mh << ' ' << mw << std::endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:22: error: 'cin' is not a member of 'std'
    4 |                 std::cin >> h >> w;
      |                      ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main(void) {
a.cc:14:22: error: 'cout' is not a member of 'std'
   14 |                 std::cout << mh << ' ' << mw << std::endl;
      |                      ^~~~
a.cc:14:22: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:54: error: 'endl' is not a member of 'std'
   14 |                 std::cout << mh << ' ' << mw << std::endl;
      |                                                      ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | int main(void) {
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> VI;
typedef vector<VI> VVI;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max() / 2;
const int NEG_INF = numeric_limits<int>::min() / 2;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  while(true){
    int h,w;
    cin >> h >>w;
    if(h==0) break;
    int len=h*h+w*w;
    int resh=300,resw=300;
    for(int hei=1;hei<250;hei++){
      for(int wid=hei+1;wid<255;wid++){
        if(len<=hei*hei+wid*wid && hei*hei+wid*wid<resh*resh+resw*resw)){
          resh=hei;
          resw=wid;
        }
      }
    }
    cout << resh << " " << resw << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:72: error: expected primary-expression before ')' token
   26 |         if(len<=hei*hei+wid*wid && hei*hei+wid*wid<resh*resh+resw*resw)){
      |                                                                        ^
Language: C++

#include <iostream>

using namespace std;

int h[100], w[100], ah[100], aw[100], p[100];

int main() {
	int i = 0;
	while (true) {
		cin >> h[i] >> w[i];
		if (h[i] == 0 && w[i] == 0)break;
		int m = (int)(pow(h[i], 2) + pow(w[i], 2));
		//cout << m << endl;
		//cout << "i:" << i << endl;
		for (int j = 1; j <= 150; j++) {
			for (int k = j; k <= 150; k++) {
				if (j == k)continue;
				if (m < pow(j, 2) + pow(k, 2) && (p[i] == 0 || p[i] > pow(j, 2) + pow(k, 2))) {
					p[i] = (int)(pow(j, 2) + pow(k, 2));
					ah[i] = j;
					aw[i] = k;
					//cout << "ah[i]" << ah[i] << " aw[i]:" << aw[i] << endl;
				}
			}
		}
		i++;
	}

	for (int j = 0; j < i; j++) {
		cout << ah[j] << " " << aw[j] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:31: error: 'pow' was not declared in this scope
   12 |                 int m = (int)(pow(h[i], 2) + pow(w[i], 2));
      |                               ^~~
Language: C++

#include <iostream>

using namespace std;

typedef long long ll;

ll h[100], w[100], ah[100], aw[100], p[100];

int main() {
	int i = 0;
	while (true) {
		cin >> h[i] >> w[i];
		if (h[i] == 0 && w[i] == 0)break;
		ll m = (ll)(pow(h[i], 2) + pow(w[i], 2));
		//cout << m << endl;
		//cout << "i:" << i << endl;
		for (int j = 1; j <= 150; j++) {
			for (int k = j; k <= 150; k++) {
				if (j == k)continue;
				if (m < pow(j, 2) + pow(k, 2) && (p[i] == 0 || p[i] > pow(j, 2) + pow(k, 2))) {
					p[i] = (long long)(pow(j, 2) + pow(k, 2));
					ah[i] = j;
					aw[i] = k;
					//cout << "ah[i]" << ah[i] << " aw[i]:" << aw[i] << endl;
				}
			}
		}
		i++;
	}

	for (int j = 0; j < i; j++) {
		cout << ah[j] << " " << aw[j] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:29: error: 'pow' was not declared in this scope
   14 |                 ll m = (ll)(pow(h[i], 2) + pow(w[i], 2));
      |                             ^~~
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
using namespace std;

typedef pair<int, int> P;
typedef long long ll;

int main(void){
    long long h, w;
    while(cin >> h >> w){
        ll ansH=h, ansW=w;
        if(h == 0 && w == 0){
            break;
        }
        if( w-h > 1){
            ansH++;
        }else(w - h == 1){
            ansW++;
        }
        cout << ansH << ansW << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:26: error: expected ';' before '{' token
   20 |         }else(w - h == 1){
      |                          ^
      |                          ;
Language: C++

#include<algorithm>
#include<iostream>
#include<utility>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,x,n) for(int i=x;i<n;i++)
#define int long long
using namespace std;
long long k=1000000007;


signed main(){
  int H,W;
  while(cin>>H>>W,H) {
    int r=H*H+W*W;
    int f=1;
    while(1){
      for(int h=1,h<r;h++) {
	if (f&&h<=H)continue;
	int X=r-h*h; // X=w*w
	if (X>h*h) // satisfies w>h ?
	  for(int i=0;i*i<=X;i++)
	    if (i*i==X) { // is sqrt ?
	      cout<<h<<' '<<i<<endl;
	      goto wwwww;
	    }
      }
      r++;
      f=0;
    }
  wwwww:;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:20: error: expected ';' before '<' token
   21 |       for(int h=1,h<r;h++) {
      |                    ^
      |                    ;
a.cc:21:20: error: expected primary-expression before '<' token
Language: C++

#include<iostream>
#include<cmath>
#include<vector>
#include<utility>
#include<algorithm>
using namespace std;
int main(){
  int a,b;
  int sankaku[101][110];
  vector<pair<double,int> >aa;
  sort(aa.begin(),aa.end());
  for(int i=1;i<101;i++)
    for(int j=i+1;j<101;j++)
      aa.push_back(make_pair(sqrt(i*i+j*j),1000*i+j));
  while(cin>>a>>b,a+b){
    double taikaku=sqrt(a*a+b*b);
    for(int i=0;i<aa.size();i++){
      if(taikaku<=aa[i].first){
	if(taikaku==aa[i].first&&a>aa[i].second/1000)
	  cout<<aa[i].second/1000<<" "<<aa[i].second%1000<<endl;
      }else{
	cout<<aa[i].second/1000<<" "<<aa[i].first%1000<<endl;
      }
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:50: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   22 |         cout<<aa[i].second/1000<<" "<<aa[i].first%1000<<endl;
      |                                                  ^~~~~
      |                                                   |
      |                                                   int
Language: C++

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

int main(){
    
    int w, h;
    
    int min;
    
    while(1){
        
        cin >> h >> w;
        
        if ( w == 0 && h == 0) break;
        
        min = 0;
        
        int length = w*w + h*h;
        bool flag = false;
        
        for(int i = 1; i <= 150 , i++){
            
            for(int j = 1; j < 150, j++){
                
                int temp = i*i + j*j;
                
                if(temp == length){
                    
                    if (i < h) flag = true;
                }
                else if(temp > length){
                    
                    flag = true;
                }
                
                }
                if (flag) break;
                
            }
            if (flag) break;
            
        }
        
        cout << i << " " << j;
    }
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:38: error: expected ';' before ')' token
   21 |         for(int i = 1; i <= 150 , i++){
      |                                      ^
      |                                      ;
a.cc:23:40: error: expected ';' before ')' token
   23 |             for(int j = 1; j < 150, j++){
      |                                        ^
      |                                        ;
a.cc:44:17: error: 'i' was not declared in this scope
   44 |         cout << i << " " << j;
      |                 ^
a.cc:44:29: error: 'j' was not declared in this scope
   44 |         cout << i << " " << j;
      |                             ^
a.cc: At global scope:
a.cc:47:1: error: expected declaration before '}' token
   47 | }
      | ^
Language: C++

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

int main(){
    
    int w, h;
    
    int min;
    
    while(1){
        
        cin >> h >> w;
        
        if ( w == 0 && h == 0) break;
        
        min = 0;
        
        int length = w*w + h*h;
        bool flag = false;
        
        for(int i = 1; i <= 150 ; i++){
            
            for(int j = 1; j < 150 ; j++){
                
                int temp = i*i + j*j;
                
                if(temp == length){
                    
                    if (i < h) flag = true;
                }
                else if(temp > length){
                    
                    flag = true;
                }
                
                }
                if (flag) break;
                
            }
            if (flag) break;
            
        }
        
        cout << i << " " << j;
    }
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:17: error: 'i' was not declared in this scope
   44 |         cout << i << " " << j;
      |                 ^
a.cc:44:29: error: 'j' was not declared in this scope
   44 |         cout << i << " " << j;
      |                             ^
a.cc: At global scope:
a.cc:47:1: error: expected declaration before '}' token
   47 | }
      | ^
Language: C++

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

int main(){
    
    int w, h;
    
    int min;
    
    while(1){
        
        cin >> h >> w;
        
        if ( w == 0 && h == 0) break;
        
        int H=0, W=0;
        
        min = 0;
        
        int length = w*w + h*h;
        bool flag = false;
        
        for(int i = 1; i <= 150 ; i++){
            
            for(int j = 1; j < 150 ; j++){
                
                int temp = i*i + j*j;
                
                if(temp == length){
                    
                    if (i < h) flag = true;
                    H = h;
                }
                else if(temp > length){
                    
                    flag = true;
                    W = w;
                }
                
                }
                if (flag) break;
                
            }
            if (flag) break;
            
        }
        
        cout << H << " " << W;
    }
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:17: error: 'H' was not declared in this scope
   48 |         cout << H << " " << W;
      |                 ^
a.cc:48:29: error: 'W' was not declared in this scope
   48 |         cout << H << " " << W;
      |                             ^
a.cc: At global scope:
a.cc:51:1: error: expected declaration before '}' token
   51 | }
      | ^
Language: C++

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

int main(){
    
    int w, h;
    
    int H, W;
    
    int min;
    
    while(1){
        
        cin >> h >> w;
        
        if ( w == 0 && h == 0) break;
        
        min = 0;
        
        int length = w*w + h*h;
        bool flag = false;
        
        for(int i = 1; i <= 150 ; i++){
            
            for(int j = 1; j < 150 ; j++){
                
                int temp = i*i + j*j;
                
                if(temp == length){
                    
                    if (i < h) flag = true;
                    H = h;
                }
                else if(temp > length){
                    
                    flag = true;
                    W = w;
                }
                
                }
                if (flag) break;
                
            }
            if (flag) break;
            
        }
        
        cout << H << " " << W;
    }
    
}


Compiler output:
a.cc:51:1: error: expected declaration before '}' token
   51 | }
      | ^
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
struct E{
	int x,y;
	operator<(E a)
	{
		if(x*x+y*y!=a.x*a.x+a.y*a.y)return x*x+y*y<a.x*a.x+a.y*a.y;
		else return x<a.x;
	}
};
main()
{
	int h,w;
	while(cin>>h>>w,h)
	{
		E a,b,c;
		a.x=h,a.y=w;
		b.x=b.y=150;
		for(int i=1;i<150;i++)for(int j=i+1;j<150;j++)
		{
			c.x=i,c.y=j;
			if(a<c&&c<b)b=c;
		}
		cout<<b.x<<" "<<b.y<<endl;
	}
}


Compiler output:
a.cc:7:9: error: ISO C++ forbids declaration of 'operator<' with no type [-fpermissive]
    7 |         operator<(E a)
      |         ^~~~~~~~
a.cc:13:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   13 | main()
      | ^~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

using ll = long long;

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

typedef pair<int, int> P;

const int MOD = (int) 1e9 + 7;

template<class T>
bool chmax(T &a, const T &b) {
	if (a < b) {
		a = b;
		return 1;
	}
	return 0;
}

template<class T>
bool chmin(T &a, const T &b) {
	if (b < a) {
		a = b;
		return 1;
	}
	return 0;
}

int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

bool compare(P a, P b) {
	if (a.first * a.first + a.second * a.second == b.first * b.first + b.second * b.second) return a.first < b.first;
	return a.first * a.first + a.second * a.second < b.first * b.first + b.second * b.second;
}

int main(void) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	while (1) {
		int h, w;
		cin >> h >> w;
		if (h == 0) break;
		
		vector<P> v;
		FOR(i, 1, 151) {
			FOR(j, i + 1, 151) {
				v.push_back(P(i, j));
			}
		}
		
		sort(ALL(v), compare);
		
		int t;
		REP(i, v.size()) {
			if (P(h, w) == v[i]) {
				t = i;
				break;
			}
		}
		
		cout << v[t + 1].first << " " << v[t + 1].second << endl;
		
	}
	
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:60:17: error: 'sort' was not declared in this scope; did you mean 'short'?
   60 |                 sort(ALL(v), compare);
      |                 ^~~~
      |                 short
Language: C++

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
main(){
    int H,W;
    cin >> H >> W;
    while(H){
        int minh, minw, mind = INF;
        rep(i,1,151)rep(j,i+1,151){
            int d = i * i + j * j;
            if(d > H * H + W * W || (d == H * H + W * W) && (H < i){
                if(d < mind || (d == mind && i < minh)){
                    mind = d;
                    minh = i;
                    minw = j;
                }
            }
        }
        cout << minh << " " << minw << endl;
        cin >> H >> W;
    }
}


Compiler output:
a.cc:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:14:68: error: expected ')' before '{' token
   14 |             if(d > H * H + W * W || (d == H * H + W * W) && (H < i){
      |               ~                                                    ^
      |                                                                    )
a.cc:21:9: error: expected primary-expression before '}' token
   21 |         }
      |         ^
Language: C++

#include <iostream>
using namespace std;

struct Rect {
  int h, w, diagonal;
  void norm() {
    diagonal = h*h+w*w;
  }
  bool operator< (const Rect &r) const {
    return diagonal != r.diagonal ? diagonal < r.diagonal : h < r.h;
  }
  bool operator== (const Rect &r) const {
    return diagonal == r.diagonal && h == r.h;
  }
  bool operator<= (const Rect &r) const {
    return (diagonal == r.diagonal && h == r.h)
      || (diagonal != r.diagonal ? diagonal < r.diagonal : h < r.h);
  }
};

int main() {
  Rect r[150][150];

  for(int i=0; i<150; i++) {
    for(int j=0; j<150; j++) {
      r[i][j].h = i+1, r[i][j].w = j+1;
      r[i][j].norm();
    }
  }

  sort(r[0], r[0]+150*150);
  // cout << r[0][0].h << ' ' << r[0][1].w << endl;
  // cout << r[0][0].h << ' ' << r[0][1].w << endl;

  Rect rin;
  while(cin >> rin.h >> rin.w, rin.h+rin.w) {
    rin.norm();
    for(int i=0; i<150; i++) {
      for(int j=0; j<150; j++) {
	if(rin<r[i][j] && r[i][j].h < r[i][j].w) {
	  cout << r[i][j].h << ' ' << r[i][j].w << endl;
	  goto Fin;
	}
      }
    }
  Fin:;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   31 |   sort(r[0], r[0]+150*150);
      |   ^~~~
      |   short
Language: C++

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

int _tmain(int argc, _TCHAR* argv[])
{
	map<int, int>m;
	map<int, int>::iterator pm;
	int size, rect, h, w;
	for(h = 1; h < 101; h++){
		for(w = 1; w < 101; w++){
			if(w > h){
				size = (h * h + w * w ) * 100 + w;
				rect = h * 100 + w;
				m.insert(pair<int, int>(size, rect));
			}
		}
	}
	while(1){
		cin >> h;
		cin >> w;
		if (h == 0 && w == 0)
			break;
		size = (h * h + w * w ) * 100 + w;
		pm = m.find(size);
		pm++;
		rect = pm->second;
		w = rect % 100;
		h = rect / 100;
		cout << h << " " << w << endl;
	}

	return 0;
}

Compiler output:
a.cc:5:22: error: '_TCHAR' has not been declared
    5 | int _tmain(int argc, _TCHAR* argv[])
      |                      ^~~~~~
Language: Java



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

public class Main {
	public static void main(String[]args) {
		List<Team> team_list = new ArrayList<Team>();
		Scanner sc = new Scanner(System.in);
		
		int M = sc.nextInt(), T = sc.nextInt(), P = sc.nextInt(), R = sc.nextInt();
		for(int i = 0; i < T; i++) {
			Team team = new Team();
			team.setId(i);
			team_list.add(team);
		}
		
		for(int i = 0; i< R; i++) {
			int mk = sc.nextInt(), tk = sc.nextInt(), pk = sc.nextInt(), jk = sc.nextInt();
			
			if(jk == 0) {
				team_list.get(tk-1).addCount();
				team_list.get(tk-1).addTime(mk);
				if(team_list.get(tk-1).getMisCount() > 0) {
					for(int j = 0; j < team_list.get(tk-1).getMisCount(); j++) {
						team_list.get(tk-1).addTime(20);
						team_list.get(tk-1).setMisCount(0);
					}
				}
			}
		}
		
		for(int i = 0; i < T-1;i++) {
			for(int j =i+1; j < T; j++) {
				if(team_list.get(i).getCount() < team_list.get(j).getCount()) {
					Team team_tmp = team_list.get(i);
					team_list.get(j) = team_list.get(j);
					team_list.get(j) = team_tmp;
				}
			}
		}
		
	}
}


class Team{
	
	public Team() {
	  this.setCount(0);
	  this.setMisCount(0);
	  this.setTime(0);
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public int getCount() {
		return count;
	}
	public void setCount(int count) {
		this.count = count;
	}
	public void addCount() {
		this.count++;
	}
	public int getTime() {
		return time;
	}
	public void setTime(int time) {
		this.time = time;
	}
	public void addTime(int time) {
		this.time += time;
	}
	public int getMisCount() {
		return misCount;
	}
	public void setMisCount(int misCount) {
		this.misCount = misCount;
	}
	private int id;
	private int count;
	private int time;
	private int misCount;
}


Compiler output:
Main.java:38: error: unexpected type
					team_list.get(j) = team_list.get(j);
					             ^
  required: variable
  found:    value
Main.java:39: error: unexpected type
					team_list.get(j) = team_tmp;
					             ^
  required: variable
  found:    value
2 errors
Language: C

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

struct Score{
	int team_num;
	int ac=0;
	int time=0;
	int miss_tmp[20]={0};
	int miss_sum=0;
};

bool asc(const Score& left, const Score& right) {
	return left.ac == right.ac ? (left.time == right.time ?  left.team_num > right.team_num : left.time < right.time) :
		   left.ac > right.ac;
}

int main(){
	while(1){
		int M, T, P, R; cin>>M>>T>>P>>R;
		if(!M && !T && !P && !R) break;
		vector <Score> score(T);
		for(int i=0; i<T; i++) score[i].team_num = i;
		int m, t, p, j;
		for(int i=0; i<R; i++){
			cin>>m>>t>>p>>j;
			t=t-1;//0オリジン
			if(j == 0){
				score[t].ac++;
				if(score[t].miss_tmp != 0){
					score[t].miss_sum += score[t].miss_tmp[p];
				}
				score[t].time += m+(score[t].miss_tmp[p]*20);
			} else{
				score[t].miss_tmp[p]++;
			}
		}
		sort(score.begin(), score.end(), asc);
		for(int i=0; i<T; i++){
			cout << score[i].team_num+1;
			if(i!=T-1){
				if(score[i].ac == score[i+1].ac && score[i].time == score[i+1].time) cout << "=";
				else cout << ",";
			}
		}
		cout << endl;
	}
	return 0;
}


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

#include "stdio.h"
#define TEAM_MAX 300

int main(int argc, char const *argv[])
{
    int ti,team,probrem,record;
    int ti_keika,team_num,pro_num,gouhi;
    int i,j,k;
    int score[TEAM_MAX][50];
    int score_sin[TEAM_MAX];
    int min;
    int min_num;
    int syuturyoku_count = 0;
    int dataset = 0;

    while(1){
        dataset++;
        //?????????
        for(i = 0;i < TEAM_MAX;i++){
            for(j = 0;j < 50;j++){
                score[i][j] = 0;
            }
        }
            score_sin[i] = 0;
        }
        // ???????????????????????¢?????????????????\??????0 0 ???????????????
        scanf("%d %d %d %d",&ti,&team,&probrem,&record);//???????????????????????°???????????°???????????°
        if(probrem == 0 && record == 0 && team == 0 && ti == 0){
            break;
        }
        for(i = 0; i < record;i++){
            // ???????????\???
            scanf("%d %d %d %d",&ti_keika,&team_num,&pro_num,&gouhi);
            // ??????????????£???????????????????????£???????????????
            // ??£?§£????????????????????¢????????????
            if(gouhi != 0){
                score[team_num][pro_num] += 20;
            } else {
                score_sin[team_num] += score[team_num][pro_num]+ti_keika;
                score_sin[team_num] -= 1000000;
            }
        }
        syuturyoku_count = 0;
        // ????????¢?????????????????????????????????
        while(syuturyoku_count != team) {
            min = 100000000;
            //?????§???????????¢???????????????
            for(j = team;j >= 1;j--){
                if(min > score_sin[j]){
                    min_num=1;
                    min = score_sin[j];
                } else if(min == score_sin[j]) {
                    min_num++;
                }
            }
            // ????????¨???
            for(j = team;j >= 1;j--){
                //?????????????????° 
                if(min == score_sin[j]){
                    printf("%d", j);
                    syuturyoku_count++;
                    if(syuturyoku_count == team){
                        printf("\n");
                        break;
                    } else {
                        if(min_num >= 2){
                            printf("=");
                        }
                        else {
                            printf(",");
                        }
                    }
                    score_sin[j] = 100000000;
                    break;
                }
            }
        }


    }

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:29:13: error: break statement not within loop or switch
   29 |             break;
      |             ^~~~~
main.c: At top level:
main.c:82:5: error: expected identifier or '(' before 'return'
   82 |     return 0;
      |     ^~~~~~
main.c:83:1: error: expected identifier or '(' before '}' token
   83 | }
      | ^
Language: C

#include<iostream>
#include<string.h>
using namespace std;

const int INF=5000000;

int data[51][12];

int main(){
	int M,T,P,R;
	while(cin>>M>>T>>P>>R && M){
		fill((int*)data,(int*)(data+12),0);
		for(int i=0;i<R;i++){
			int m,t,p,j;
			cin>>m>>t>>p>>j;
			if(j==0){
				data[t][0]++;
				data[t][11]+=m+data[t][p]*20;
			}
			else data[t][p]++;
		}
		int prev[2]={INF,0};
		for(int i=0;i<T;i++){
			int ans=0;
			int now[2]={0,INF};
			for(int j=T;j>=0;j--){
				if(data[j][0]>now[0]){
					now[0]=data[j][0];
					now[1]=data[j][11];
					ans=j;
				}
				else if(data[j][0]==now[0] && data[j][11]<now[1]){
					now[1]=data[j][11];
					ans=j;
				}
			}
			if(i){
				if(memcmp(now,prev,sizeof(now))==0)cout<<"=";
				else cout<<",";
			}
			cout<<ans;
			memcpy(prev,now,sizeof(now));
			data[ans][0]=-1;
		}
		cout<<endl;
	}
}

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

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

const int MAX_T = 50;
const int MAX_P = 10;

typedef struct {
	int id;
	int time;
	int problem_submit[MAX_P];
	bool problem_accepted[MAX_P];
} team_log;

team_log logs[MAX_T];
int M, T, P, R;

int count_of_accepted(team_log *t)
{
	int cnt = 0;
	for (int i = 0; i < P; i++)
		if (t->problem_accepted[i])
			cnt++;
	return cnt;
}

int calc_time(team_log *t)
{
	int time = t->time;
	for (int i = 0; i < P; i++) {
		if (t->problem_accepted[i]) {
			int count_of_rejected = t->problem_submit[i]-1;
			int penalty_time = 20*count_of_rejected;
			time += penalty_time;
		}
	}
	return time;
}

void calc_count_and_time(team_log *t, int *cnt, int *time)
{
	*cnt = count_of_accepted(t);
	*time = calc_time(t);
}

int equal(team_log *l, team_log *r)
{
	int cnt_l, cnt_r;
	int time_l, time_r;

	calc_count_and_time(l, &cnt_l, &time_l);
	calc_count_and_time(r, &cnt_r, &time_r);
	return cnt_l == cnt_r && time_l == time_r;
}

int compare(const void *x, const void *y)
{
	team_log *l, *r;
	int cnt_l, cnt_r;
	int time_l, time_r;

	l = (team_log *)x;
	r = (team_log *)y;
	calc_count_and_time(l, &cnt_l, &time_l);
	calc_count_and_time(r, &cnt_r, &time_r);

	return !(cnt_l > cnt_r
		|| (cnt_l == cnt_r && time_l < time_r)
		|| (cnt_l == cnt_r && time_l == time_r && l->id > r->id));
}

void initialize()
{
	for (int i = 0; i < T; i++) {
		logs[i].id = i+1;
		logs[i].time = 0;
		memset(logs[i].problem_submit, 0, sizeof(logs[i].problem_submit));
		memset(logs[i].problem_accepted, 0, sizeof(logs[i].problem_accepted));
	}
}

int main(void)
{
	for (;;) {
		scanf("%d %d %d %d", &M, &T, &P, &R);
		if (M == 0 && T == 0 && P == 0 && R == 0)
			break;

		initialize();
		for (int i = 0; i < R; i++) {
			int m, t, p, j;
			scanf("%d %d %d %d", &m, &t, &p, &j);
			t--;
			p--;

			logs[t].problem_submit[p]++;
			if (j == 0) {
				logs[t].time += m;
				logs[t].problem_accepted[p] = true;
			}
		}

		qsort(logs, T, sizeof(team_log), compare);
		
		for (int i = 1; i < T; i++)
			printf("%d%c", logs[i-1].id, (equal(&logs[i-1], &logs[i])?'=':','));
		printf("%d\n", logs[T-1].id);
	}
	return 0;
}

Compiler output:
main.c:12:13: error: variably modified 'problem_submit' at file scope
   12 |         int problem_submit[MAX_P];
      |             ^~~~~~~~~~~~~~
main.c:13:14: error: variably modified 'problem_accepted' at file scope
   13 |         bool problem_accepted[MAX_P];
      |              ^~~~~~~~~~~~~~~~
main.c:16:10: error: variably modified 'logs' at file scope
   16 | team_log logs[MAX_T];
      |          ^~~~
Language: C++

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

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


using namespace std;

/*
 より多くの問題に正解したチームを上位とする．
 正解した問題数が同じ場合は，所要時間合計の少ないチームを上位とする．
 複数のチームが同数の問題に正解し，所要時間合計も同じなら，それらのチームを同順位とする．
 */

struct team{
	int ans,time,name;
    int q[50]={0};
    
	team() : ans(0), time(0), name(0) {}
    
    bool operator <( const team& Right )const {
        return  ans != Right.ans ? ans < Right.ans :
        time != Right.time ? time > Right.time :
        name <  Right.name;
    }
};


int main()
{
	int M,T,P,R;
	// Mは，コンテストの始まりから終わりまでの時間である． Tは，チーム数である． Pは，問題数である． Rは，提出記録の数である
	while( cin >> M >> T >> P >> R )
	{
		int m,t,p,k;
		vector<team> team_array(T+1);
		if( T == 0 ) return 0;
		for( int i = 1; i <= T; i++)
			team_array[i].name = i;
		// mkは，経過時間である． tkは，チーム番号である． pkは，問題番号である． jkは，判定結果を表す（0なら正解，0以外なら不正解）
		REP(i,R)
		{
			cin >> m >> t >> p >> k;
			team &tm = team_array[t];
			if( !k ){
				tm.ans++;
				tm.time += m;
                if( tm.q[p] )
                    tm.time += 20 * tm.q[p];
			}
            else{
                tm.q[p]++;
            }
            
		}
		
        sort( team_array.begin() + 1 , team_array.end() );
		
        for( int i = T; i > 0; i-- )
        {
            char c;
            if( i == 1 ){
                cout << team_array[i].name << endl;
                continue;
            }
            else if ( team_array[i].ans == team_array[i-1].ans &&
                team_array[i].time == team_array[i-1].time) {
                c = '=';
            }
            else{
                c = ',';
            }
			cout << team_array[i].name << c;
        }
        
	}
	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:79:18: error: expected '}' at end of input
   79 |         return 0;
      |                  ^
a.cc:32:1: note: to match this '{'
   32 | {
      | ^
Language: C++

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

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


using namespace std;

/*
 より多くの問題に正解したチームを上位とする．
 正解した問題数が同じ場合は，所要時間合計の少ないチームを上位とする．
 複数のチームが同数の問題に正解し，所要時間合計も同じなら，それらのチームを同順位とする．
 */

struct team{
	int ans,time,name;
    int q[50];
    
	team() : ans(0), time(0), name(0) {}
    
    bool operator <( const team& Right )const {
        return  ans != Right.ans ? ans < Right.ans :
        time != Right.time ? time > Right.time :
        name <  Right.name;
    }
};


int main()
{
	int M,T,P,R;
	// Mは，コンテストの始まりから終わりまでの時間である． Tは，チーム数である． Pは，問題数である． Rは，提出記録の数である
	while( cin >> M >> T >> P >> R )
	{
		int m,t,p,k;
		vector<team> team_array(T+1);
		if( T == 0 ) return 0;
		for( int i = 1; i <= T; i++)
			team_array[i].name = i;
		// mkは，経過時間である． tkは，チーム番号である． pkは，問題番号である． jkは，判定結果を表す（0なら正解，0以外なら不正解）
		REP(i,R)
		{
			cin >> m >> t >> p >> k;
			team &tm = team_array[t];
			if( !k ){
				tm.ans++;
				tm.time += m;
                if( tm.q[p] )
                    tm.time += 20 * tm.q[p];
			}
            else{
                tm.q[p]++;
            }
            
		}
		
        sort( team_array.begin() + 1 , team_array.end() );
		
        for( int i = T; i > 0; i-- )
        {
            char c;
            if( i == 1 ){
                cout << team_array[i].name << endl;
                continue;
            }
            else if ( team_array[i].ans == team_array[i-1].ans &&
                team_array[i].time == team_array[i-1].time) {
                c = '=';
            }
            else{
                c = ',';
            }
			cout << team_array[i].name << c;
        }
        
	}
	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:79:18: error: expected '}' at end of input
   79 |         return 0;
      |                  ^
a.cc:32:1: note: to match this '{'
   32 | {
      | ^
Language: C++

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

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


using namespace std;

/*
 より多くの問題に正解したチームを上位とする．
 正解した問題数が同じ場合は，所要時間合計の少ないチームを上位とする．
 複数のチームが同数の問題に正解し，所要時間合計も同じなら，それらのチームを同順位とする．
 */

struct team{
	int ans,time,name;
    int q[50];
    fill( q, q + 50, 0 );
	team() : ans(0), time(0), name(0) {}
    
    bool operator <( const team& Right )const {
        return  ans != Right.ans ? ans < Right.ans :
        time != Right.time ? time > Right.time :
        name <  Right.name;
    }
};


int main()
{
	int M,T,P,R;
	// Mは，コンテストの始まりから終わりまでの時間である． Tは，チーム数である． Pは，問題数である． Rは，提出記録の数である
	while( cin >> M >> T >> P >> R )
	{
		int m,t,p,k;
		vector<team> team_array(T+1);
		if( T == 0 ) return 0;
		for( int i = 1; i <= T; i++)
			team_array[i].name = i;
		// mkは，経過時間である． tkは，チーム番号である． pkは，問題番号である． jkは，判定結果を表す（0なら正解，0以外なら不正解）
		REP(i,R)
		{
			cin >> m >> t >> p >> k;
			team &tm = team_array[t];
			if( !k ){
				tm.ans++;
				tm.time += m;
                if( tm.q[p] )
                    tm.time += 20 * tm.q[p];
			}
            else{
                tm.q[p]++;
            }
            
		}
		
        sort( team_array.begin() + 1 , team_array.end() );
		
        for( int i = T; i > 0; i-- )
        {
            char c;
            if( i == 1 ){
                cout << team_array[i].name << endl;
                continue;
            }
            else if ( team_array[i].ans == team_array[i-1].ans &&
                team_array[i].time == team_array[i-1].time) {
                c = '=';
            }
            else{
                c = ',';
            }
			cout << team_array[i].name << c;
        }
        
	}
	return 0;
}

Compiler output:
a.cc:20:11: error: 'q' is not a type
   20 |     fill( q, q + 50, 0 );
      |           ^
a.cc:20:14: error: 'q' is not a type
   20 |     fill( q, q + 50, 0 );
      |              ^
a.cc:20:16: error: expected ',' or '...' before '+' token
   20 |     fill( q, q + 50, 0 );
      |                ^
a.cc:20:5: error: ISO C++ forbids declaration of 'fill' with no type [-fpermissive]
   20 |     fill( q, q + 50, 0 );
      |     ^~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

struct Team
{
	int id;
	int crr_num;
	int time_sum;
	int fal[10];

	bool operator < (const Team& oth)const{
		if(crr_num==oth.crr_num) {
			if(time_sum==oth.time_sum) return id>oth.id;
			return time_sum<oth.time_sum;
		}
		return crr_num>oth.crr_num;
	}
};

int main(int argc, char const *argv[])
{
	int m,t,p,r;

	while(1){
		cin>>m>>t>>p>>r;
		if(m+t+p+r==0) break;

		vector<Team> jg(t);

		for(int i1=0;i1<t;i1++){
			jg[i1].id=i1+1;
			jg[i1].crr_num=0;
			jg[i1].time_sum=0;
			for(int i2=0;i2<10;i2++){
				jg[i1].fal[i2]=0;
			}
		}

		int tm,tt,tp,j;
		for(int i1=0;i1<r;i1++){
			cin>>tm>>tt>>tp>>j;

			if(j==0){
				jg[tt-1].crr_num++;
				jg[tt-1].time_sum+=(tm+jg[tt-1].fal[tp-1]*20);
			}
			else jg[tt-1].fal[tp-1]++;
		}

		sort(jg.begin(),jg.end());

		cout<<jg[0].id;
		for(int i1=1;i1<t;i1++){
			if(jg[i1].crr_num==jg[i1-1].crr_num && jg[i1].time_sum==jg[i1-1].time_sum){
				cout<<"="<<jg[i1].id;
			}
			else cout<<","<<jg[i1].id;
		}
		cout<<endl;

	}
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:52:17: error: 'sort' was not declared in this scope; did you mean 'short'?
   52 |                 sort(jg.begin(),jg.end());
      |                 ^~~~
      |                 short
Language: C++

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

typedef pair<int,int> pii;
typedef pair<pii,int> tri;
int main(){
  int m,t,p,r;
  int team[55][15];
  while(cin>>m>>t>>p>>r,m){
    memset(team,0,sizeof(team));
    vector<tri> ans;
    int a,b,c,d;
    for(int i=0;i<r;i++){
      cin>>a>>b>>c>>d;
      if(d!=0){
	team[b][c]++;
      }else{
	team[b][p+1]+=a+20*team[b][c];
	team[b][p+2]++;
      }
    }
    for(int i=1;i<=t;i++){
      ans.push_back(tri(pii(-team[i][p+2],team[i][p+1]),-i));
    }
    sort(ans.begin(),ans.end());
    for(int i=0;i<t;i++){
      cout<<-ans[i].second;
      if(i+1==t)cout<<endl;
      else if(ans[i].first == ans[i+1].first)cout<<"=";
      else cout<<",";
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'memset' was not declared in this scope
   11 |     memset(team,0,sizeof(team));
      |     ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<vector>
  +++ |+#include <cstring>
    3 | using namespace std;
a.cc:26:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   26 |     sort(ans.begin(),ans.end());
      |     ^~~~
      |     short
Language: C++

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

typedef pair<int,int> pii;
typedef pair<pii,int> tri;
int main(){
  int m,t,p,r;
  int team[55][15];
  while(cin>>m>>t>>p>>r,m){
    memset(team,0,sizeof(team));
    vector<tri> ans;
    int a,b,c,d;
    for(int i=0;i<r;i++){
      cin>>a>>b>>c>>d;
      if(d!=0){
	team[b][c]++;
      }else{
	team[b][p+1]+=a+20*team[b][c];
	team[b][p+2]++;
      }
    }
    for(int i=1;i<=t;i++){
      ans.push_back(tri(pii(-team[i][p+2],team[i][p+1]),-i));
    }
    sort(ans.begin(),ans.end());
    for(int i=0;i<t;i++){
      cout<<-ans[i].second;
      if(i+1==t)cout<<endl;
      else if(ans[i].first == ans[i+1].first)cout<<"=";
      else cout<<",";
    }
  }
}

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

300 10 8 5
50 5 2 1
70 5 2 0
75 1 1 0
100 3 1 0
150 3 2 0
240 5 5 7
50 1 1 0
60 2 2 0
70 2 3 0
90 1 3 0
120 3 5 0
140 4 1 0
150 2 4 1
180 3 5 4
15 2 2 1
20 2 2 1
25 2 2 0
60 1 1 0
120 5 5 4
15 5 4 1
20 5 4 0
40 1 1 0
40 2 2 0
120 2 3 4
30 1 1 0
40 2 1 0
50 2 2 0
60 1 2 0
120 3 3 2
0 1 1 0
1 2 2 0
300 5 8 0
0 0 0 0

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 300 10 8 5
      | ^~~
Language: C++

#include<stdio.h>

int main(){

int M,T,P,R;

while(1){
scanf("%d%d%d%d",&M,&T,&P,&R);
if(M==0&&T==0&&P==0&&R==0)break;

int n[51][11][2]={};int n2[51][11]={};

int m,t,p,j;
for(int i=0;i<R;i++)
{
scanf("%d%d%d%d",&m,&t,&p,&j);
if(j==0){n[t][p]+=m;n2[t][p]=1;}
else{n[t][p]+=20;}
}

int N[51][3]={};
for(int i=1;i<=T;i++)
for(int k=1;k<=P;k++)
{
N[i][0]+=n[i][k];
N[i][1]+=n2[i][k];
}

for(int i=1;i<=T;i++)
for(int k=1;k<=P;k++)
if(N[k][1]>N[k-1][1]){
int t=N[k][1];N[k][1]=N[k-1][1];N[k-1][1]=t;
int t2=N[k][0];N[k][0]=N[k-1][0];N[k-1][0]=t2;
}
for(int i=1;i<=T;i++){
{if(i>1){if(N[i][1]==N[i-1][1]&&N[i][0]==N[i-1][0])printf("=");
else printf(",");}

printf("%d",N[i][1]);
}
printf("\n");
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: incompatible types in assignment of 'int' to 'int [2]'
   17 | if(j==0){n[t][p]+=m;n2[t][p]=1;}
      |          ~~~~~~~^~~
a.cc:18:13: error: incompatible types in assignment of 'int' to 'int [2]'
   18 | else{n[t][p]+=20;}
      |      ~~~~~~~^~~~
a.cc:25:8: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   25 | N[i][0]+=n[i][k];
      | ~~~~~~~^~~~~~~~~
      |        |
      |        int*
a.cc:44:2: error: expected '}' at end of input
   44 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <cstring>
#include <iostream>
#include <algorithm>
#include <utility>

using namespace std;
typedef pair<int, int> PII;

int WA[10][50];

int main()
{
  int M, T, P, R;
  while (cin>>M>>T>>P>>R, M||T||P||R) {
    memset(WA, 0, sizeof(WA));
    vector<pair<PII, int>> score(T);
    for (int i=0; i<T; i++) {
      score[i].second = -(i+1);
    }

    for (int r=0; r<R; r++) {
      int m, t, p, j;
      cin>>m>>t>>p>>j;
      t--, p--;

      if (!j) {
        //cout << "Team = " << t << ", AC = " << score[t].first.first << endl;

        // AC
        score[t].first.first--;
        score[t].first.second += m + 20*WA[p][t];
      } else {
        // WA 
        WA[p][t]++;
      }
    }

    sort(score.begin(), score.end());
    for (int i=0; i<score.size(); i++) {
      if (i>0) {
        if (score[i].first.first == score[i-1].first.first && score[i].first.second == score[i-1].first.second) cout << "=";
        else cout << ",";
      }
      cout << -score[i].second;
    }
    cout << endl;
  } 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'vector' was not declared in this scope
   16 |     vector<pair<PII, int>> score(T);
      |     ^~~~~~
a.cc:5:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    4 | #include <utility>
  +++ |+#include <vector>
    5 | 
a.cc:16:25: error: expected primary-expression before '>' token
   16 |     vector<pair<PII, int>> score(T);
      |                         ^~
a.cc:16:28: error: 'score' was not declared in this scope
   16 |     vector<pair<PII, int>> score(T);
      |                            ^~~~~