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

#include <iostream>
#include <algorithm>
#include <math.h>
using namespace std;
int main() {
  int n;
  while (cin >> n)
  int up = 0;
  int low = 100000;
  for (int i = 0; i < n; i++) {
    int sum = 0;
    for (int j = 0; j < 5; j++) {
      int a;
      cin >> a;
      sum += a;
    }
    up = max(up, sum);
    low = min(low, sum);
  }
  cout << up << " " << low << endl;
}
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'up' was not declared in this scope
   17 |     up = max(up, sum);
      |     ^~
a.cc:20:11: error: 'up' was not declared in this scope
   20 |   cout << up << " " << low << endl;
      |           ^~
a.cc: At global scope:
a.cc:22:3: error: expected unqualified-id before 'return'
   22 |   return 0;
      |   ^~~~~~
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
main(){
  int n;
  while(cin>>n && n){
    int mini=10000,maxi=-10000;
    for(int i=0;i<n;i++){
      int now=0,t;
      for(int j=0;j<5;j++){
	cin>>t;
	now+=t;
      }
      maxi=max(maxi,now);
      mini=min(mini,now);
    }p
    cout << maxi<<" " << mini << endl;
  }
}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:16:6: error: 'p' was not declared in this scope
   16 |     }p
      |      ^
Language: C++

#include <stdio.h>

int main() {
     int n,i,a,b,c,d,e,sum,maxp,minp;

     while(1) {
          scanf("%d,&n);

　　　 if(n =0) break;

          maxp = 0;
          minp = 10000000;

          for(i=0; i<n; i++) {
          scanf("%d%d%d%d%d",&a,&b,&c,&d,&e) ;
          sum = a + b + c + d + e ;
          if(sum > maxp) maxp = sum;
          if(sum < minp) minp = sum;
          }

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

Compiler output:
a.cc:7:17: warning: missing terminating " character
    7 |           scanf("%d,&n);
      |                 ^
a.cc:7:17: error: missing terminating " character
    7 |           scanf("%d,&n);
      |                 ^~~~~~~~
a.cc:9:1: error: extended character 　 is not valid in an identifier
    9 | 　　　 if(n =0) break;
      | ^
a.cc:9:1: error: extended character 　 is not valid in an identifier
a.cc:9:1: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:9:1: error: '\U00003000\U00003000\U00003000' was not declared in this scope
    9 | 　　　 if(n =0) break;
      | ^~~~~~
Language: C++

#include <stdio.h>

int main() {
     int n,i,a,b,c,d,e,sum,maxp,minp;

     while(1) {
          scanf("%d,&n);

　　　 if(n = 0) break;

          maxp = 0;
          minp = 10000000;

          for(i=0; i<n; i++) {
          scanf("%d%d%d%d%d",&a,&b,&c,&d,&e) ;
          sum = a + b + c + d + e ;
          if(sum > maxp) maxp = sum ;
          if(sum < minp) minp = sum ;
          }

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

Compiler output:
a.cc:7:17: warning: missing terminating " character
    7 |           scanf("%d,&n);
      |                 ^
a.cc:7:17: error: missing terminating " character
    7 |           scanf("%d,&n);
      |                 ^~~~~~~~
a.cc:9:1: error: extended character 　 is not valid in an identifier
    9 | 　　　 if(n = 0) break;
      | ^
a.cc:9:1: error: extended character 　 is not valid in an identifier
a.cc:9:1: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:9:1: error: '\U00003000\U00003000\U00003000' was not declared in this scope
    9 | 　　　 if(n = 0) break;
      | ^~~~~~
Language: C++

#include <stdio.h>

int main() {
     int n,i,a,b,c,d,e,sum,maxp,minp;

     while(1) {
          scanf("%d,&n);

　　　 if(n == 0) break;

          maxp = 0;
          minp = 10000000;

          for(i=0; i<n; i++) {
          scanf("%d%d%d%d%d",&a,&b,&c,&d,&e) ;
          sum = a + b + c + d + e ;
          if(sum > maxp) maxp = sum ;
          if(sum < minp) minp = sum ;
          }

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

Compiler output:
a.cc:7:17: warning: missing terminating " character
    7 |           scanf("%d,&n);
      |                 ^
a.cc:7:17: error: missing terminating " character
    7 |           scanf("%d,&n);
      |                 ^~~~~~~~
a.cc:9:1: error: extended character 　 is not valid in an identifier
    9 | 　　　 if(n == 0) break;
      | ^
a.cc:9:1: error: extended character 　 is not valid in an identifier
a.cc:9:1: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:9:1: error: '\U00003000\U00003000\U00003000' was not declared in this scope
    9 | 　　　 if(n == 0) break;
      | ^~~~~~
Language: C++

#include<stdio.h>

int main() {
    int a,b,c,d,e,n,maxp,minp,i,sum ;

    while(1){    
          scanf("%d,%n) ;

          if(n == 0) break;

          maxp = 0;
          minp = 500;

          for(i=0;i<n;i++){
              scanf("%d%d%d%d%d".&a,%b,%c,%d,%e) ;
              sum = a + b + c + d + e ;
              if(sum > maxp) maxp = sum ;
              }

              printf("%d %d\n",maxp,minp);

          }
          return 0;
}

Compiler output:
a.cc:7:17: warning: missing terminating " character
    7 |           scanf("%d,%n) ;
      |                 ^
a.cc:7:17: error: missing terminating " character
    7 |           scanf("%d,%n) ;
      |                 ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:9:11: error: expected primary-expression before 'if'
    9 |           if(n == 0) break;
      |           ^~
a.cc:15:34: error: expected unqualified-id before '&' token
   15 |               scanf("%d%d%d%d%d".&a,%b,%c,%d,%e) ;
      |                                  ^
a.cc:15:37: error: expected primary-expression before '%' token
   15 |               scanf("%d%d%d%d%d".&a,%b,%c,%d,%e) ;
      |                                     ^
a.cc:15:40: error: expected primary-expression before '%' token
   15 |               scanf("%d%d%d%d%d".&a,%b,%c,%d,%e) ;
      |                                        ^
a.cc:15:43: error: expected primary-expression before '%' token
   15 |               scanf("%d%d%d%d%d".&a,%b,%c,%d,%e) ;
      |                                           ^
a.cc:15:46: error: expected primary-expression before '%' token
   15 |               scanf("%d%d%d%d%d".&a,%b,%c,%d,%e) ;
      |                                              ^
Language: C++

#include<stdio.h>

int main() {
    int a,b,c,d,e,n,maxp,minp,i,sum ;

    while(1){    
          scanf("%d,%n) ;

          if(n == 0) break;

          maxp = 0;
          minp = 500;

          for(i=0;i<n;i++){
              scanf("%d%d%d%d%d".&a,%b,%c,%d,%e) ;
              sum = a + b + c + d + e ;
              if(sum > maxp) maxp = sum ;
              if(sum < minp)  minp = sum ;
              }

              printf("%d %d\n",maxp,minp);

          }
          return 0;
}

Compiler output:
a.cc:7:17: warning: missing terminating " character
    7 |           scanf("%d,%n) ;
      |                 ^
a.cc:7:17: error: missing terminating " character
    7 |           scanf("%d,%n) ;
      |                 ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:9:11: error: expected primary-expression before 'if'
    9 |           if(n == 0) break;
      |           ^~
a.cc:15:34: error: expected unqualified-id before '&' token
   15 |               scanf("%d%d%d%d%d".&a,%b,%c,%d,%e) ;
      |                                  ^
a.cc:15:37: error: expected primary-expression before '%' token
   15 |               scanf("%d%d%d%d%d".&a,%b,%c,%d,%e) ;
      |                                     ^
a.cc:15:40: error: expected primary-expression before '%' token
   15 |               scanf("%d%d%d%d%d".&a,%b,%c,%d,%e) ;
      |                                        ^
a.cc:15:43: error: expected primary-expression before '%' token
   15 |               scanf("%d%d%d%d%d".&a,%b,%c,%d,%e) ;
      |                                           ^
a.cc:15:46: error: expected primary-expression before '%' token
   15 |               scanf("%d%d%d%d%d".&a,%b,%c,%d,%e) ;
      |                                              ^
Language: C++

#include<stdio.h>

int main() {
    int a,b,c,d,e,n,maxp,minp,i,sum ;

    while(1){    
          scanf("%d,%n) ;

          if(n == 0) break;

          minp = 0;
          maxp = 500;

          for(i=0;i<n;i++){
              scanf("%d%d%d%d%d".&a,%b,%c,%d,%e) ;
              sum = a + b + c + d + e ;
              if(sum > maxp) maxp = sum ;
              if(sum < minp) minp = sum ;
              }

              printf("%d %d\n",maxp,minp);

          }
          return 0;
}

Compiler output:
a.cc:7:17: warning: missing terminating " character
    7 |           scanf("%d,%n) ;
      |                 ^
a.cc:7:17: error: missing terminating " character
    7 |           scanf("%d,%n) ;
      |                 ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:9:11: error: expected primary-expression before 'if'
    9 |           if(n == 0) break;
      |           ^~
a.cc:15:34: error: expected unqualified-id before '&' token
   15 |               scanf("%d%d%d%d%d".&a,%b,%c,%d,%e) ;
      |                                  ^
a.cc:15:37: error: expected primary-expression before '%' token
   15 |               scanf("%d%d%d%d%d".&a,%b,%c,%d,%e) ;
      |                                     ^
a.cc:15:40: error: expected primary-expression before '%' token
   15 |               scanf("%d%d%d%d%d".&a,%b,%c,%d,%e) ;
      |                                        ^
a.cc:15:43: error: expected primary-expression before '%' token
   15 |               scanf("%d%d%d%d%d".&a,%b,%c,%d,%e) ;
      |                                           ^
a.cc:15:46: error: expected primary-expression before '%' token
   15 |               scanf("%d%d%d%d%d".&a,%b,%c,%d,%e) ;
      |                                              ^
Language: C++

#include <srdio.h>

int main(){
    int i,n,maxp,minp,a,b,c,d,e,sum;

    while(1){
        scanf("%d",&n);

        if(n == 0) break;

        maxp = 0;
        minp = 1000000;

        for(i=o; i<n; i++){
            scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
            sum = a + b + c + d + e;
            if(sum > maxp) maxp = sum;
            if(sum < minp) minp = sum;
        }

        print("%d %d\n",maxp,minp);

    }
    return 0;
}

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

#include <srdio.h>

int main(){
    int i,n,maxp,minp,a,b,c,d,e,sum;

    while(1){
        scanf("%d",&n);

        if(n == 0) break;

        maxp = 0;
        minp = 1000000;

        for(i=0; i<n; i++){
            scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
            sum = a + b + c + d + e;
            if(sum > maxp) maxp = sum;
            if(sum < minp) minp = sum;
        }

        print("%d %d\n",maxp,minp);

    }
    return 0;
}

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

#include <stdio.h>

int main() {
    int i,n,maxp,minp,a,b,c,d,e,sum;

    while(1){
        scanf("%d",&n);

        if(n == 0) break;

        maxp = 0;
        minp = 1000000;

        for(i=0; i<n; i++){
            scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
            sum = a + b + c + d + e;
            if(sum > maxp) maxp = sum;
            if(sum < minp) minp = sum;
        }

        print("%d %d\n",maxp,minp);

    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'print' was not declared in this scope; did you mean 'printf'?
   21 |         print("%d %d\n",maxp,minp);
      |         ^~~~~
      |         printf
Language: C++

import java.util.Scanner;
public class Main
{
	public static void main(String arg[])
	{
		Scanner in = new Scanner(System.in);
		while(in.hasNext())
		{
			int n=in.nextInt();
			if(n==0)
				return;
			int max=0;
			int min=500;
			while(n-->0)
			{
				int s=0;
				for(int i=0;i<5;i++)
					s+=in.nextInt();
				if(max<=s)
					max=s;
				if(min>=s)
					min=s;
			}
			System.out.println(max+" "+min);
		}
	}
}

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

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

using namespace std;

int main() {
	int n;

	while(true) {
		cin >> n;

		if(!n) {
			break;
		}

		vector< vector< int > > score(n, vector< int >(5, 0));
		vector< int > point(n, 0);

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

		for(int i = 0; i < n; i++) {
			int tmp = 0;
			for(int j = 0; j < 5; j++) {
				tmp += score[i][j];
			}
			point[i] = tmp;
		}

		int p_max = 0, p_min = INT_MAX / 4;

		for(int i = 0; i < n; i++) {
			p_max = max(p_max, point[i]);
			p_min = min(p_min, point[i]);
		}

		cout << p_max << " " << p_min << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:40: error: 'INT_MAX' was not declared in this scope
   35 |                 int p_max = 0, p_min = INT_MAX / 4;
      |                                        ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <vector>
  +++ |+#include <climits>
    5 |
Language: C++

import sys

def solve():
    while True:
        n = int(raw_input())
	if n ==	0:
            return
	s = []
        for i in range(n):
            d =	map(int,raw_input().split())
            s.append(sum(d))
	print max(s),min(s)

if __name__ == "__main__":
    solve()

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C

3 3
*******1 100
******22 1000
11111112 1000000
01203291
02382022
11111111
10 10
****3228 149416
****3992 198635
****4286 77783
****4843 225244
***49835 231046
***59393 379996
*5763748 437345
*6726222 58054
*8117882 16375
*9244339 537727
77885716
96726222
26971031
66652868
89599648
37772338
64679621
65479161
92959393
57855682
0 0

Compiler output:
main.c:1:1: error: expected identifier or '(' before numeric constant
    1 | 3 3
      | ^
main.c:5:1: error: invalid digit "9" in octal constant
    5 | 01203291
      | ^~~~~~~~
main.c:6:1: error: invalid digit "8" in octal constant
    6 | 02382022
      | ^~~~~~~~
Language: C

#include <stdio.h>

int main(void){
	int n,m,i,o;
	while(1){
	scanf("%d %d",&n,&m);
	if(!n)break;
	int score[];
	char atari[100][9],a[1000][9];
	for(i=0;i<n;i++){
		scanf("%s %d",atari[i],score[i]);
	}
	for(o=0;o<m;o++){
		scanf("%s",a[o]);
	}
	int ans=0;
	int j,k;
	for(i=0;i<n;i++){
		for(j=0;j<m;j++){
			for(k=7;atari[i][k]!='*';k--){
				if(atari[i][k]!=a[j][k]){
					break;
				}
			}
			if(atari[i][k]=='*'){
				ans+=score[i];
				break;
			}
		}
	}
		printf("%d\n",ans);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:13: error: array size missing in 'score'
    8 |         int score[];
      |             ^~~~~
Language: C++

#include<iostream>
#include<cstdio>

using namespace std;

int n,m;
char tosenB[100][10];
int tosenK[100];
char myB[1000][10];

bool mystrcmp(char s1[],char s2[]){
  int len1=strlen(s1);
  int len2=strlen(s2);
  if(len1 != len2){
    return false;
  }else{
    for(int i=0;i<len1;i++){
      if(s1[i]!=s2[i] && s1[i]!='*' && s2[i]!='*'){
	return false;
      }
    }
  }
  return true;
}
int main(){
  cin>>n>>m;
  int ans;
  while(n!=0){
    ans=0;
    for(int i=0;i<n;i++)
      cin>>tosenB[i]>>tosenK[i];
    for(int i=0;i<m;i++)
      cin>>myB[i];
    for(int i=0;i<m;i++){
      for(int j=0;j<n;j++){
	if(mystrcmp(myB[i],tosenB[j])){
	  ans+=tosenK[j];
	  break;
	}
      }
    }
    cout<<ans<<endl;
    cin>>n>>m;

  }

  return 0;
}

Compiler output:
a.cc: In function 'bool mystrcmp(char*, char*)':
a.cc:12:12: error: 'strlen' was not declared in this scope
   12 |   int len1=strlen(s1);
      |            ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<cstdio>
  +++ |+#include <cstring>
    3 |
Language: C++

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

main(){
  vector<pair<int,pair<string,int> > >v;
  int i=0,j,n,m,k;
  string s;
loop:
  if(cin>>n>>m,!n)return;
  for(;i<n;i++){
    cin>>s>>k;
    for(j=0;s[j]=='*';j++);
    v.push_back(make_pair(k,make_pair(s,j)));
  }
  for(k=0;m;m--){
    cin>>s;
    for(i=0;i<n;i++)
      if(s.substr(v[i].second.second)==v[i].second.first.substr(v[i].second.second))k+=v[i].first;
  }
  cout<<k<<endl;
goto loop;
}

Compiler output:
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:11:19: error: return-statement with no value, in function returning 'int' [-fpermissive]
   11 |   if(cin>>n>>m,!n)return;
      |                   ^~~~~~
Language: C++

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

class Point{
public:
  int n[8],g;
  bool operator < (const Point &p) const{ return g > p.g;}
};

int main(){
  int i,j,n,m,b[8],ans;
  Point p[100];
  string str;
  while(1){
    cin >> n >> m;
    if(n == 0 && !m) break;

    for(i=0;i<n;i++){
      cin >> str;
      for(j=0;j<str.size();j++){
	if(str[j] == '*') p[i].n[j] = -1;
	else p[i].n[j] = str[j] - '0';
      }
      cin >> p[i].g;
    }

    sort(p,p+n);
    ans = 0;

    for(i=0;i<m;i++){
      cin >> str;
      for(j=0;j<8;j++) b[j] = str[j] - '0';

      for(int k=0;k<n;k++){
	for(j=0;j<8;j++){
	  if(p[k].n[j] != -1 && p[k].n[j] != b[j]) break;
	}
	if(j == 8){
	  ans += p[k].g;
	  break;
	}
      }
    }

    cout << ans << endl;

  }
  return 0;
}

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

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

class Point{
public:
  int n[8],g;
  Point(int g = 0):g(g){}
  bool operator < (const Point &p) const{ return g > p.g;}
};

int main(){
  int i,j,n,m,b[8],ans;
  Point p[100];
  string str;
  while(1){
    cin >> n >> m;
    if(n == 0 && !m) break;

    for(i=0;i<n;i++){
      cin >> str;
      for(j=0;j<str.size();j++){
	if(str[j] == '*') p[i].n[j] = -1;
	else p[i].n[j] = str[j] - '0';
      }
      cin >> p[i].g;
    }

    sort(p,p+n);
    ans = 0;

    for(i=0;i<m;i++){
      cin >> str;
      for(j=0;j<8;j++) b[j] = str[j] - '0';

      for(int k=0;k<n;k++){
	for(j=0;j<8;j++){
	  if(p[k].n[j] != -1 && p[k].n[j] != b[j]) break;
	}
	if(j == 8){
	  ans += p[k].g;
	  break;
	}
      }
    }

    cout << ans << endl;

  }
  return 0;
}

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

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <queue>
#include <set>
#include <map>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
const int INF = 1<<29;

int main() {
  int n,m;
  while(cin>>n>>m, n||m) {
    string s[n];
    int a[n];

    REP(i,n) {
      cin >> s[i] >> a[i];
    }
    int res = 0;
    REP(i,m) {
      string b;
      cin >> b;
      REP(k, n) {
        bool f = 1;
        REP(j, 8) {
          if (s[k][j] != '*' && s[k][j] != b[j]){
            f = 0;
            break;
          }
        }
        if (f) {h
          res += a[k];
        }
      }
    }
    cout << res << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:17: error: 'h' was not declared in this scope
   41 |         if (f) {h
      |                 ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <vector>
#include <set>

using namespace std;
typedef long long LL;
static const double EPS = 1e-9;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
bool check1[14][8];
int check2[14][8];
int block[14][8];
void GetBlock(){
  memset(block,0,sizeof(block));
  for(int i=1; i<=12; i++){
    for(int j=1; j<=6; j++){
      block[i][j] = getchar();
    }
    getchar();
  }
}
void Makecheck2(int x, int y){
  REP(k,4){
    if(check2[x+dx[k]][y+dy[k]]==false&&
        block[x][y]==block[x+dx[k]][y+dy[k]]){
      check1[x+dx[k]][y+dy[k]] = true;
      check2[x+dx[k]][y+dy[k]] = true;
      Makecheck2(x+dx[k], y+dy[k]);
    }
    if(check2[x+dx[k]][y+dy[k]]==false&&block[x+dx[k]][y+dy[k]]=='O')
      check2[x+dx[k]][y+dy[k]] = 100;
  }
}
int CheckNum(int x, int y){
  int count = 0;
  memset(check2,0,sizeof(check2));
  check2[x][y] = true;
  Makecheck2(x,y);
  FOR(i,1,13)
    FOR(j,1,7)
      if(check2[i][j]==true) count++;
  return count;
}
void Break(){
  FOR(i,1,13)
    FOR(j,1,7)
      if(check2[i][j] == true || check2[i][j] == 100)
        block[i][j] = '.';
}

bool CheckIsR(){
  bool flag2 = false;
  FOR(i,1,13)
    FOR(j,1,7)
      if(check1[i][j]==false){
        if(block[i][j]!='.'&&block[i][j]!='O'){
          check1[i][j] = true;
          if(CheckNum(i,j)>=4){
            flag2 = true;
            Break();
          }
        }else{
          check1[i][j] = true;
        }
      }
  return flag2;
}
bool Down(){
  bool flag3;
  do{
    flag3 = false;
    FOR(i,1,13)
      FOR(j,1,7)
        if(block[i][j] != '.' && block[i+1][j] == '.'){
          swap(block[i][j],block[i+1][j]);
          flag3 = true;
        }
  }while(flag3);
}

int main(void){  
  GetBlock();
  int count=0;
  while(true){
    memset(check1,0,sizeof(check1));
    if(CheckIsR()) count++;
    else break;
    Down();
  }
  cout << count << endl;
  return 0;
}

Compiler output:
a.cc: In function 'void GetBlock()':
a.cc:20:3: error: 'memset' was not declared in this scope
   20 |   memset(block,0,sizeof(block));
      |   ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <set>
  +++ |+#include <cstring>
    7 | 
a.cc: In function 'int CheckNum(int, int)':
a.cc:42:3: error: 'memset' was not declared in this scope
   42 |   memset(check2,0,sizeof(check2));
      |   ^~~~~~
a.cc:42:3: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc: In function 'bool Down()':
a.cc:85:1: warning: no return statement in function returning non-void [-Wreturn-type]
   85 | }
      | ^
a.cc: In function 'int main()':
a.cc:91:5: error: 'memset' was not declared in this scope
   91 |     memset(check1,0,sizeof(check1));
      |     ^~~~~~
a.cc:91:5: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

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

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

char board[12][6];
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

void print() {
  int i,j;
  rep(i,12) {
    rep(j,6)
      cout<<board[i][j];
    cout<<endl;
  }
}

bool isok(int x,int y) {
  return (x >= 0 && x < 6 && y >= 0 && y < 12);
}

bool erase() {
  bool isb[12][6];
  int i,j,k,l;
  bool update = false;
  memset(isb, false, sizeof(isb));
  rep(i,12) {
    rep(j,6) {
      if(isb[i][j]) continue;
      isb[i][j] = true;
      if(board[i][j] == '.' || board[i][j] == 'O') continue;

      queue<pair<int,int> > Q;
      vector<pair<int,int> > vv;
      Q.push(make_pair(i,j)); vv.push_back(make_pair(i,j));
      while(!Q.empty()) {
	pair<int,int> p = Q.front(); Q.pop();
	int x = p.second,y = p.first;
	rep(k,4) {
	  if(isok(x+dx[k],y+dy[k]))
	    if(board[y+dy[k]][x+dx[k]] == board[y][x] && !isb[y+dy[k]][x+dx[k]]) {
	      Q.push(make_pair(y+dy[k],x+dx[k]));
	      isb[y+dy[k]][x+dx[k]] = true;
	      vv.push_back(make_pair(y+dy[k],x+dx[k]));
	    }
	}
      }

      if(vv.size() >= 4) {
	update = true;
	rep(k,vv.size()) {
	  int x = vv[k].second,y = vv[k].first;
	  rep(l,4) {
	    if(isok(x+dx[l],y+dy[l]))
	      if(board[y+dy[l]][x+dx[l]] == 'O')
		board[y+dy[l]][x+dx[l]] = '.';
	  }
	  board[vv[k].first][vv[k].second] = '.';
	}
      }
    }
  }

  return update;
}

void drop() {
  int i,j,k;
  for(i=11; i>=0; --i) {
    rep(j,6) {
      if(board[i][j] == '.') {
	k = i;
	while(k >= 0) {
	  if(!(board[k][j] == '.')) {
	    board[i][j] = board[k][j];
	    board[k][j] = '.';
	    break;
	  }
	  k--;
	}
      }
    }
  }
}

int solve() {
  bool update = false;
  int t = 0;
  while(true) {
    update = erase();
    if(!update) return t;
    t++;
    drop();
  }
}

void input() {
  int i,j;
  string s;
  rep(i,12) {
    cin>>s;
    rep(j,6)
      board[i][j] = s.at(j);
  }
  return;
}

int main() {
  int t;
  cin>>t;
  while(t--) {
    memset(board,0,sizeof(board));
    memset(tmpb, 0, sizeof(tmpb));
    input();
    cout<<solve()<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:119:12: error: 'tmpb' was not declared in this scope; did you mean 'tm'?
  119 |     memset(tmpb, 0, sizeof(tmpb));
      |            ^~~~
      |            tm
Language: C++

#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <string>
#include <map>
#include <cctype>
using namespace std;

string area[12];
bool used[12][6];
int dx[] = {
	1, 0, -1, 0
};
int dy[] = {
	0, -1, 0, 1
};

int count(int i, int j, char c){
	int counter = 1;
	used[i][j] = true;
	for(int k = 0; k < 4; k++){
		if(i+dy[k] >= 0 && i+dy[k] < 12 && j+dx[k] >= 0 && j+dx[k] < 6 
			&& area[i+dy[k]][j+dx[k]] == c && !used[i+dy[k]][j+dx[k]]){
			counter += count(i+dy[k], j+dx[k], c);
		}
	}
	return counter;
}

void rem(int i, int j, char c){
	area[i][j] = '.';
	for(int k = 0; k < 4; k++){
		int y2 = i+dy[k], x2 = j+dx[k];
		if(y2 >= 0 && y2 < 12 && x2 >= 0 && x2 < 6 && area[y2][x2] == c) rem(y2, x2, c);
	}
}

bool puyo_delete(){
	bool f = false;
	for(int i = 0; i < 12; i++){
		for(int j = 0; j < 6; j++){
			if(area[i][j] != '.'){
				memset(used, false, sizeof(used));
				if(count(i, j, area[i][j]) >= 4){
					rem(i, j, area[i][j]);
					f = true;
				}
			}
		}
	}
	return f;
}

void puyo_drop(){
	bool f = true;
	while(f){
		f = false;
		for(int i = 0; i < 11; i++){
			for(int j = 0; j < 6; j++){
				if(area[i][j] != '.' && area[i+1][j] == '.'){
					area[i+1][j] = area[i][j];
					area[i][j] = '.';
					f = true;
				}
			}
		}
	}
}

int main(){
	int n;
	cin >> n;
	for(int i = 0; i < n; i++){
		for(int j = 0; j < 12; j++){
			cin >> area[j];
		}
		int count = 0;
		bool update = true;
		while(update){
			update = false;
			update = puyo_delete();
			puyo_drop();
			if(update) count++;
		}
		cout << count << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'bool puyo_delete()':
a.cc:44:33: error: 'memset' was not declared in this scope
   44 |                                 memset(used, false, sizeof(used));
      |                                 ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include <cctype>
  +++ |+#include <cstring>
    8 | using namespace std;
Language: C++

#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <string>
#include <map>
#include <cctype>
using namespace std;

string area[12];
bool used[12][6];
int dx[] = {
	1, 0, -1, 0
};
int dy[] = {
	0, -1, 0, 1
};

int count(int i, int j, char c){
	int counter = 1;
	used[i][j] = true;
	for(int k = 0; k < 4; k++){
		if(i+dy[k] >= 0 && i+dy[k] < 12 && j+dx[k] >= 0 && j+dx[k] < 6 
			&& area[i+dy[k]][j+dx[k]] == c && !used[i+dy[k]][j+dx[k]]){
			counter += count(i+dy[k], j+dx[k], c);
		}
	}
	return counter;
}

void rem(int i, int j, char c){
	area[i][j] = '.';
	for(int k = 0; k < 4; k++){
		int y2 = i+dy[k], x2 = j+dx[k];
		if(y2 >= 0 && y2 < 12 && x2 >= 0 && x2 < 6){
			if(area[y2][x2] == c) rem(y2, x2, c);
			if(area[y2][x2] == 'O') area[y2][x2] = '.';
		}
	}
}

bool puyo_delete(){
	bool f = false;
	for(int i = 0; i < 12; i++){
		for(int j = 0; j < 6; j++){
			if(area[i][j] != '.' && area[i][j] != 'O'){
				memset(used, false, sizeof(used));
				if(count(i, j, area[i][j]) >= 4){
					rem(i, j, area[i][j]);
					f = true;
				}
			}
		}
	}
	return f;
}

void puyo_drop(){
	bool f = true;
	while(f){
		f = false;
		for(int i = 0; i < 11; i++){
			for(int j = 0; j < 6; j++){
				if(area[i][j] != '.' && area[i+1][j] == '.'){
					area[i+1][j] = area[i][j];
					area[i][j] = '.';
					f = true;
				}
			}
		}
	}
}

int main(){
	int n;
	cin >> n;
	for(int i = 0; i < n; i++){
		for(int j = 0; j < 12; j++){
			cin >> area[j];
		}
		int count = 0;
		bool update = true;
		while(update){
			update = false;
			update = puyo_delete();
			puyo_drop();
			if(update) count++;
		}
		cout << count << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'bool puyo_delete()':
a.cc:47:33: error: 'memset' was not declared in this scope
   47 |                                 memset(used, false, sizeof(used));
      |                                 ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include <cctype>
  +++ |+#include <cstring>
    8 | using namespace std;
Language: C++

#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <list>
#include <string>
#include <map>
#include <cctype>
using namespace std;

string area[12];
bool used[12][6];

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

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

int count(int i, int j, char c){
	int counter = 1;
/*	used[i][j] = true;
	for(int k = 0; k < 4; k++){
		int y = i+dy[k], x = j+dx[k];
		if(y >= 0 && y < 12 && x >= 0 && x < 6 
			&& area[y][x] == c && !used[y][x]){
			counter += count(y, x, c);
		}
	*/}
	return counter;
}

void rem(int i, int j, char c){
	area[i][j] = '.';
	for(int k = 0; k < 4; k++){
		int y2 = i+dy[k], x2 = j+dx[k];
		if(y2 >= 0 && y2 < 12 && x2 >= 0 && x2 < 6){
			if(area[y2][x2] == c) rem(y2, x2, c);
			if(area[y2][x2] == 'O') area[y2][x2] = '.';
		}
	}
}

bool puyo_delete(){
	bool f = false;
	for(int i = 0; i < 12; i++){
		for(int j = 0; j < 6; j++){
			if(area[i][j] != '.' && area[i][j] != 'O'){
				for(int k = 0; k < 12; k++){
					for(int l = 0; l < 6; l++){
						used[k][l] = false;
					}
				}
				if(count(i, j, area[i][j]) >= 4){
					rem(i, j, area[i][j]);
					f = true;
				}
			}
		}
	}
	return f;
}

void puyo_drop(){
	bool f = true;
	while(f){
		f = false;
		for(int i = 0; i < 11; i++){
			for(int j = 0; j < 6; j++){
				if(area[i][j] != '.' && area[i+1][j] == '.'){
					area[i+1][j] = area[i][j];
					area[i][j] = '.';
					f = true;
				}
			}
		}
	}
}

int main(){
	int n;
	cin >> n;
	for(int i = 0; i < n; i++){
		for(int j = 0; j < 12; j++){
			cin >> area[j];
		}
		int count = 0;
		bool update = true;
		while(update){
			update = puyo_delete();
			puyo_drop();
			if(update) count++;
		}
		cout << count << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int count(int, int, char)':
a.cc:33:11: warning: no return statement in function returning non-void [-Wreturn-type]
   33 |         */}
      |           ^
a.cc: At global scope:
a.cc:34:9: error: expected unqualified-id before 'return'
   34 |         return counter;
      |         ^~~~~~
a.cc:35:1: error: expected declaration before '}' token
   35 | }
      | ^
Language: C++

#define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
 
using namespace std;
 
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P > PP;
 
int tx[] = {0,1,0,-1};
int ty[] = {-1,0,1,0};
 
static const double EPS = 1e-8;
 
bool markBlock(bool toErase[12][6],char stage[12][6]){
 
  bool res = false;
  for(int y=0;y<12;y++){
    for(int x=0;x<6;x++){
      if(stage[y][x] == '.'
	 || stage[y][x] == 'O') continue;
 
      if(!toErase[y][x]){
	char color = stage[y][x];
	int count = 0;
	bool tmp[12][6];
	memcpy(tmp,toErase,sizeof(bool)*12*6);
 
	dfs(x,y,stage,toErase,color,&count);
	if(count < 4){
	  memcpy(toErase,tmp,sizeof(bool)*12*6);
	}
	else{
	  res = true;
	}
      }
    }
  }
 
  return res;
}
 
void eraseBlock(bool toErase[12][6],char stage[12][6]){
  for(int x=0;x<6;x++){
    for(int y=0;y<12;y++){
      if(stage[y][x] == '.'){
	toErase[y][x] = true;
	continue;
      }
      if(stage[y][x] == 'O'){
	for(int i=0;i<4;i++){
	  int dx = x + tx[i];
	  int dy = y + ty[i];
	  if(dx < 0 || dx >= 6 
	     || dy < 0 || dy >= 12) continue;
	  if(toErase[dy][dx] == true
                        && stage[dy][dx] != '.'
	     && stage[dy][dx] != 'O'){
	    toErase[y][x] = true;
	  }
	}
      }
    }
  }
 
  char nextStage[12][6];
  for(int x=0;x<6;x++){
    queue<char> que; 
    for(int y=12-1;y>=0;y--){
      if(!toErase[y][x]){
	que.push(stage[y][x]);
      }
    }
 
    int idx = 12-1;
    while(!que.empty()){
      nextStage[idx][x] = que.front();
      que.pop();
      idx--;
    }
    while(idx >= 0){
      nextStage[idx][x] = '.';
      idx--;
    }
  }
 
  memcpy(stage,nextStage,sizeof(char)*12*6);
}
 
void printStage(char stage[12][6]){
  for(int y=0;y<12;y++){
    for(int x=0;x<6;x++){
      printf("%c",stage[y][x]);
    }
    printf("\n");
  }
  printf("\n");
}
 
int main(){
  int n;
 
  while(~scanf("%d",&n)){
    for(int i=0;i<n;i++){
      char stage[12][6];
      bool toErase[12][6];
      memset(toErase,0,sizeof(toErase));
 
      for(int y=0;y<12;y++){
	string str;
	cin >> str;
	for(int x=0;x<6;x++){
	  stage[y][x] = str[x];
	}
      }
 
      //printStage(stage);
      int res = 0;
      while(markBlock(toErase,stage)){
	eraseBlock(toErase,stage);
	memset(toErase,0,sizeof(toErase));
	res++;
	//printStage(stage);
      }
      printf("%d\n",res);
    }
  }
}

Compiler output:
a.cc: In function 'bool markBlock(bool (*)[6], char (*)[6])':
a.cc:47:9: error: 'dfs' was not declared in this scope; did you mean 'ffs'?
   47 |         dfs(x,y,stage,toErase,color,&count);
      |         ^~~
      |         ffs
Language: Java

3
1 km = 10^3 m
1 m = 10^2 cm
1 km = 10^5 cm
7
1 kilometre = 10^3 metre
1 megametre = 10^3 kilometre
1 metre = 10^-6 megametre
1 terametre = 10^3 gigametre
1 petametre = 10^3 terametre
1 gigametre = 10^-6 petametre
1 metre = 10^-15 petametre
4
1 a = 10^2 b
1 a = 10^3 c
1 b = 10^2 c
1 c = 10^1 d
4
1 acm = 10^2 icpc
1 icpc = 10^3 utpc
1 utpc = 10^4 topcoder
1 topcoder = 10^-1 acm
0

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
3
^
1 error
Language: C++

 REP(i,count){
      vector<string>::iterator 
        it1 = find(tani.begin(),tani.end(),date2[i][0]), 
        it2 = find(tani.begin(),tani.end(),date2[i][1]);
      bool f1 = (it1 != tani.end());
      bool f2 = (it2 != tani.end());
      int ind1 = ind[distance(tani.begin(),it1)];
      int ind2 = ind[distance(tani.begin(),it2)];
      if(f1&&f2&&ind2-ind1!=date[i])
        flag = false;
      else if(f1&&!f2){
        ind.push_back(ind1 + date[i]);
        tani.push_back(date2[i][1]);
        cccc--;
      }else if(!f1&&f2){
        ind.push_back(ind2 - date[i]);
        tani.push_back(date2[i][0]);
        cccc--;
      }
    }
    }
    if(flag) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
  return 0;
}

Compiler output:
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
    1 |  REP(i,count){
      |     ^
a.cc:21:5: error: expected declaration before '}' token
   21 |     }
      |     ^
a.cc:22:5: error: expected unqualified-id before 'if'
   22 |     if(flag) cout << "Yes" << endl;
      |     ^~
a.cc:23:5: error: expected unqualified-id before 'else'
   23 |     else cout << "No" << endl;
      |     ^~~~
a.cc:24:3: error: expected declaration before '}' token
   24 |   }
      |   ^
a.cc:25:3: error: expected unqualified-id before 'return'
   25 |   return 0;
      |   ^~~~~~
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

struct E{int from,to,cost;};

int N,n,d[200];
char c;
string s,s2;
E e[200];

int main(){
	while(cin>>N){
		if(!N)return 0;
		set<string> sts;
		map<string,int> tab;
		for(int i=0;i<N;i++){
			cin>>n>>s>>c>>n>>c>>n>>s2;
			if(sts.find(s)==sts.end()){
				tab[s]=sts.size();
				sts.insert(s);
			}
			if(sts.find(s2)==sts.end()){
				tab[s2]=sts.size();
				sts.insert(s2);
			}
			e[i*2].from=tab[s];
			e[i*2].to=tab[s2];
			e[i*2].cost=n;
			e[i*2+1].from=tab[s2];
			e[i*2+1].to=tab[s];
			e[i*2+1].cost=-1*n;
		}
		memset(d,0,sizeof(d));
		bool f=0;
		for(int i=0;i<sts.size();i++){
			for(int j=0;j<2*N;j++){
				if(d[e[j].to]>d[e[j].from]+e[j].cost){
					d[e[j].to]=d[e[j].from]+e[j].cost;
					if(i==sts.size()-1){f=1;break;}
				}
			}
		}
		if(f)cout<<"No"<<endl;
		else cout<<"Yes"<<endl;
	}
}

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

#include<iostream>
#include<cmath>
#include<map>
#include<vector>
#include<cstdlib>
#include<sstream>
#include<set>
#include<cstdio>
#include<cassert>
#define F first
#define S second
#define inf (1<<28)
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
using namespace std;

struct P
{
  string unit;
  int mpower;
  int upower;
  P(string unit="$",int upower=-inf,int mpower=-inf):unit(unit),upower(upower),mpower(mpower){}
};
vector<vector<P> > G(110);
map<string,int> exist;

int toPower(string s)
{
  if(s == "1")return 0;
  int pos = 0;
  rep(i,s.size())
    {
      if(s[i] == '^')
	{
	  pos = i+1;
	  break;
	}
    }
  return (atoi)(s.substr(pos,s.size()-pos).c_str());
}

bool used[110];
int isok;//-1 -> No, 0 => Not yet, 1 -> Ok

void dfs(string now,string target,int power,int target_power)
{
  if(isok != 0)return;
  if(now == target)
    {
      isok = (power == target_power?1:-1);
      return;
    }
  int index = exist[now];
  if(used[index])return;
  used[index] = true;

  rep(i,G[index].size())
    {
      P p = G[index][i];
      int next_index = exist[p.unit];
      if(used[next_index])continue;
      dfs(p.unit,target,power+(p.mpower==0?p.upower:-p.mpower),target_power );
    }
}

bool check(string u1,string u2,int power)
{
  rep(i,110)used[i] = false;
  isok = 0;

  dfs(u1,u2,0,power);
  return isok == 1;
}

bool reachable;

void move(int now,int target)
{
  if(now == target)
    {
      reachable = true;
      return;
    }

  if(used[now])return;
  used[now] = true;
  rep(i,G[now].size())
    {
      //assert(exist.count(G[now][i].unit));

      move(exist[G[now][i].unit],target);
    }

}

int main()
{
  int N;
  while(cin >> N , N)
    {
      rep(i,N)G[i].clear();
      int index = 0;
      exist.clear();
      bool result = true;
      rep(i,N)
	{
	  string v1,unit1,v2,unit2,eq;
	  cin >> v1 >> unit1 >> eq >> v2 >> unit2;

	  assert(unit1 != unit2);
	  if(!retult)continue;
	  //cout << toPower(v1) << " " << unit1 << " = "<< toPower(v2) << " " << unit2 << endl;
	  if(exist.count(unit1) && exist.count(unit2))
	    {
	      rep(i,N)used[i] = false;
	      reachable = false;
	      move(exist[unit1],exist[unit2]);
	      if(reachable)
		{
		  int p1 = toPower(v1);
		  int p2 = toPower(v2);
		  result = check(unit1,unit2,p2);
		  //cout << "result = " << result << endl;
		}
	      continue;
	    }

	  //cout << "not exists" << endl;
	  if(!exist.count(unit1))exist[unit1] = index++;
	  if(!exist.count(unit2))exist[unit2] = index++;
	  int index1 = exist[unit1];
	  int index2 = exist[unit2];
	  G[index1].push_back(P(unit2,toPower(v2),toPower(v1)));
	  G[index2].push_back(P(unit1,toPower(v1),toPower(v2)));
	}
      cout << (result?"Yes":"No") << endl;
    }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:111:15: error: 'retult' was not declared in this scope; did you mean 'result'?
  111 |           if(!retult)continue;
      |               ^~~~~~
      |               result
Language: C++

// UTPC2010 E. ツトツーツマツスツ・ツδ可イツトツづ個憂ツ鬱

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

using namespace std;

int main(){
	int n;
	int a[10000], b[10000];
	int p[10000];
	while(cin >> n, n){
		for(int i=0;i<n;i++) cin >> a[i];
		for(int i=0;i<n;i++) cin >> b[i];
		sort(a, a+n);
		sort(b, b+n);
		memset(p, 0, sizeof(p));
		for(int i=0;i<n;i++){
			if(a[i]==0) continue;
			p[n-a[i]]++;
		}
		bool ok = true;
		int sum = 0;
		for(int i=0;i<n;i++){
			sum += p[i];
			if(sum != b[i]) ok = false;
		}
		cout << (ok ? "Yes" : "No") << endl;
	}
}

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

#include <iostream>
using namespace std;

int main()
{
	const int nmax = 100;
	int as[nmax + 1];
	int N, P;
	while(cin >> N >> P){
		if(N == 0 && P == 0) break;
		int count = 0;

		for(int i = 0; i <= N; i++){
			cin >> as[i];
		}
		int t = as[N];
		for(int z = 0; z < 2; z++){
			for(int j = N; j > 0; j--)
				t = (t * z + as[j - 1]) % P;
			if(!t) count++;
		}
		int t = as[N];
		for(int z = 2; z < P; z++){
			if(as[0] % z != 0)
				for(int k = N; k > 0; k--)
					t = (t * z + as[k - 1]) % P;
			if(!t) count++;
		}
		cout << count << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:21: error: redeclaration of 'int t'
   22 |                 int t = as[N];
      |                     ^
a.cc:16:21: note: 'int t' previously declared here
   16 |                 int t = as[N];
      |                     ^
Language: C++

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

const int MOD = 1000000007;
const int MAX_FACT = 200000;
const int MAX_DP = 100000;

inline int mod_mul(int x, int y)
{
  return 1LL * x * y % MOD;
}

inline int mod_add(int x, int y)
{
  return (x + y) % MOD;
}

inline int mod_sub(int x, int y)
{
  return (x - y) % MOD;
}

int extgcd(int a, int b, int &x, int &y)
{
  int d = a;
  if (b)
  {
    d = extgcd(b, a % b, y, x);
    y -= (a / b) * x;
  }
  else
  {
    x = 1, y = 0;
  }
  return d;
}

int mod_inv(int a)
{
  int x, y;
  extgcd(a, MOD, x, y);
  return (MOD + x % MOD) % MOD;
}

struct Warp
{
  int sx, sy, tx, ty;
  bool operator<(const Warp &other) const
  {
    return sx != other.sx ? sx < other.sx : sy < other.sy;
  }
};

int fact[MAX_FACT + 1];
inline void init_fact()
{
  fact[0] = 1;
  for (int i = 0; i < MAX_FACT; i++)
    fact[i + 1] = mod_mul(fact[i], i + 1);
}

inline int nck(int n, int k)
{
  return mod_mul(mod_mul(fact[n], mod_inv(fact[n - k])), mod_inv(fact[k]));
}

inline int calc(int sx, int sy, int tx, int ty)
{
  if (tx < sx or ty < sy)
    return 0;
  return nck(tx - sx + ty - sy, tx - sx);
}

int dp[MAX_DP + 1];

// input
int N, M, K;
vector< Warp > warps;

void solve()
{
  memset(dp, 0, sizeof dp);
  sort(warps.begin(), warps.end());
  warps.push_back((Warp){N, M, N + 1, M + 1});

  for (int i = 0; i <= K; i++)
  {
    dp[i] = nck(warps[i].sx + warps[i].sy, warps[i].sy);
    for (int j = 0; j < i; j++)
    {
      int ct = calc(warps[j].tx, warps[j].ty, warps[i].sx, warps[i].sy);
      int cs = calc(warps[j].sx, warps[j].sy, warps[i].sx, warps[i].sy);
      dp[i] = mod_add(dp[i], mod_mul(dp[j], mod_sub(ct, cs)));
    }
  }

  printf("%d\n", dp[K]);
}

int main()
{
  init_fact();

  while (scanf("%d%d%d", &N, &M, &K) != EOF)
  {
    if (N == 0 and M == 0 and K == 0)
      break;

    N--, M--;

    warps.clear();

    for (int k = 0; k < K; k++)
    {
      int a, b, c, d;
      scanf("%d%d%d%d", &a, &b, &c, &d);

      warps.push_back((Warp){a - 1, b - 1, c - 1, d - 1});
    }

    solve();
  }
  return 0;
}



Compiler output:
a.cc: In function 'void solve()':
a.cc:84:3: error: 'memset' was not declared in this scope
   84 |   memset(dp, 0, sizeof dp);
      |   ^~~~~~
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 | using namespace std;
Language: C

#define _CRT_SECURE_NO_DEPRECATE
#include "stdafx.h"
#include <stdio.h>
int main(void){
	int a,b,c,d,e,f;
	while(scanf("%d%d",&a,&b) , a != 0){
		c = b - a;
		d = c % 500;
		e = (c % 1000 - d);
		f = c - d - e;
		printf("%d %d %d\n",d/100,e/500,f/1000);
	}
	return 0;
}

Compiler output:
main.c:2:10: fatal error: stdafx.h: No such file or directory
    2 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>

main(){
  int oturi[3]={1000,500,100};
  int ans[3];
  int a, b, i, temp, sa;

  while(1){
    scanf("%d %d", &a, &b);
    if(a==0 && b==0) break;

    sa=b-a;
    if(temp>=0){

    for(i=0;i<3;i++){
      ans[i]=0;
    }

    for(i=0;;i++){
      temp=sa-1000;
      if(temp>=0){
	ans[0]++;
	sa=temp;
      }
      else break;
    }

    for(i=0;;i++){
      temp=sa-500;
      if(temp>=0){
	ans[1]++;
	sa=temp;
      }
      else break;
    }

    for(i=0;;i++){
      temp=sa-100;
      if(temp>=0){
	ans[2]++;
	sa=temp;
      }
      else break;
    }

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

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:49:1: error: expected declaration or statement at end of input
   49 | }
      | ^
Language: C++

#include<iostream>

int main() {
  int A, B, n;
  int x, y, z;

  while(1) {
    cin >> A >> B;
    if(A == 0 && B == 0) break;

    n = B - A;
    if(n / 1000 > 0) {
      x = n / 1000;
      n = n % 1000;
    }   
    else
      x = 0;
    if(n / 500 > 0) {
      y = n / 500;
      n = n % 500;
    }
    else
      y = 0;
    if(n / 100 > 0) {
      z = n / 100;
      n = n % 100;
    }
    else
      z = 0;

    cout << x << ' ' << y << ' ' << z << endl;
  }

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |     cin >> A >> B;
      |     ^~~
      |     std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:31:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   31 |     cout << x << ' ' << y << ' ' << z << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:31:42: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   31 |     cout << x << ' ' << y << ' ' << z << endl;
      |                                          ^~~~
      |                                          std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~