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

/*
 * 2399.cc: Save Your Privacy!
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_N = 100;

typedef long long ll;

const int INF = 1 << 30;
const ll LINF = 1LL << 60;

/* typedef */

typedef vector<int> vi;
typedef queue<int> qi;
typedef pair<int,int> pii;
typedef bitset<MAX_N> bsn;

/* global variables */

bsn ps[MAX_N];

/* subroutines */

/* main */

int main() {
  for (;;) {
    int n;
    cin >> n;
    if (n == 0) break;

    for (int i = 0; i < n; i++) ps[i].reset();

    for (int i = 0; i < n; i++) {
      int m;
      cin >> m;
      for (int j = 0; j < m; j++) {
	int pj;
	cin >> pj;
	pj--;
	ps[i].set(pj);
      }
      //printf("ps[%d]=", i); cout << ps[i].to_string() << endl;
    }

    bsn bls(0);
    int k;
    cin >> k;
    for (int i = 0; i < k; i++) {
      int li;
      cin >> li;
      li--;
      bls.set(li);
    }
    //cout << "bls=" << bls.to_string() << endl;

    int an = 0, ai = -1;
    
    for (int i = 0; i < n; i++)
      if ((bls & ps[i]) == bls) an++, ai = i;

    printf("%d\n", (an == 1) ? ai + 1 : -1);
  }

  return 0;
}

Compiler output:
a.cc:40:9: error: 'bitset' does not name a type
   40 | typedef bitset<MAX_N> bsn;
      |         ^~~~~~
a.cc:44:1: error: 'bsn' does not name a type
   44 | bsn ps[MAX_N];
      | ^~~
a.cc: In function 'int main()':
a.cc:56:33: error: 'ps' was not declared in this scope
   56 |     for (int i = 0; i < n; i++) ps[i].reset();
      |                                 ^~
a.cc:65:9: error: 'ps' was not declared in this scope; did you mean 'pj'?
   65 |         ps[i].set(pj);
      |         ^~
      |         pj
a.cc:70:5: error: 'bsn' was not declared in this scope
   70 |     bsn bls(0);
      |     ^~~
a.cc:77:7: error: 'bls' was not declared in this scope
   77 |       bls.set(li);
      |       ^~~
a.cc:84:12: error: 'bls' was not declared in this scope
   84 |       if ((bls & ps[i]) == bls) an++, ai = i;
      |            ^~~
a.cc:84:18: error: 'ps' was not declared in this scope
   84 |       if ((bls & ps[i]) == bls) an++, ai = i;
      |                  ^~
Language: C++

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

int main() {
	int a;
	while (cin >> a, a) {
		vector<int>V[100]{};
		bool hannin[100];
		memset(hannin,true, a);
		for (int b = 0; b < a; b++) {
			int c;
			cin >> c;
			for (int d = 0; d < c; d++) {
				int e;
				cin >> e;
				e--;
				V[e].push_back(b);
			}
		}
		int x;
		cin >> x;
		for (int y = 0; y < x; y++) {
			int z;
			cin >> z;
			z--;
			for (int i = 0,sum=0; i < a; i++) {
				if (sum < V[z].size() && V[z][sum] == i)sum++;
				else hannin[i] = false;
			}
		}
		int s = 0, l = 0;
		for (int k = 0; k < a; k++) {
			if (hannin[k]) { s++; l = k + 1; }
		}
		if (s == 1)cout << l << endl;
		else puts("-1");
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'memset' was not declared in this scope
   13 |                 memset(hannin,true, a);
      |                 ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include<vector>
  +++ |+#include <cstring>
    6 | using namespace std;
Language: C++

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

int main() {
	int a;
	while (cin >> a, a) {
		vector<int>V[100]{};
		bool hannin[100];
		memset(hannin,true, a);
		for (int b = 0; b < a; b++) {
			int c;
			scanf("%d", &c);
			for (int d = 0; d < c; d++) {
				int e;
				scanf("%d", &e);
				e--;
				V[e].push_back(b);
			}
		}
		int x;
		scanf("%d", &x);
		for (int y = 0; y < x; y++) {
			int z;
			scanf("%d", &z);
			z--;
			for (int i = 0,sum=0; i < a; i++) {
				if (sum < V[z].size() && V[z][sum] == i)sum++;
				else hannin[i] = false;
			}
		}
		int s = 0, l = 0;
		for (int k = 0; k < a; k++) {
			if (hannin[k]) { s++; l = k + 1; }
		}
		if (s == 1)cout << l << endl;
		else puts("-1");
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'memset' was not declared in this scope
   13 |                 memset(hannin,true, a);
      |                 ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include<vector>
  +++ |+#include <cstring>
    6 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n,i,j,c,q;
  while(cin>>n,n){
    int a[n+1][n]={0},k=0,p;
    for(i=0;i<=n;i++){
      for(cin>>a[i][0],j=1;j<=a[i][0];j++)cin>>a[i][j];
    }
  for(i=0;i<n;i++){
    for(q=j=1;j<=a[i][0];j++){
      if(a[n][q]==a[i][j])q++;
    }
    if(q-1==a[n][0]){
      k++;
      p=i+1;
    }
  }
  cout<<(k==1)?p:-1<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:20: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   19 |   cout<<(k==1)?p:-1<<endl;
      |                  ~~^~~~~~
Language: C++

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

int main(){
  int n;

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

      for(int i = 0;i < n;i++)
	{
	  cin >> a[i];
	}
      for(int j = 0;j < a[0];j++)
	{
	  cin >> b[j];
	}

      cin >> k;
      for(int h = 0;h < k;h++)
	{
	  cin >> c[h];
	}

      for(int i = 0;i < n;i++)
	{
	  for(int j = 0;j < m;j++)
	    {
	      if(b[j] == c[j]){
		
		cnt++;		
		if(cnt == k)
		  {
		    
		    cout << a[j] << endl;
		  }
		else
		  {
		    cout << -1 << endl;
		  }
	      }
	    }
	}
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: 'a' was not declared in this scope
   14 |           cin >> a[i];
      |                  ^
a.cc:16:25: error: 'a' was not declared in this scope
   16 |       for(int j = 0;j < a[0];j++)
      |                         ^
a.cc:18:18: error: 'b' was not declared in this scope
   18 |           cin >> b[j];
      |                  ^
a.cc:21:14: error: 'k' was not declared in this scope
   21 |       cin >> k;
      |              ^
a.cc:24:18: error: 'c' was not declared in this scope
   24 |           cin >> c[h];
      |                  ^
a.cc:29:29: error: 'm' was not declared in this scope
   29 |           for(int j = 0;j < m;j++)
      |                             ^
a.cc:31:18: error: 'b' was not declared in this scope
   31 |               if(b[j] == c[j]){
      |                  ^
a.cc:31:26: error: 'c' was not declared in this scope
   31 |               if(b[j] == c[j]){
      |                          ^
a.cc:33:17: error: 'cnt' was not declared in this scope; did you mean 'int'?
   33 |                 cnt++;
      |                 ^~~
      |                 int
a.cc:37:29: error: 'a' was not declared in this scope
   37 |                     cout << a[j] << endl;
      |                             ^
Language: C++

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

int main(){
  int n;
  int a[100]={};
  int b[100]={};
  int c[100]={};
  int cnt=0;

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

      for(int i = 0;i < n;i++)
	{
	  cin >> a[i];
	}
      for(int j = 0;j < a[0];j++)
	{
	  cin >> b[j];
	}

      cin >> k;
      for(int h = 0;h < k;h++)
	{
	  cin >> c[h];
	}

      for(int i = 0;i < n;i++)
	{
	  for(int j = 0;j < m;j++)
	    {
	      if(b[j] == c[j]){
		
		cnt++;		
		if(cnt == k)
		  {
		    
		    cout << a[j] << endl;
		  }
		else
		  {
		    cout << -1 << endl;
		  }
	      }
	    }
	}
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:25:14: error: 'k' was not declared in this scope
   25 |       cin >> k;
      |              ^
a.cc:33:29: error: 'm' was not declared in this scope
   33 |           for(int j = 0;j < m;j++)
      |                             ^
Language: C++

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


using namespace std;

bool t[101][101];
int n,k;

int solve()
{
	for (int i = 0; i < n; i++){
		int m; cin>>m;
		t[i][i] = true;
		for (int j = 0; j < m; j++){
			int x; cin>>x;
			t[i][x-1] = true;
		}
	}

	cin>>k;
	vector<int> l(k);
	for (int i = 0; i < k; i++){
		cin>>l[i];  l[i]--;
	}

	int ans = -1;

	for (int i = 0; i < n; i++){
		int j = 0;
		for (; j < k; j++){
			if(!t[i][l[j]]) break; 
		}
		if(j == k){
			if(ans == -1) {
				ans = i + 1;
			} else {return -1;}
		}
	}

	return ans;
}

int main(){
	while(cin >> n,n){
		memset(t,0,sizeof(t));
		int ans = solve();
		cout << ans << endl;
	}
	return 0;
}

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

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<functional>
#include<numeric>
#include<queue>
#include<stack>
using namespace std;
#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0; i<(int)(n); i++)
typedef __int64 ll;


int main() {
	int n;
	while(cin >> n, n) {
		vector<vector<int> > ms(n, vector<int>());
		for(int i = 0; i < n; i++) {
			int m;
			cin >> m;
			for(int j = 0; j < m; j++) {
				int mss;
				cin >> mss;
				mss--;
				ms[i].push_back(mss);
			}
		}
		int k;
		cin >> k;
		vector<int> led(n);
		for(int i = 0; i < k; i++) {
			int j;
			cin >> j;
			j--;
			led[j] = 1;
		}
		// fill one
		int kouho = -1;
		for(int i = 0; i < n; i++) {
			int count = 0;
			for(int j = 0; j < ms[i].size(); j++) {
				if(led[ms[i][j]]) count++;
			}
			if (count == k) {
				if (kouho != -1) {
					cout << -1 << endl;
					goto end_loop;
				}
				kouho = i;
			}
		}
		// fill some
		for(int i = 0; i < n; i++) {
			if (i == kouho) continue;
			int count = 0;
			for(int j = 0; j < ms[i].size(); j++) {
				if(led[ms[i][j]]) count++;
			}
			if (count == ms[i].size()) {
				for(int j = 0; j < ms[i].size(); j++) {
					led[ms[i][j]] = 2;
					//cout << "sum" << ms[i][j] << endl;
				}
			}
		}
		
		bool summable = true;
		for(int i = 0; i < n; i++) {
			if (led[i] == 1) {
				summable = false;
				break;
			}
		}
		if (summable || kouho == -1) {
			cout << -1 << endl;
		}
		else {
			cout << kouho+1 << endl;
		}
		
		end_loop: {}
	}
	
	return 0;
}

Compiler output:
a.cc:12:9: error: '__int64' does not name a type; did you mean '__int64_t'?
   12 | typedef __int64 ll;
      |         ^~~~~~~
      |         __int64_t
a.cc: In function 'int main()':
a.cc:82:17: error: jump to label 'end_loop'
   82 |                 end_loop: {}
      |                 ^~~~~~~~
a.cc:48:46: note:   from here
   48 |                                         goto end_loop;
      |                                              ^~~~~~~~
a.cc:68:22: note:   crosses initialization of 'bool summable'
   68 |                 bool summable = true;
      |                      ^~~~~~~~
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<functional>
#include<numeric>
#include<queue>
#include<stack>
using namespace std;
#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0; i<(int)(n); i++)
typedef __int64 ll;


int main() {
	int n;
	while(cin >> n, n) {
		vector<vector<int> > ms(n, vector<int>());
		for(int i = 0; i < n; i++) {
			int m;
			cin >> m;
			for(int j = 0; j < m; j++) {
				int mss;
				cin >> mss;
				mss--;
				ms[i].push_back(mss);
			}
		}
		int k;
		cin >> k;
		vector<int> led(n);
		for(int i = 0; i < k; i++) {
			int j;
			cin >> j;
			j--;
			led[j] = 1;
		}
		bool summable = true;
		// fill one
		int kouho = -1;
		for(int i = 0; i < n; i++) {
			int count = 0;
			for(int j = 0; j < ms[i].size(); j++) {
				if(led[ms[i][j]]) count++;
			}
			if (count == k) {
				if (kouho != -1) {
					cout << -1 << endl;
					goto end_loop;
				}
				kouho = i;
			}
		}
		// fill some
		for(int i = 0; i < n; i++) {
			if (i == kouho) continue;
			int count = 0;
			for(int j = 0; j < ms[i].size(); j++) {
				if(led[ms[i][j]]) count++;
			}
			if (count == ms[i].size()) {
				for(int j = 0; j < ms[i].size(); j++) {
					led[ms[i][j]] = 2;
					//cout << "sum" << ms[i][j] << endl;
				}
			}
		}
		
		for(int i = 0; i < n; i++) {
			if (led[i] == 1) {
				summable = false;
				break;
			}
		}
		if (summable || kouho == -1) {
			cout << -1 << endl;
		}
		else {
			cout << kouho+1 << endl;
		}
		
		end_loop: {}
	}
	
	return 0;
}

Compiler output:
a.cc:12:9: error: '__int64' does not name a type; did you mean '__int64_t'?
   12 | typedef __int64 ll;
      |         ^~~~~~~
      |         __int64_t
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstring>
#include<cstdio>
#include<cmath>
using namespace std;

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

const int MAXN = 101, MAXK = 101;

int n,m,k,t,p,l;
bool joho[MAXN][MAXN];
bool still[MAXN];

int main()
{
    while(cin >> n && n)
    {
        memset(still, true, sizeof(still));
        int ans = -1;
        int num = 0;
        for(int i=1;i<=n;i++)
        {
            cin >> t;
            rep(j,t)
            {
                cin >> p;
                joho[i][p] = true;
            }
        }

        cin >> k;
        rep(j,k)
        {
            cin >> l;
            for(int i = 1;i<=n;i++) still[i] = still[i] & joho[i][l];
        }

        for(int i=1;i<=n;i++)if(still[i])
        {
            ans = i;
            num++;
        }
        if(num>=2 || num == 0) {cout << -1 << endl; continue;}
        else cout << ans << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:51:34: error: expected '}' at end of input
   51 |         else cout << ans << endl;
      |                                  ^
a.cc:24:5: note: to match this '{'
   24 |     {
      |     ^
a.cc:51:34: error: expected '}' at end of input
   51 |         else cout << ans << endl;
      |                                  ^
a.cc:22:1: note: to match this '{'
   22 | {
      | ^
Language: C++

#include<vector>
#include<stack>
#include<queue>
#include<cstring>
#include<cstdio>
#include<cmath>
using namespace std;

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

const int MAXN = 101, MAXK = 101;

int n,m,k,t,p,l;
bool joho[MAXN][MAXN];
bool still[MAXN];

int main()
{
    while(cin >> n && n)
    {
        memset(still, true, sizeof(still));
        memset(joho, false, sizeof(joho));
        int ans = -1;
        int num = 0;
        for(int i=1;i<=n;i++)
        {
            cin >> t;
            rep(j,t)
            {
                cin >> p;
                joho[i][p] = true;
            }
        }

        cin >> k;
        rep(j,k)
        {
            cin >> l;
            for(int i = 1;i<=n;i++) still[i] = still[i] & joho[i][l];
        }

        for(int i=1;i<=n;i++)if(still[i])
        {
            ans = i;
            num++;
        }
        if(num>=2 || num == 0) {cout << -1 << endl; continue;}
        else cout << ans << endl;

    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:11: error: 'cin' was not declared in this scope
   20 |     while(cin >> n && n)
      |           ^~~
a.cc:7:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    6 | #include<cmath>
  +++ |+#include <iostream>
    7 | using namespace std;
a.cc:48:33: error: 'cout' was not declared in this scope
   48 |         if(num>=2 || num == 0) {cout << -1 << endl; continue;}
      |                                 ^~~~
a.cc:48:33: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:48:47: error: 'endl' was not declared in this scope
   48 |         if(num>=2 || num == 0) {cout << -1 << endl; continue;}
      |                                               ^~~~
a.cc:7:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    6 | #include<cmath>
  +++ |+#include <ostream>
    7 | using namespace std;
a.cc:49:14: error: 'cout' was not declared in this scope
   49 |         else cout << ans << endl;
      |              ^~~~
a.cc:49:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:49:29: error: 'endl' was not declared in this scope
   49 |         else cout << ans << endl;
      |                             ^~~~
a.cc:49:29: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

3
2 2 3
1 1
1 1
2 2 3
3
2 2 3
1 3
1 2
1 2
5
3 1 3 4
4 1 3 4 5
2 1 3
2 1 2
0
3 1 3 5
3
2 2 1
1 1
1 2
3 3 2 1
0

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 3
      | ^
Language: C++

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

typedef __int64 ll;

int main(){
	int n;
	ll p[100][2];
	while(cin>>n&&n){
		memset(p,0,sizeof(p));
		for(int i=0;i<n;i++){
			int m;
			cin>>m;
			for(int j=0;j<m;j++){
				int a;
				cin>>a;
				p[i][a/64] |= 1LL<<(a&63);
			}
		}
		int k;
		ll q[2]={0};
		cin>>k;
		for(int i=0;i<k;i++){
			int a;
			cin>>a;
			q[a/64] |= 1LL<<(a&63);
		}
		int ans=-1;
		for(int i=0;i<n;i++){
			if((p[i][0]&q[0])==q[0]&&(p[i][1]&q[1])==q[1]){
				if(ans==-1)ans=i+1;
				else{
					ans=-1;
					break;
				}
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

Compiler output:
a.cc:7:9: error: '__int64' does not name a type; did you mean '__int64_t'?
    7 | typedef __int64 ll;
      |         ^~~~~~~
      |         __int64_t
a.cc: In function 'int main()':
a.cc:11:9: error: 'll' was not declared in this scope
   11 |         ll p[100][2];
      |         ^~
a.cc:13:24: error: 'p' was not declared in this scope
   13 |                 memset(p,0,sizeof(p));
      |                        ^
a.cc:24:19: error: expected ';' before 'q'
   24 |                 ll q[2]={0};
      |                   ^~
      |                   ;
a.cc:29:25: error: 'q' was not declared in this scope
   29 |                         q[a/64] |= 1LL<<(a&63);
      |                         ^
a.cc:33:37: error: 'q' was not declared in this scope
   33 |                         if((p[i][0]&q[0])==q[0]&&(p[i][1]&q[1])==q[1]){
      |                                     ^
Language: C++

		
		memset(know, 0, sizeof(know));
		memset(leak, 0, sizeof(leak));

		for(int i=0; i<n; ++i){
		
			cin>>m[i];
			
			for(int j=0; j<m[i]; ++j){
				
				int p;
				cin>>p;
				know[i][--p] = true;
			}
		}

		cin>>k;

		for(int i=0; i<k; ++i){
			
			int l;
			cin>>l;
			leak[--l]=true;
		}

		int spy = -1;
		
		for(int i=0; i<n; ++i){

			bool f = true;

			for(int j=0; j<n; ++j){
				
				if( m[i] < k || i != j && !know[i][j] && leak[j] ){
					f = false;
					break;
				}
			}

			if(f){
				if(spy==-1){
					spy = i;
				}
				else{
					spy = -2;
				}
			}
		}

		cout << (spy>=0?++spy:-1) << endl;
	}

	return 0;
}

Compiler output:
a.cc:2:23: error: expected constructor, destructor, or type conversion before '(' token
    2 |                 memset(know, 0, sizeof(know));
      |                       ^
a.cc:3:23: error: expected constructor, destructor, or type conversion before '(' token
    3 |                 memset(leak, 0, sizeof(leak));
      |                       ^
a.cc:5:17: error: expected unqualified-id before 'for'
    5 |                 for(int i=0; i<n; ++i){
      |                 ^~~
a.cc:5:30: error: 'i' does not name a type
    5 |                 for(int i=0; i<n; ++i){
      |                              ^
a.cc:5:35: error: expected unqualified-id before '++' token
    5 |                 for(int i=0; i<n; ++i){
      |                                   ^~
a.cc:17:17: error: 'cin' does not name a type
   17 |                 cin>>k;
      |                 ^~~
a.cc:19:17: error: expected unqualified-id before 'for'
   19 |                 for(int i=0; i<k; ++i){
      |                 ^~~
a.cc:19:30: error: 'i' does not name a type
   19 |                 for(int i=0; i<k; ++i){
      |                              ^
a.cc:19:35: error: expected unqualified-id before '++' token
   19 |                 for(int i=0; i<k; ++i){
      |                                   ^~
a.cc:28:17: error: expected unqualified-id before 'for'
   28 |                 for(int i=0; i<n; ++i){
      |                 ^~~
a.cc:28:30: error: 'i' does not name a type
   28 |                 for(int i=0; i<n; ++i){
      |                              ^
a.cc:28:35: error: expected unqualified-id before '++' token
   28 |                 for(int i=0; i<n; ++i){
      |                                   ^~
a.cc:50:17: error: 'cout' does not name a type
   50 |                 cout << (spy>=0?++spy:-1) << endl;
      |                 ^~~~
a.cc:51:9: error: expected declaration before '}' token
   51 |         }
      |         ^
a.cc:53:9: error: expected unqualified-id before 'return'
   53 |         return 0;
      |         ^~~~~~
a.cc:54:1: error: expected declaration before '}' token
   54 | }
      | ^
Language: C++

#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <fstream>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str();}
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-12;
const double PI = acos(-1.0);
const int INF = INT_MAX/10;

int main() {
	int N;
	while(cin >> N, N) {
		vvi info(N, vi(N, 0));
		int M, p;
		REP(i, N) {
			cin >> M;
			REP(j, M) {
				cin >> p;
				info[i][p-1] = 1;
			}
		}
		int K;
		cin >> K;
		vi l(K);

Compiler output:
a.cc: In function 'int main()':
a.cc:50:25: error: expected '}' at end of input
   50 |                 vi l(K);
      |                         ^
a.cc:38:28: note: to match this '{'
   38 |         while(cin >> N, N) {
      |                            ^
a.cc:50:25: error: expected '}' at end of input
   50 |                 vi l(K);
      |                         ^
a.cc:36:12: note: to match this '{'
   36 | int main() {
      |            ^
Language: C++

#include <cstdio>
#include <set>

using namespace std;

#define MAX 128

int main()
{
	while(1) {
		int n;
		set<int> know[MAX];
		bool leak[MAX];
		memset(leak, true, sizeof(leak));
		
		scanf("%d", &n);
		if(!n) break;
		for(int i = 1; i <= n; i++) {
			int m;
			scanf("%d", &m);
			while(m--) {
				int p;
				scanf("%d", &p);
				know[i].insert(p);
			}
		}

		int k;
		scanf("%d", &k);
		while(k--) {
			int l;
			scanf("%d", &l);
			for(int i = 1; i <= n; i++) {
				if(!leak[i]) continue;
				set<int>::iterator it = know[i].find(l);
				if(it == know[i].end()) {
					leak[i] = false;
				}
			}
		}

		int ans = -1;
		for(int i = 1; i <= n; i++) {
			if(!leak[i]) continue;
			if(ans > 0) {
				ans = -1;
				break;
			}
			ans = i;
		}
		printf("%d\n", ans);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'memset' was not declared in this scope
   14 |                 memset(leak, true, sizeof(leak));
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <set>
  +++ |+#include <cstring>
    3 |
Language: C++

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

using namespace std;

typedef pair<int, int> P;

#define MAX 128

int main()
{
	while(1) {
		int n;
		set<int> know[MAX];
		bool leak[MAX];
		memset(leak, true, sizeof(leak));
		
		scanf("%d", &n);
		if(!n) break;
		for(int i = 1; i <= n; i++) {
			int m;
			scanf("%d", &m);
			while(m--) {
				int p;
				scanf("%d", &p);
				know[i].insert(p);
			}
		}

		int k;
		scanf("%d", &k);
		while(k--) {
			int l;
			scanf("%d", &l);
			for(int i = 1; i <= n; i++) {
				if(!leak[i]) continue;
				set<int>::iterator it = know[i].find(l);
				if(it == know[i].end()) {
					leak[i] = false;
				}
			}
		}

		int ans = -1;
		for(int i = 1; i <= n; i++) {
			if(!leak[i]) continue;
			if(ans > 0) {
				ans = -1;
				break;
			}
			ans = i;
		}
		printf("%d\n", ans);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:17: error: 'memset' was not declared in this scope
   27 |                 memset(leak, true, sizeof(leak));
      |                 ^~~~~~
a.cc:14:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   13 | #include <cstdlib>
  +++ |+#include <cstring>
   14 |
Language: C++

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

using namespace std;

typedef pair<int, int> P;

#define MAX 128

int main()
{
	while(1) {
		int n;
		bool know[MAX][MAX] = {false};
		bool leak[MAX];

		for(int i = 0; i < MAX; i++) {
			leak[i] = true;
		}
		
		scanf("%d", &n);
		if(!n) break;
		for(int i = 1; i <= n; i++) {
			int m;
			scanf("%d", &m);
			while(m--) {
				int p;
				scanf("%d", &p);
				know[i][p] = true;
			}
		}

		int k;
		scanf("%d", &k);
		while(k--) {
			int l;
			scanf("%d", &l);
			for(int i = 1; i <= n; i++) {
				if(!leak[i]) continue;
				if(!know[i][l]) {
					leak[i] = false;
				}
			}
		}

		int ans = -1;
		for(int i = 1; i <= n; i++) {
			if(!leak[i]) continue;
			if(ans > 0) {
				ans = -1;
				break;
			}
			ans = i;
		}
		printf("%d\n", ans);
	}
	return 0;

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

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

import com.sun.org.apache.regexp.internal.recompile;
public class Main{
	static int p,t,r;
	
	
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		while(true){
			t=sc.nextInt();
			p=sc.nextInt();
			r=sc.nextInt();
			if(t+p+r==0)break;
		
			
			ArrayList<Data>list=new ArrayList<Data>();//listに入れる処理をしなきゃね			
			for(int i=0;i<t;i++){
				list.add(new Data(i+1));
			}
			for(int i=0;i<r;i++){
				int teams=sc.nextInt()-1;
				int number=sc.nextInt();
				int pena=sc.nextInt();
				String mes=sc.next();
				list.get(teams).solve(number, pena, mes);
			}
			Collections.sort(list);
			for(int i=0;i<list.size();i++){
				System.out.println(list.get(i));
			}
		}
	}
	static class Data implements Comparable<Data>{
		int team,ans,pena;
		int wrong[];boolean t[];
		public Data(int id){
			this.team=id;
			this.ans=0;
			this.pena=0;
			wrong=new int[p+1];
			t=new boolean[p+1];
		}
		void solve(int problem,int time,String message){//提出したときの処理
			if(message.equals("CORRECT")){
				if(t[problem])return;
				ans++;
				pena+=time+wrong[problem]*1200;
				t[problem]=true;
			}else{
				wrong[problem]++;
			}
		}
		@Override
		public int compareTo(Data o) {
			if(this.ans<o.ans){
				return 1;
			}else if(this.ans>o.ans){
				return -1;
			}else if(this.pena>o.pena){
				return 1;
			}else if(this.pena<o.pena){
				return -1;
			}else if(this.team>o.team){
				return 1;
			}else if(this.team<o.team){
				return-1;
			}return 0;
		}
		public String toString(){
			return this.team+" "+this.ans+" "+this.pena;
		}
	}
}

Compiler output:
Main.java:5: error: package com.sun.org.apache.regexp.internal does not exist
import com.sun.org.apache.regexp.internal.recompile;
                                         ^
1 error
Language: C

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

int main() {

	int T,P,R;
	int i,j,k,temp;
	int **t;
	int log_team,log_p,log_time;
	char log_m[10];


	for(;;) {
		scanf("%d %d %d",&T,&P,&R);
		if(!T&&!P&&!R) break;

		t=malloc(T*sizeof(int));
		for(i=0;i<T;i++)
			t[i]=(int *)malloc(4*sizeof(int)); //???i?????????????????¶??????????????????????????£?????°?????????????????£???????????°

		for(i=0;i<T;i++)
			for(j=0;j<4;j++) {
				if(j==0)
					t[i][j]=i+1;
				else
					t[i][j]=0;
			}

		for(i=0;i<R;i++) {
			scanf("%d %d %d %s",&log_team,&log_p,&log_time,log_m);

			//printf("%c\n",log_m[0]);

			if(log_m[0]=='C') {
				t[log_team-1][1]++;
				t[log_team-1][2]+=(t[log_team-1][3])*1200+log_time;
				t[log_team-1][3]=0;
				//printf("%d %d %d\n",t[log_team-1][0],t[log_team-1][1],t[log_team-1][2]);
			}

			else {
				t[log_team-1][3]+=1;
			}
		}

		for(i=0;i<T-1;i++) {
			for(j=i+1;j<T;j++) {
				if(t[i][1]<t[j][1]||(t[i][1]==t[j][1]&&t[i][2]>t[j][2])) {
					for(k=0;k<3;k++) {
					temp=t[i][k];
					t[i][k]=t[j][k];
					t[j][k]=temp;
					}
				}
			}
		}

		for(i=0;i<T-1;i++) {
			for(j=i+1;j<T;j++) {
				if(t[i][1]==t[j][1]&&t[i][2]==t[j][2]&&t[i][0]>t[j][0]) {
					temp=t[i][0];
					t[i][0]=t[j][0];
					t[j][0]=temp;
				}
			}
		}
		for(i=0;i<T;i++)
			printf("%d %d %d\n",t[i][0],t[i][1],t[i][2]);
	}

Compiler output:
main.c: In function 'main':
main.c:70:9: error: expected declaration or statement at end of input
   70 |         }
      |         ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <tuple>

using namespace std;

#define rep(i, n) for(int i=0; i<(n); ++i)
#define all(c) (c).begin(), (c).end()

int main(){
    int T, P, R;
    while(cin >> T >> P >> R, T|P|R){
        vector<vector<int> > pen(T, vector<int>(P));
        vector<tuple<int, int, int> > info(T);
        rep(i, T)get<2>(info[i]) = i+1;
        while(R--){
            int tID, pID, tim; string mes;
            cin >> tID >> pID >> tim >> mes;
            tID--; pID--;
            if(mes[0] == 'W')pen[tID][pID]++;
            else{
                get<0>(info[tID])--;
                get<1>(info[tID]) += pen[tID][pID] * 1200 + tim;
            }
        }
        sort(all(info));
        rep(i, T){
            int corr, pena, id; tie(corr, pena, id) = info[i];
            cout << id << ' ' << -corr << ' ' << pena << '\n';
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   27 |         sort(all(info));
      |         ^~~~
      |         short
Language: C++

1 3 7200
3 1 2600
2 0 0
5 2 7000
3 1 4000
4 1 4000
1 0 0
2 0 0
4 2 2000
5 2 2000
1 2 2600
3 2 2600
2 0 0
6 0 0

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 1 3 7200
      | ^
Language: C++

import java.util.Arrays;
import java.util.Scanner;

public class Main {
	class Team implements Comparable<Team>{
		int id, s;
		int[] p;
		int ac;

		Team(int id, int pro) {
			this.id = id;
			this.p = new int[pro];
			this.s = 0;
			this.ac = 0;
		}

		@Override
		public int compareTo(Team o) {
			if (this.ac != o.ac)
				return o.ac - this.ac;
			return this.s - o.s;
		}
	}

	void run() {
		Scanner sc = new Scanner(System.in);

		while (true) {
			int n = sc.nextInt();
			int m = sc.nextInt();
			int r = sc.nextInt();
			if ((n | m | r) == 0) {
				break;
			}

			Team[] t = new Team[n];
			for (int i = 0; i < n; i++) {
				t[i] = new Team(i, m);
			}

			for (int i = 0; i < r; i++) {
				int tid = sc.nextInt() - 1;
				int pid = sc.nextInt() - 1;
				int tim = sc.nextInt();
				String mes = sc.next();

				if (mes.equals("CORRECT")) {
					t[tid].ac++;
					t[tid].s += t[tid].p[pid]*1200 + tim;
				} else {
					t[tid].p[pid]++;
				}
			}

			Arrays.sort(t);
			for (int i = 0; i < n; i++) {
				int tid = t[i].id;
				int ac = t[i].ac;
				int pen = t[i].s;
				System.out.println(++tid + " " + ac + " " + pen);
			}
		}
	}

	public static void main(String[] args) {
		new Main().run();
	}
}

Compiler output:
a.cc:17:17: error: stray '@' in program
   17 |                 @Override
      |                 ^
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Arrays;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Scanner;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
    4 | public class Main {
      | ^~~~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int G[102][102];
const int INF=-2;
int main(){
	int n,m,p;
	cin>>n;
	for(int i=0;i<102;i++)fill(G[i],G[i]+102,INF);
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++){
			cin>>p;
			G[i][p]=1;
		}
	}
	return 0;
}#include<iostream>
#include<vector>
using namespace std;
int G[102][102];
const int INF=-2;
int main(){
	int n,m,p;
	cin>>n;
	for(int i=0;i<102;i++)fill(G[i],G[i]+102,INF);
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++){
			cin>>p;
			G[i][p]=1;
		}
	}
	return 0;
}

Compiler output:
a.cc:17:2: error: stray '#' in program
   17 | }#include<iostream>
      |  ^
a.cc:17:3: error: 'include' does not name a type
   17 | }#include<iostream>
      |   ^~~~~~~
a.cc:20:5: error: redefinition of 'int G [102][102]'
   20 | int G[102][102];
      |     ^
a.cc:4:5: note: 'int G [102][102]' previously declared here
    4 | int G[102][102];
      |     ^
a.cc:21:11: error: redefinition of 'const int INF'
   21 | const int INF=-2;
      |           ^~~
a.cc:5:11: note: 'const int INF' previously defined here
    5 | const int INF=-2;
      |           ^~~
a.cc:22:5: error: redefinition of 'int main()'
   22 | int main(){
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main(){
      |     ^~~~
Language: C++

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

using namespace std;

struct Team {
	int tid, correct, penalty;

	Team() {}
	Team(int tid, int correct, int penalty) : tid(tid), correct(correct), penalty(penalty) {}
};
bool operator >(const Team& t1, const Team& t2) {
	if (t1.correct == t2.correct) return t1.penalty < t2.penalty;
	else return t1.correct > t2.correct;
}

int main() {
	int T, P, R;
	while ( cin >> T >> P >> R, T || P || R ) {
		int correct[50] = {0}, wrong[50][10] = {0};
		bool solver[50][10] = {0};
		int penalty[50] = {0};
		for (int i = 0; i < R; ++i) {
			int tid, pid, time; string message; cin >> tid >> pid >> time >> message;
			--tid, --pid;
			if (message == "CORRECT") {
				if (!solved[tid][pid]) {
					++correct[tid];
					penalty[tid] += wrong[tid][pid] * 1200 + time;
					solved[tid][pid] = true;
				}
			}
			else {
				++wrong[tid][pid];
			}
		}

		vector<Team> v(T);
		for (int i = 0; i < T; ++i) {
			v[i] = Team(i+1, correct[i], penalty[i]);
		}
		sort( v.begin(), v.end(), greater<Team>() );

		for (int i = 0; i < T; ++i) {
			cout << v[i].tid << " " << v[i].correct << " " << v[i].penalty << endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:38: error: 'solved' was not declared in this scope; did you mean 'solver'?
   28 |                                 if (!solved[tid][pid]) {
      |                                      ^~~~~~
      |                                      solver
Language: C++

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

struct Team{
  int team_num,time,correct;
};

int main(){
  Team data[51];
  while(1){
    int i,j,T,P,R; cin >> T >> P >> R;
    if ( T == 0 && P == 0 && R == 0 ) break;
    for( i = 1; i <= T; i++ ){
      data[i].time = 0;
      data[i].correct = 0;
      data[i].team_num = i;
    }

    int t,p,jikan,twrong[51][11];
    for( i = 0; i < 51; i++ ){
      for( j = 0; j < 11; j++ ){
	twrong[i][j]=0;
      }
    }
    string str;
    for( i = 0; i < R; i++ ){
      cin >> t >> p >> jikan >> str;
      if( str == "CORRECT" ){
	data[t].correct++;
	data[t].time = data[t].time + twrong[t][p] * 1200 + jikan;
      }else if( str == "WRONG" ){
	twrong[t][p]++;
      }
    }
    for( i = 0; i < T; i++ ){
      for( j = 1; j < T; j++ ){
	if( data[j].team_num > data[j+1].team_num ) 
	  swap( data[j],data[j+1] );
      }
    }

    for( i = 0; i < T; i++ ){
      for( j = 1; j < T; j++ ){
	if( data[j].time > data[j+1].time ) 
	  swap( data[j],data[j+1] );
      }
    }

    for( i = 0; i < T; i++ ){
      for( j = 1; j < T; j++ ){
	if( data[j].correct < data[j+1].correct ) 
	  swap( data[j],data[j+1] );
      }
    }

    for( i = 1; i <= T; i++ ){
      cout << data[i].team_num << " "
	   << data[i].correct << " " << data[i].time << endl;
    }
    
  }
  return 0j;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:10: error: cannot convert '__complex__ int' to 'int' in return
   63 |   return 0j;
      |          ^~
      |          |
      |          __complex__ int
Language: C++

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

typedef struct {
    int ID;
    int penalty;
    int solved;
} set;

set team[51];
int i, j;
int wrong[51][11];
int tID, pID, time;
int T, P, R;
char mes[10];
int count;

int max_solved, min_penalty, winner;

void findfirst(void);

int main(void)
{
    while(1) {
	scanf("%d %d %d", &T, &P, &R);
	if (T == 0) break;
	for (i = 1; i <= T; i++) {
	    team[i].ID = i;
	    team[i].penalty = 0;
	    team[i].solved = 0;
	    for (j = 1; j <= P; j++) {
		wrong[i][j] = 0;
	    }
	}
	for (i = 0; i < R; i++) {
	    scanf("%d %d %d %s", &tID, &pID, &time, mes);
	    if (mes[0] == 'W') {
		wrong[tID][pID]++;
	    } else {
		team[tID].solved++;
		team[tID].penalty += 1200 * wrong[tID][pID] + time;
	    }
	}
	max_solved = T + 1;
	min_penalty = - 1;
	winner = 0;
	for (count = 0; count < T; count++) {
	    findfirst();
	    printf("%d %d %d\n", winner, team[winner].solved, team[winner].penalty);
	    max_solved = team[winner].solved;
	    min_penalty = team[winner].penalty;
	}
    }
    return 0;
}

void findfirst(void)
{
    int winner_solved = -1;
    int winner_penalty = 1200 * 500 + 10800 * 500;
    int winner_team;
    int winner_candidate[51];

    for (i = 1; i <= T; i++) {
	if (team[i].solved > winner_solved && (team[i].solved < max_solved || (team[i].solved == max_solved && team[i].penalty > min_penalty) || (team[i].solved == max_solved && team[i].penalty == min_penalty && i > winner))) {
	    winner_solved = team[i].solved;
	    winner_team = i;
	}
    }
    j = 0;
    for (i = winner_team; i <= T; i++) {
	if (team[i].solved == team[winner_team].solved) {
	    winner_candidate[j] = i;
	    j++;
	}
    }
    for (i = 0; i < j; i++) {
	if (team[winner_candidate[i]].penalty < winner_penalty) {
	    winner_penalty = team[winner_candidate[i]].penalty;
    	    winner = winner_candidate[i];
	}
    }
}
    	

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <stdio.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:25:9: error: 'scanf' was not declared in this scope
   25 |         scanf("%d %d %d", &T, &P, &R);
      |         ^~~~~
a.cc:49:13: error: 'printf' was not declared in this scope
   49 |             printf("%d %d %d\n", winner, team[winner].solved, team[winner].penalty);
      |             ^~~~~~
a.cc:3:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    2 | #include <string.h>
  +++ |+#include <cstdio>
    3 |
Language: C++

#include<bits/stdc++.h>
#define I 900000
int x[99],z[99],y[99][20],h[99],a,b,c,d,e,f,i,j,k;string S;
int main(){
while(true){
for(i=0;i<99;i++){x[i]=I;}
memset(y,0,sizeof(y));
memset(h,0,sizeof(h));
std::cin>>a>>b>>c;
if(a==0){break;}
for(i=0;i<c;i++){
std::cin>>d>>e>>f>>S;
if(S[0]=='W'){
y[d][e]++;
}
else{
x[d]+=I;
x[d]-=f+1200*y[d][e];
}
}
for(i=1;i<=a;i++){z[i]=x[i];}
sort(x+1,x+a+1);
for(i=a;i>=1;i--){
for(j=1;j<=a;j++){
if(z[j]==x[i]&&h[j]==0){
printf("%d %d %d\n",j,(x[i]+I-1)/I-1,(99*I-x[i])%I);
h[j]=1;
}
}
}
}
}

Compiler output:
a.cc:3:51: error: 'string' does not name a type; did you mean 'stdin'?
    3 | int x[99],z[99],y[99][20],h[99],a,b,c,d,e,f,i,j,k;string S;
      |                                                   ^~~~~~
      |                                                   stdin
a.cc: In function 'int main()':
a.cc:12:20: error: 'S' was not declared in this scope
   12 | std::cin>>d>>e>>f>>S;
      |                    ^
a.cc:22:1: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   22 | sort(x+1,x+a+1);
      | ^~~~
      | std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
Language: C++

#include<iostream>
#include<string>
#include<vector>
using namespace std;
struct team{
  int point,penalty,wrong[11],id;
  bool operator<(const team& a)  const{
    return point == a.point ? (penalty == a.penalty ? id < a.id : penalty < a.penalty) : point > a.point; 
  }
};
int main(){
  int t,p,r,i,j,k,b,o,tid,pid,time;
  string str;
  cin >> t >> p >> r;
  while(t!=0||p!=0||r!=0){
    vector <team> teams;
    for(i=1;i<=t;i++){
      team t;
      t.id=i;
      t.point=0;
      for(j=0;j<11;j++)
      t.wrong[j]=0;
      t.penalty=0;
      teams.push_back(t);
    }
    for(i=0;i<r;i++){
      cin >> tid >> pid >> time >> str;
      if(str[0]=='C'){
	teams[tid-1].point++;
	teams[tid-1].penalty+=teams[tid-1].wrong[pid]*1200+time;
      }else{
	teams[tid-1].wrong[pid]++;
      }
    }
    sort(teams.begin(),teams.end());
    for(i=0;i<t;i++){
      cout << teams[i].id << " " << teams[i].point << " " << teams[i].penalty << endl;
    }
    cin >> t >> p >> r;
  }
  return 0;
}

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

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

struct Tscore {
    int t_id;
    int AC_num;
    int penalty;
    int WA_num[11];

    Tscore(int id) {
        t_id = id;
        AC_num = 0;
        penalty = 0;
        for (int i = 0; i < 11; i++) WA_num[i] = 0;
    }

    bool operator < (const Tscore& right) const {
        if (AC_num == right.AC_num) {
            if (penalty == right.penalty) {
                return t_id < right.t_id; // ???????????????????°??????????
            }
            return penalty < right.penalty; // ??????????????£????°??????????
        }

        return AC_num > right.AC_num; // ??£?§£??°????????????
    }
};

int main(void) {

    int T, P, R;
    while (cin >> T >> P >> R, T||P||R) {
        vector<Tscore> teams;
        for (int i = 0; i < T; i++) {
            teams.push_back(Tscore(i+1));
        }
        int tID, pID, time;
        string message;
        for (int i = 0; i < R; i++) {
            cin >> tID >> pID >> time >> message;
            if (message == "CORRECT") {
                teams[tID-1].AC_num++;
                teams[tID-1].penalty += teams[tID-1].WA_num[pID]*1200 + time;
            } else {
                teams[tID-1].WA_num[pID]++;
            }
        }

        sort(teams.begin(), teams.end());
        for (int i = 0; i < T; i++) {
            cout << teams[i].t_id << " " << teams[i].AC_num << " " << teams[i].penalty << endl;
        }
    }

    return 0;
}

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

#include<iostream>
#include<tuple>
#include<queue>

using namespace std;

signed main(){

   while(1){
      int T, P, R;
      cin>> T>> P>> R;
      if(!(T||P||R)) break;

      int hoge[T][P];
      fill((int*)hoge, (int*)hoge+T*P, 0);
      for(int i=0; i<R; i++){
         int team, prob, time;
         string s;
         cin>> team>> prob>> time>> s;
         team--; prob--;
         if(s=="CORRECT"){
            hoge[team][prob]=1200*max(0-hoge[team][prob], 0)+time;
         }else{
            hoge[team][prob]--;
         }
      }
      priority_queue<tuple<int, int, int>> Q;
      for(int i=0; i<T; i++){
         int ac=0, pena=0;
         for(int j=0; j<P; j++){
            ac+=(hoge[i][j]>0);
            pena+=max(hoge[i][j], 0);
         }
         Q.push(make_tuple(ac, -pena, -i));
      }



      for(int i=0; i<V.size(); i++){
         int ac, pena, team;
         tie(ac, pena, team)=Q.top(); Q.pop();
         cout<< -team+1<< " "<< ac<< " "<< -pena<< endl;
      }

   }

   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:22: error: 'V' was not declared in this scope
   39 |       for(int i=0; i<V.size(); i++){
      |                      ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
  int T, P, R, tid, pid, t;
  string m;
  while (cin >> T >> P >> R, T) {
    vector< vector<int> > V(T, vector<int>(3, 0));
    vector< vector<int> > Problem(T, vector<int>(P, 0));
    for (int i = 0; i < T; ++i) V[i][2] = i+1;
    for (int i = 0; i < R; ++i) {
      cin >> tid >> pid >> t >> m;
      --tid;
      --pid;
      if (Problem[tid][pid] != 1) {
	if (m == "CORRECT") {
	  V[tid][1] += -Problem[tid][pid]*1200 + t;
	  Problem[tid][pid] = 1;
	  --V[tid][0];
	} else {
	  --Problem[tid][pid];
	}
      }
    }
    sort(V.begin(), V.end());
    for (int i = 0; i < T; ++i) {
      cout << V[i][2] << " " << -V[i][0] << " " << V[i][1] << endl;
    }
  }
  return 0;
}

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

#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
  int T, P, R, tid, pid, t;
  string m;
  while (cin >> T >> P >> R, T) {
    vector< vector<int> > V(T, vector<int>(3, 0));
    vector< vector<int> > Problem(T, vector<int>(P, 0));
    for (int i = 0; i < T; ++i) V[i][2] = i+1;
    for (int i = 0; i < R; ++i) {
      cin >> tid >> pid >> t >> m;
      --tid;
      --pid;
      if (Problem[tid][pid] != 1) {
	if (m == "CORRECT") {
	  V[tid][1] += -Problem[tid][pid]*1200 + t;
	  Problem[tid][pid] = 1;
	  --V[tid][0];
	} else {
	  --Problem[tid][pid];
	}
      }
    }
    sort(V.begin(), V.end());
    for (int i = 0; i < T; ++i) {
      cout << V[i][2] << " " << -V[i][0] << " " << V[i][1] << endl;
   

Compiler output:
a.cc: In function 'int main()':
a.cc:29:68: error: expected '}' at end of input
   29 |       cout << V[i][2] << " " << -V[i][0] << " " << V[i][1] << endl;
      |                                                                    ^
a.cc:28:33: note: to match this '{'
   28 |     for (int i = 0; i < T; ++i) {
      |                                 ^
a.cc:29:68: error: expected '}' at end of input
   29 |       cout << V[i][2] << " " << -V[i][0] << " " << V[i][1] << endl;
      |                                                                    ^
a.cc:9:33: note: to match this '{'
    9 |   while (cin >> T >> P >> R, T) {
      |                                 ^
a.cc:29:68: error: expected '}' at end of input
   29 |       cout << V[i][2] << " " << -V[i][0] << " " << V[i][1] << endl;
      |                                                                    ^
a.cc:6:12: note: to match this '{'
    6 | int main() {
      |            ^