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

		res += j * v[i];
		j *= 10;
	}

	return res;
}

int main(){
	int i;
	while(std::cin >> i, i >= 0){
		std::cout << Decimal4(i) << '\n';
	}
}

Compiler output:
a.cc:1:17: error: 'res' does not name a type
    1 |                 res += j * v[i];
      |                 ^~~
a.cc:2:17: error: 'j' does not name a type
    2 |                 j *= 10;
      |                 ^
a.cc:3:9: error: expected declaration before '}' token
    3 |         }
      |         ^
a.cc:5:9: error: expected unqualified-id before 'return'
    5 |         return res;
      |         ^~~~~~
a.cc:6:1: error: expected declaration before '}' token
    6 | }
      | ^
a.cc: In function 'int main()':
a.cc:10:20: error: 'cin' is not a member of 'std'
   10 |         while(std::cin >> i, i >= 0){
      |                    ^~~
a.cc:1:8: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 |                 res += j * v[i];
a.cc:11:22: error: 'cout' is not a member of 'std'
   11 |                 std::cout << Decimal4(i) << '\n';
      |                      ^~~~
a.cc:11:22: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:30: error: 'Decimal4' was not declared in this scope
   11 |                 std::cout << Decimal4(i) << '\n';
      |                              ^~~~~~~~
Language: C++

#include <iostream>
#include <cstdlib>
using namespace std;
int main(){
	int n;
	while(cin >> n){
		if(n==-1)break;
		char s[20];
		itoa(n,s,4);
		cout << s << "\n";
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: 'itoa' was not declared in this scope
    9 |                 itoa(n,s,4);
      |                 ^~~~
Language: C++

#include <iostream>
#include <stdlib.h>
using namespace std;
int main(){
	int n;
	while(cin >> n){
		if(n==-1)break;
		char s[20];
		itoa(n,s,4);
		cout << s << "\n";
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: 'itoa' was not declared in this scope
    9 |                 itoa(n,s,4);
      |                 ^~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<string>

using namespace std;

int main(void){
	while(1){
		int n;
		string str;
		scanf("%d",&n);
		if(n==-1)break;
		if(n==0)cout << "0" << endl;
		else{
			while(n>0){
				str+=n%4+'0';
				n=n/4;
			}
			reverse(str.begin(),str.end());
			cout << str << endl;
		}
	}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: error: 'reverse' was not declared in this scope
   19 |                         reverse(str.begin(),str.end());
      |                         ^~~~~~~
Language: C++

#include <stdio.h>

int main(void)
{
int a[100];
int n;
int index;

while (1){
scanf("%d", &n);
if (n == -1) break;
index = 0;
do {
a[index++] = (n & 0x3);
n =>> 2;
} while (n != 0);

index--;
while (index >= 0){
printf("%d", a[index--]);
}

puts("");
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:4: error: expected primary-expression before '>>' token
   15 | n =>> 2;
      |    ^~
Language: C++

#include <iostream>
using namespace std;

int main(){
  int n;
  string str;

  while(cin >> n , n != -1){
    str = "";
    if(!n) cout << '0' << endl;
    else{
      while(n){
	str += n % 4 + '0';
	n /= 4;
      }
      reverse(str.begin(),str.end());
      cout << str << endl;
    }
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:7: error: 'reverse' was not declared in this scope
   16 |       reverse(str.begin(),str.end());
      |       ^~~~~~~
Language: C++

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

int main(){
  int n;
  string str;

  while(cin >> n , n != -1){
    str = "";
    if(!n) cout << '0' << endl;
    else{
      while(n){
	str += n % 4 + '0';
	n /= 4;
      }
      reverse(str.begin(),str.end());
      cout << str << endl;
    }
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:7: error: 'reverse' was not declared in this scope
   17 |       reverse(str.begin(),str.end());
      |       ^~~~~~~
Language: Java

import java.util.*;

public class Main {
    static double distance(double r,double g,double b){
        return Math.sqrt(r*r+g*g+b*b);
    }
   
   public static void main(String[] args) throws Exception {
       Scanner sc = new Scanner(System.in);
       String [] colors = {"000black","001blue","010lime","011aqua","100red","101fuchsia","110yellow","111white"};
       while(sc.hasNextLine()){
           String str = sc.nextLine();
           if(str.equals("0")) break;
           int r0 = Integer.parseInt(str.substring(1,3),16);
           int b0 = Integer.parseInt(str.substring(3,5),16);
           int g0 = Integer.parseInt(str.substring(5,7),16);
           
           String ans = "";
           double min = 450.0;
           
           for(String c:color){
               int r = (c.charAt(0)-'0')*255;
               int b = (c.charAt(1)-'0')*255;
               int g = (c.charAt(2)-'0')*255;
               
               double d = distance(r-r0,g-g0,b-b0);
               if(d<min){
                   min=d;
                   ans=c.substring(3);
               }
           }
           System.out.println(ans);
       }

   }
}


Compiler output:
Main.java:21: error: cannot find symbol
           for(String c:color){
                        ^
  symbol:   variable color
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main {
   public static void main(String[] args) throws Exception {
       String [] unit = {"","Man","Oku","Cho","Kei","Gai","Jo","Jou","Ko","Kan","Sei","Sai","Gok","Ggs","Asg","Nyt","Fks","Mts"};
       Scanner sc = new Scanner(System.in);
       while(sc.hasNextInt()){
           int m = sc.nextInt();
           int n = sc.nextInt();
           if(m==0 && n==0) break;
           BigInteger b = valueOf(Math.pow(m,n));
           
           String ans = "";
           for(int i=0;i<18;i++){
               String digit = remainder(b,10000);
               ans = digit.concat(unit[i]+ans);
               b = divide(b,10000);
           }
           System.out.println(ans);
       }
   }
}


Compiler output:
Main.java:11: error: cannot find symbol
           BigInteger b = valueOf(Math.pow(m,n));
           ^
  symbol:   class BigInteger
  location: class Main
Main.java:11: error: cannot find symbol
           BigInteger b = valueOf(Math.pow(m,n));
                          ^
  symbol:   method valueOf(double)
  location: class Main
2 errors
Language: Java

import java.util.*;
import java.math.BigInteger;

public class Main {
   public static void main(String[] args) throws Exception {
       String [] unit = {"","Man","Oku","Cho","Kei","Gai","Jo","Jou","Ko","Kan","Sei","Sai","Gok","Ggs","Asg","Nyt","Fks","Mts"};
       Scanner sc = new Scanner(System.in);
       while(sc.hasNextInt()){
           int m = sc.nextInt();
           int n = sc.nextInt();
           if(m==0 && n==0) break;
           BigInteger b = valueOf(Math.pow(m,n));
           
           String ans = "";
           for(int i=0;i<18;i++){
               String digit = remainder(b,10000);
               ans = digit.concat(unit[i]+ans);
               b = divide(b,10000);
           }
           System.out.println(ans);
       }
   }
}


Compiler output:
Main.java:12: error: cannot find symbol
           BigInteger b = valueOf(Math.pow(m,n));
                          ^
  symbol:   method valueOf(double)
  location: class Main
Main.java:16: error: cannot find symbol
               String digit = remainder(b,10000);
                              ^
  symbol:   method remainder(BigInteger,int)
  location: class Main
Main.java:18: error: cannot find symbol
               b = divide(b,10000);
                   ^
  symbol:   method divide(BigInteger,int)
  location: class Main
3 errors
Language: C

#define _CRT_SECURE_NO_WARNINGS
//#define _USE_MATH_DEFINES
#include<stdio.h>
//#include<stdlib.h>
#include<math.h>
//#include<string.h>
//#include<time.h>
#define P(type,x) fprintf(stdout,"%"#type"\n",x)
struct color {
	int r,
		g,
		b;
	char c[8];
};
//int c16toi10(char*);
int hex(char*);
int main() {
	struct color a[8]{
		{0x00,0x00,0x00,"black"},
		{0x00,0x00,0xff,"blue" },
		{0x00,0xff,0x00,"lime" },
		{0x00,0xff,0xff,"aqua"},
		{0xff,0x00,0x00,"red"},
		{0xff,0x00,0xff,"fuchsia"},
		{0xff,0xff,0x00,"yellow"},
		{0xff,0xff,0xff,"white"}
	};
	int i,r,g,b,d,t,n;
	char str[16];
	while (~fscanf(stdin, "%s", str), str[0] != '0') {
		r = hex(str + 1) * 16 + hex(str + 2);
		g = hex(str + 3) * 16 + hex(str + 4);
		b = hex(str + 5) * 16 + hex(str + 6);
		n = 1e8;
		for (i = 0; i < 8; i++) {
			d = sqrt(pow(r - a[i].r, 2) + pow(g - a[i].g, 2) + pow(b - a[i].b, 2));
			if (n > d)
				n = d, t = i;
		}
		P(s, a[t].c);
	}
	return 0;
}

//int c16toi10(char *n){
//	int ans=0;
//	int i, base = 1;
//	for (i = strlen(n)-1; i >= 0; --i) {
//		if (hex(n + i) == -1) return -1;
//		ans += hex(n+i)*base;
//		base *= 16;
//	}
//	return ans;
//}

int hex(char *s){
	if ('0' <= *s&&*s <= '9') return *s - '0';
	else if ('A' <= *s&&*s <= 'Z') return *s - 'A' + 10;
	else if ('a' <= *s&&*s <= 'z') return *s - 'a' + 10;
	return -1;
}

Compiler output:
main.c: In function 'main':
main.c:18:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   18 |         struct color a[8]{
      |                          ^
main.c:19:40: error: expected ';' before '}' token
   19 |                 {0x00,0x00,0x00,"black"},
      |                                        ^
      |                                        ;
main.c:19:41: error: expected expression before ',' token
   19 |                 {0x00,0x00,0x00,"black"},
      |                                         ^
main.c:36:42: error: 'a' undeclared (first use in this function)
   36 |                         d = sqrt(pow(r - a[i].r, 2) + pow(g - a[i].g, 2) + pow(b - a[i].b, 2));
      |                                          ^
main.c:36:42: note: each undeclared identifier is reported only once for each function it appears in
Language: C

import java.util.*;
import java.math.BigInteger;

public class Main {
   public static void main(String[] args) throws Exception {
       String [] unit = {"","Man","Oku","Cho","Kei","Gai","Jo","Jou","Ko","Kan","Sei","Sai","Gok","Ggs","Asg","Nyt","Fks","Mts"};
       Scanner sc = new Scanner(System.in);
       while(sc.hasNextInt()){
           int m = sc.nextInt();
           int n = sc.nextInt();
           if(m==0 && n==0) break;
           BigInteger b = valueOf(Math.pow(m,n));
           
           String ans = "";
           for(int i=0;i<18;i++){
               String digit = remainder(b,10000);
               ans = digit.concat(unit[i]+ans);
               b = divide(b,10000);
           }
           System.out.println(ans);
       }
   }
}


Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.*;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.*;
      |            ^
main.c:2:1: error: unknown type name 'import'
    2 | import java.math.BigInteger;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.math.BigInteger;
      |            ^
main.c:4:1: error: unknown type name 'public'
    4 | public class Main {
      | ^~~~~~
main.c:4:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    4 | public class Main {
      |              ^~~~
Language: C

#include <stdio.h>
#include <math.h>
#include <ctype.h>

int ss(char input);
int hen(int a,int b);
int main(){
    int i,henkan[7];
    char n[7];
    while(scanf("%s",n)){
        if(n[0]=='0')break;
        for(i=1;i<7;i++){
            if(isdigit(n[i])!=0){//数字ならば
                henkan[i]=n[i]-'0';
            }else{
                henkan[i]=ss(n[i]);
            }
        }
        int memo;
        double d,small=10000;
        int r=hen(henkan[1],henkan[2]),g=hen(henkan[3],henkan[4]),b=hen(henkan[5],henkan[6]);
        int kazu[8][3]={{0,0,0},
            {0,0,255},
            {0,255,0},
            {0,255,255},
            {255,0,0},
            {255,0,255},
            {255,255,0},
            {255,255,255}};
        for(i=0;i<8;i++){
            d=sqrt((r-kazu[i][0])*(r-kazu[i][0])+(g-kazu[i][1])*(g-kazu[i][1])+(b-kazu[i][2])*(b-kazu[i][2]));
            if(small>d){
                small=d;
                memo = i;
            }
        }
        switch (memo) {
            case 0:
                puts("black");
                break;
            case 1:
                puts("blue");
                break;
            case 2:
                puts("lime");
                break;
            case 3:
                puts("aqua");
                break;
            case 4:
                puts("red");
                break;
            case 5:
                puts("fuchsia");
                break;
            case 6:
                puts("yellow");
                break;
            case 7:
                puts("white");
                break;
        }
    }
    return 0;
}
int ss(char input){
    int al[6]={10,11,12,13,14,15};
    char seach[6]={'a','b','c','d','e','f'};
    for(int i=0;i<6;i++){
        if(input == seach[i]){
            return al[i];
        }
    }
    return 0;
}
int hen(int a,int b){
    int goukei=0;
    goukei+=a*16;
    goukei+=b;
    return goukei;
}

Compiler output:
/usr/bin/ld: /tmp/ccZuzhNv.o: in function `main':
main.c:(.text+0x2b7): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>
char a[8][8]={"black","blue","lime","aqua","red","fuchsia","yellow","white"},c;
int b[9][3]={{0,0,0},{0,0,255},{0,255,0},{0,255,255},{255,0,0},{255,0,255},{255,255,0},{255,255,255}};

int d(int x)
{
	int i,r=0;
	for(i=0;i<3;i++)
		r+=(b[8][i]-b[x][i])*(b[8][i]-b[x][i]);
	return r;
}

int main()
{
	int i,r;
	for(;~scanf("%c%2x%2x%2x\n",&c,&b[8][0],&b[8][1],&b[8][2]),c!='0';puts(a[r]))
	{
		for(i=r=0;i<8;i++)
			if(d(r)>d(i))
				r=i;
	}
　　　　　return 0;
}

Compiler output:
main.c: In function 'main':
main.c:22:1: error: stray '\343' in program
   22 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0;
      | ^~~~~~~~
main.c:22:3: error: stray '\343' in program
   22 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0;
      |         ^~~~~~~~
main.c:22:5: error: stray '\343' in program
   22 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0;
      |                 ^~~~~~~~
main.c:22:7: error: stray '\343' in program
   22 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0;
      |                         ^~~~~~~~
main.c:22:9: error: stray '\343' in program
   22 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0;
      |                                 ^~~~~~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
string S, x[2][2][2] = { {{"black","blue"}, {"lime","aqua"}}, { {"red","fuchsia"} {"yellow","white"} } };
char T[9] = "89abcdef";
int a, b, c;
int main() {
	while (true) {
		a = 0; b = 0; c = 0;
		cin >> S;
		if (S == "0") { break; }
		for (int i = 0; i < 8; i++){
			if (T[i] == S[1]) {
				a = 1;
			}
		}
		for (int i = 0; i < 8; i++) {
			if (T[i] == S[3]) {
				b = 1;
			}
		}
		for (int i = 0; i < 8; i++) {
			if (T[i] == S[5]) {
				c = 1;
			}
		}
		cout << x[a][b][c] << endl;
	}
}

Compiler output:
a.cc:4:83: error: expected '}' before '{' token
    4 | string S, x[2][2][2] = { {{"black","blue"}, {"lime","aqua"}}, { {"red","fuchsia"} {"yellow","white"} } };
      |                                                               ~                   ^
a.cc:4:83: error: expected '}' before '{' token
    4 | string S, x[2][2][2] = { {{"black","blue"}, {"lime","aqua"}}, { {"red","fuchsia"} {"yellow","white"} } };
      |                        ~                                                          ^
a.cc:4:83: error: expected ',' or ';' before '{' token
a.cc:4:102: error: expected declaration before '}' token
    4 | string S, x[2][2][2] = { {{"black","blue"}, {"lime","aqua"}}, { {"red","fuchsia"} {"yellow","white"} } };
      |                                                                                                      ^
a.cc:4:104: error: expected declaration before '}' token
    4 | string S, x[2][2][2] = { {{"black","blue"}, {"lime","aqua"}}, { {"red","fuchsia"} {"yellow","white"} } };
      |                                                                                                        ^
Language: C++

(function(input) {
  var lines = input.split("\n");
  var colors = [
    ['black', 0x00, 0x00, 0x00],
    ['blue', 0x00, 0x00, 0xff],
    ['lime', 0x00, 0xff, 0x00],
    ['aqua', 0x00, 0xff, 0xff],
    ['red', 0xff, 0x00, 0x00],
    ['fuchsia', 0xff, 0x00, 0xff],
    ['yellow', 0xff, 0xff, 0x00],
    ['white', 0xff, 0xff, 0xff],
  ];
  for (var i = 0; i < lines.length; ++i) {
    if (lines[i][0] === '#') {
      var best_color;
      var min_d = 3 * 256 * 256 + 1;
      var r = parseInt(lines[i].substr(1, 2), 16);
      var g = parseInt(lines[i].substr(3, 2), 16);
      var b = parseInt(lines[i].substr(5, 2), 16);
      for (var j = 0; j < colors.length; ++j) {
        var d = Math.pow(r - colors[j][1], 2) + Math.pow(g - colors[j][2], 2) + Math.pow(b - colors[j][3], 2);
        if (d < min_d) {
          min_d = d;
          best_color = colors[j][0];
        }
      }
      console.log(best_color);
    }
  }
})(require('fs').readFileSync('/dev/stdin', 'utf8').trim());

Compiler output:
a.cc:4:6: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
    4 |     ['black', 0x00, 0x00, 0x00],
      |      ^~~~~~~
a.cc:5:6: warning: multi-character character constant [-Wmultichar]
    5 |     ['blue', 0x00, 0x00, 0xff],
      |      ^~~~~~
a.cc:6:6: warning: multi-character character constant [-Wmultichar]
    6 |     ['lime', 0x00, 0xff, 0x00],
      |      ^~~~~~
a.cc:7:6: warning: multi-character character constant [-Wmultichar]
    7 |     ['aqua', 0x00, 0xff, 0xff],
      |      ^~~~~~
a.cc:8:6: warning: multi-character character constant [-Wmultichar]
    8 |     ['red', 0xff, 0x00, 0x00],
      |      ^~~~~
a.cc:9:6: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes
    9 |     ['fuchsia', 0xff, 0x00, 0xff],
      |      ^~~~~~~~~
a.cc:10:6: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
   10 |     ['yellow', 0xff, 0xff, 0x00],
      |      ^~~~~~~~
a.cc:11:6: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
   11 |     ['white', 0xff, 0xff, 0xff],
      |      ^~~~~~~
a.cc:30:12: warning: multi-character character constant [-Wmultichar]
   30 | })(require('fs').readFileSync('/dev/stdin', 'utf8').trim());
      |            ^~~~
a.cc:30:31: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
   30 | })(require('fs').readFileSync('/dev/stdin', 'utf8').trim());
      |                               ^~~~~~~~~~~~
a.cc:30:45: warning: multi-character character constant [-Wmultichar]
   30 | })(require('fs').readFileSync('/dev/stdin', 'utf8').trim());
      |                                             ^~~~~~
a.cc:1:10: error: expected ')' before '(' token
    1 | (function(input) {
      | ~        ^
      |          )
a.cc:30:2: error: expected unqualified-id before ')' token
   30 | })(require('fs').readFileSync('/dev/stdin', 'utf8').trim());
      |  ^
Language: C++

#define _USE_MATH_DEFINES
#define MAX_N 1000000
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>

using namespace std;

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

static const double eps = 1e-8;

struct COLOR{
	string name;
	string R;
	string G;
	string B;
};

int hex2dec(string str){
	const char hex[] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
	return 16 * (int)lower_bound(hex,hex+16,str[0]) + (int)lower_bound(hex,hex+16,str[1]);
}

int main(){

	struct COLOR color[] = {
		"black","00","00","00",
		"blue","00","00","ff",
		"lime","00","ff","00",
		"aqua","00","ff","ff",
		"red","ff","00","00",
		"fuchsia","ff","00","ff",
		"yellow","ff","ff","00",
		"white","ff","ff","ff",
	};

	string str;
	while(cin >> str){
		if(str.size() == 1 && str[0] == '0') break;
		int r = hex2dec(str.substr(1,2));
		int g = hex2dec(str.substr(3,2));
		int b = hex2dec(str.substr(5,2));

		int dk = 10000000;
		int idx=0;
		for(int i=0;i<sizeof(color)/sizeof(struct COLOR); i++){
			int tmp;
			if(dk > (tmp=((r - hex2dec(color[i].R)) * (r - hex2dec(color[i].R))
				+ (g - hex2dec(color[i].G)) * (g - hex2dec(color[i].G))
				+ (b - hex2dec(color[i].B)) * (b - hex2dec(color[i].B))))){
					dk = tmp;
					idx=i;
			}
		}

		printf("%s\n",color[idx].name.c_str());
	}

}

Compiler output:
a.cc: In function 'int hex2dec(std::string)':
a.cc:33:21: error: cast from 'const char*' to 'int' loses precision [-fpermissive]
   33 |         return 16 * (int)lower_bound(hex,hex+16,str[0]) + (int)lower_bound(hex,hex+16,str[1]);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:33:59: error: cast from 'const char*' to 'int' loses precision [-fpermissive]
   33 |         return 16 * (int)lower_bound(hex,hex+16,str[0]) + (int)lower_bound(hex,hex+16,str[1]);
      |                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<string>
#include<map>
using namespace std;
int main() {
	map <char, int>b;
	b.insert(map<char, int>::value_type('0', 0));
	b.insert(map<char, int>::value_type('1', 1));
	b.insert(map<char, int>::value_type('2', 2));
	b.insert(map<char, int>::value_type('3', 3));
	b.insert(map<char, int>::value_type('4', 4));
	b.insert(map<char, int>::value_type('5', 5));
	b.insert(map<char, int>::value_type('6', 6));
	b.insert(map<char, int>::value_type('7', 7));
	b.insert(map<char, int>::value_type('8', 8));
	b.insert(map<char, int>::value_type('9', 9));
	b.insert(map<char, int>::value_type('a', 10));
	b.insert(map<char, int>::value_type('b', 11));
	b.insert(map<char, int>::value_type('c', 12));
	b.insert(map<char, int>::value_type('d', 13));
	b.insert(map<char, int>::value_type('e', 14));
	b.insert(map<char, int>::value_type('f', 15));
	string d[8] = { "black","blue","lime","aqua","red","fuchsia","yellow","white" };
	int e[8][3] = { {0,0,0},{0,0,255},{0,255,0},{0,255,255},{255,0,0},{255,0,255}, {255,255,0},{255,255,255} };
	string a;
	while (cin >> a&&a != "0") {
		int sa = 10000, t[3];
		string iro;
		for (int i = 1; i < 7; i += 2) {
			char f = a[i], g = a[i + 1];
			t[(i - 1) / 2] = b[f]*16 + b[g];
		}
		for (int i = 7; i >= 0; i--) {
			int h = sqrt(pow((e[i][0] - t[0]), 2) + pow((e[i][1] - t[1]), 2) + pow((e[i][2] - t[2]), 2));
			if (h <= sa) {
				sa = h;
				iro = d[i];
			}
		}
		cout << iro << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:38: error: 'pow' was not declared in this scope
   34 |                         int h = sqrt(pow((e[i][0] - t[0]), 2) + pow((e[i][1] - t[1]), 2) + pow((e[i][2] - t[2]), 2));
      |                                      ^~~
a.cc:34:33: error: 'sqrt' was not declared in this scope
   34 |                         int h = sqrt(pow((e[i][0] - t[0]), 2) + pow((e[i][1] - t[1]), 2) + pow((e[i][2] - t[2]), 2));
      |                                 ^~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main() {
	string a;
	string c[8] = { "black","blue","lime","aqua","red","fuchsia","yellow","white" };
	int d[8][3] = { {0,0,0},{0,0,255},{0,255,0},{0,255,255},{255,0,0},
	{255,0,255},{255,255,0},{255,255,255} };
	while (cin>>a&&a!="0")
	{
		int t[3];
		for (int i = 1; i < a.length(); i += 2) {
			int b = 0;
			for (int j = 0; j <= 1; j++) {
				if ((int)a[i + j] >= '0' && (int)a[i +j] <= '9')
					b += (pow(16, (j+1)%2)*(int)(a[i +j] - '0'));
				else 
					b += (pow(16, (j+1)%2)*(10 + (int)a[i + j] - 'a'));
			}
			t[(i - 1) / 2] = b;
		}
		double e = 100000;
		string f = "";
		for (int i = 7; i >= 0; i--) {
			double g = sqrt(pow((t[0] - d[i][0]), 2) + pow((t[1] - d[i][1]), 2) + pow((t[2] - d[i][2]), 2));
			if (g <= e) {
				e = g;
				f = c[i];
			}
		}
		cout << f << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:47: error: 'pow' was not declared in this scope
   16 |                                         b += (pow(16, (j+1)%2)*(int)(a[i +j] - '0'));
      |                                               ^~~
a.cc:18:47: error: 'pow' was not declared in this scope
   18 |                                         b += (pow(16, (j+1)%2)*(10 + (int)a[i + j] - 'a'));
      |                                               ^~~
a.cc:25:41: error: 'pow' was not declared in this scope
   25 |                         double g = sqrt(pow((t[0] - d[i][0]), 2) + pow((t[1] - d[i][1]), 2) + pow((t[2] - d[i][2]), 2));
      |                                         ^~~
a.cc:25:36: error: 'sqrt' was not declared in this scope
   25 |                         double g = sqrt(pow((t[0] - d[i][0]), 2) + pow((t[1] - d[i][1]), 2) + pow((t[2] - d[i][2]), 2));
      |                                    ^~~~
Language: C++

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

int main(){
  string data;
  int f1,f2;

  while(1){
    getline(cin,data);
    if(data[0] == '0') return 0;
    f1 = f2 = 0
    for(int i = 0; i  < 10; i++){
      if(data[1] == i)
	f1 = 1;
      if(data[2] == i)
	f2 = 1;
    }
    if(fa == 1&&f2 == 1){
      data[1] = 0;
      data[2] = 0;
    }else{
      data[1] == f;
      data[2] == f;
    } 
    for(int i = 0; i  < 10; i++){
      if(data[3] == i)
	f1 = 1;
      if(data[4] == i)
	f2 = 1;
    }
    if(fa == 1&&f2 == 1){
      data[3] = 0;
      data[4] = 0;
    }else{
      data[3] == f;
      data[4] == f;
    } 
    for(int i = 0; i  < 10; i++){
      if(data[5] == i)
	f1 = 1;
      if(data[6] == i)
	f2 = 1;
    }
    if(fa == 1&&f2 == 1){
	    data[5] = 0;
	    data[6] = 0;
    }else{
      data[5] == f;
      data[6] == f;
    } 
    
    if(data[1] == 0 && data[2] == 0){
      if(data[3] == 0&& data[4] == 0){
	if(data[5] == 0&& data[6] == 0){
	  cout << "black" <<endl;
	}else{
	  cout << "blue" << endl;
	}
      }
      else{
	if(data[5] == 0&&data[6] == 0){
	  cout << "linme" << endl;
	  }else{
	  cout << "aqua" << endl;
	}
      }
    }
    if(data[1] == f && data[2] == f){
      if(data[3] == f&& data[4] == f){
	if(data[5] == f&& data[6] == f){
	  cout << "white" <<endl;
	}else{
	  cout << "yellow"<< endl;
	}
      }
      else{
	if(data[5] == 0&&data[6] == 0){
	  cout << "red" << endl;
	  }else{
	  cout << "fuchsia" << endl;
	}
      }
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: expected ';' before 'for'
   12 |     f1 = f2 = 0
      |                ^
      |                ;
   13 |     for(int i = 0; i  < 10; i++){
      |     ~~~         
a.cc:13:20: error: 'i' was not declared in this scope
   13 |     for(int i = 0; i  < 10; i++){
      |                    ^
a.cc:19:8: error: 'fa' was not declared in this scope; did you mean 'f2'?
   19 |     if(fa == 1&&f2 == 1){
      |        ^~
      |        f2
a.cc:23:18: error: 'f' was not declared in this scope; did you mean 'f2'?
   23 |       data[1] == f;
      |                  ^
      |                  f2
a.cc:32:8: error: 'fa' was not declared in this scope; did you mean 'f2'?
   32 |     if(fa == 1&&f2 == 1){
      |        ^~
      |        f2
a.cc:36:18: error: 'f' was not declared in this scope; did you mean 'f2'?
   36 |       data[3] == f;
      |                  ^
      |                  f2
a.cc:45:8: error: 'fa' was not declared in this scope; did you mean 'f2'?
   45 |     if(fa == 1&&f2 == 1){
      |        ^~
      |        f2
a.cc:49:18: error: 'f' was not declared in this scope; did you mean 'f2'?
   49 |       data[5] == f;
      |                  ^
      |                  f2
a.cc:69:19: error: 'f' was not declared in this scope; did you mean 'f2'?
   69 |     if(data[1] == f && data[2] == f){
      |                   ^
      |                   f2
Language: C++

#include<iostream>
#include<cstdlib>
#include<cstdio>
#define w 15*16+15
using namespace std;
int fld[8][3]={0,0,0,0,0,w,0,w,
	0,0,w,w,w,0,0
	,w,0,w,w,w,0,w,w,w};
char* col[]={"black",
	"blue","lime","aqua",
	"red","fuchsia",
	"yellow","white"};
int main(){
	int temp,t,x,y,z,a[8],ren;
	char s[10];
	while(cin>>s,s[0]!='0'){
		temp=1000000;
		for(int i=1;i<8;i++){
			if(s[i]>'9')
			a[i-1]=9+s[i]-'a';
			else a[i-1]=s[i]-'0';
		}
		for(int i=0;i<8;i++){
			x=a[0]*16+a[1]-fld[i][0];
			y=a[2]*16+a[3]-fld[i][1];
			z=a[4]*16+a[5]-fld[i][2];
			ren=sqrt(x*x+y*y+z*z);
			if(ren<temp){
				t=i;
				temp=ren;
			}
		}cout<<col[t]<<endl;
	}
	return 0;
}

Compiler output:
a.cc:9:14: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
    9 | char* col[]={"black",
      |              ^~~~~~~
a.cc:10:9: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   10 |         "blue","lime","aqua",
      |         ^~~~~~
a.cc:10:16: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   10 |         "blue","lime","aqua",
      |                ^~~~~~
a.cc:10:23: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   10 |         "blue","lime","aqua",
      |                       ^~~~~~
a.cc:11:9: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   11 |         "red","fuchsia",
      |         ^~~~~
a.cc:11:15: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   11 |         "red","fuchsia",
      |               ^~~~~~~~~
a.cc:12:9: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   12 |         "yellow","white"};
      |         ^~~~~~~~
a.cc:12:18: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   12 |         "yellow","white"};
      |                  ^~~~~~~
a.cc: In function 'int main()':
a.cc:27:29: error: 'sqrt' was not declared in this scope
   27 |                         ren=sqrt(x*x+y*y+z*z);
      |                             ^~~~
Language: C++

#include <iostream>
#include <iomanip>
#include <algorithm>

using namespace std;

struct Color{
	double r,g,b;
};

double sq( double a ){
	return a * a;
}

int main(int argc, char const* argv[])
{
	const char *color[] = {"black","blue","lime","aqua","red","fuchsia","yellow","white"};
	Color colorStrong[] = {{0,0,0},{0,0,255},{0,255,0},{0,255,255},{255,0,0},{255,0,255},{255,255,0},{255,255,255}};

	Color inputColor;
	int rgb;
	double d[8];
	char damy;

	while( cin >> damy && damy != '0' ){
		cin >> hex >> rgb;
		inputColor.r = rgb >> 16;
		inputColor.g = ( rgb >> 8 ) & 0xff;
		inputColor.b = rgb & 0xff;

		for( int i = 0;i < 8;i++ ){
			d[i] = sqrt( sq( inputColor.r - colorStrong[i].r ) + sq( inputColor.g - colorStrong[i].g ) + sq( inputColor.b - colorStrong[i].b ) );
		}

		double* answer = min_element( d, d + 8 );

		for( int i = 0;i < 8;i++ ){
			if( answer == &d[i] ){
				cout << color[i] << endl;
				break;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:32:32: error: 'sqrt' was not declared in this scope; did you mean 'sq'?
   32 |                         d[i] = sqrt( sq( inputColor.r - colorStrong[i].r ) + sq( inputColor.g - colorStrong[i].g ) + sq( inputColor.b - colorStrong[i].b ) );
      |                                ^~~~
      |                                sq
Language: C++

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

#define R 0
#define G 1
#define B 2

void print_col(int r, int g, int b)
{
  string col[] = {"black", "blue", "lime", "aqua", "red", "fuchsia", "yellow", "white"};
  int c[][3] = {{0, 0, 0}, {0, 0, 255}, {0, 255, 0}, {0, 255, 255},
               {255, 0, 0}, {255, 0, 255}, {255, 255, 0}, {255, 255, 255}};
  double d = 1000000;
  double dd;
  int a = -1;

  for(int i = 0; i < 8; i++)
  {
    dd = pow(r - c[i][R], 2) + pow(g - c[i][G], 2) + pow(b - c[i][B], 2);
    if(dd < d)
    {
      d = dd;
      a = i;
    }
  }
  cout << col[a] << endl;
}

int to_num(char n)
{
  return n >= 'a' ? n - 'a' + 10 : n - '0';
}

int main()
{
  string s;
  int r, g, b;
  while(true)
  {
    cin >> s;
    if(s[0] == '0')
      break;
    r = to_num(s[1]) * 16 + to_num(s[2]);
    g = to_num(s[3]) * 16 + to_num(s[4]);
    b = to_num(s[5]) * 16 + to_num(s[6]);
    print_col(r, g, b);
  }
}

Compiler output:
a.cc: In function 'void print_col(int, int, int)':
a.cc:27:3: error: 'cout' was not declared in this scope
   27 |   cout << col[a] << endl;
      |   ^~~~
a.cc:3:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<cmath>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:27:21: error: 'endl' was not declared in this scope
   27 |   cout << col[a] << endl;
      |                     ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include<cmath>
  +++ |+#include <ostream>
    3 | using namespace std;
a.cc: In function 'int main()':
a.cc:41:5: error: 'cin' was not declared in this scope
   41 |     cin >> s;
      |     ^~~
a.cc:41:5: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <map>
#include <set>
#include <cstdio>
#include <cmath>
#define rep(i,l,n) for(lint i=l;i<n;i++)
#define rer(i,l,n) for(lint i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a)
#define mk(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef vector<int> vi;
typedef vector<lint> vli;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

double M_PI=acos(-1);

int main(){
	double a[2],b[2],r=6378.1;
	while(1){
		rep(i,0,2) cin>>a[i]>>b[i];
		if(a[0]==-1 && b[0]==-1 && a[1]==-1 && b[1]==-1) break;
		double x[2],y[2],z[2],d2,l,c=M_PI/180.0;
		/*rep(i,0,2) x[i]=r*cos(a[i]*c)*cos(b[i]*c);
		rep(i,0,2) y[i]=r*sin(a[i]*c)*cos(b[i]*c);
		rep(i,0,2) z[i]=r*sin(b[i]*c);
		d2=(x[1]-x[0])*(x[1]-x[0])+(y[1]-y[0])*(y[1]-y[0])+(z[1]-z[0])*(z[1]-z[0]);
		o(" "<<d2);
		double t=acos(1-d2/(2.0*r*r));
		o(t);
		l=r*t;
		l=int(l+0.5);
		o(l);*/
		double t=acos(cos(a[0]*c)*cos(a[1]*c)*cos(b[0]*c-b[1]*c)+sin(a[0]*c)*sin(a[1]*c));
		double ans=r*t;
		ans=(int)(ans+0.5);
		o(ans);
	}
}

Compiler output:
In file included from /usr/include/c++/14/cmath:47,
                 from a.cc:9:
a.cc:25:8: error: expected unqualified-id before numeric constant
   25 | double M_PI=acos(-1);
      |        ^~~~
Language: C++

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

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

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  const double r = 6378.1;
  double x1,y1,x2,y2;
  double c = M_PI/180.0;
  while(cin >> y1 >> x1 >> y2 >> x2){
    if(y1 == -1 && x1 == -1 && y2 == -1 && x2 == -1) break;
    y1 = y1 * c;
    y2 = y2 * c;
    double d = r * acos(sin(y1) * sin(y2) + cos(y1) * cos(y2) * cos(x1*c - x2*c);
    cout << (int)(d + 0.5) << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:81: error: expected ')' before ';' token
   17 |     double d = r * acos(sin(y1) * sin(y2) + cos(y1) * cos(y2) * cos(x1*c - x2*c);
      |                        ~                                                        ^
      |                                                                                 )
Language: C++

#include<map>
#include<set>
#include<cmath>
#include<cstdio>
#include<cstdio>

#define all(c) (c).begin(),(c).end()

using namespace std;

const double R=6378.10;
const double PI=3.1415926535;
const double EPS=1e-10;
const double toRad=360.0/2.0/PI;

int main(void){
  double a,b,c,d;
  while(cin >> a >> b >> c >> d){
    if(a<0 && b<0 && c<0 && d<0)break;
    a/=toRad,b/=toRad,c/=toRad,d/=toRad;
    double ax=cos(b)*cos(a),ay=sin(b)*cos(a),az=sin(a);
    double bx=cos(d)*cos(c),by=sin(d)*cos(c),bz=sin(c);
    double D=sqrt(pow(ax-bx,2)+pow(ay-by,2)+pow(az-bz,2));
    double rad=acos(1-D*D/2);
    printf("%.0f",round(R*rad));
    cout << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'cin' was not declared in this scope
   18 |   while(cin >> a >> b >> c >> d){
      |         ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #include<cstdio>
  +++ |+#include <iostream>
    6 | 
a.cc:26:5: error: 'cout' was not declared in this scope
   26 |     cout << endl;
      |     ^~~~
a.cc:26:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:26:13: error: 'endl' was not declared in this scope
   26 |     cout << endl;
      |             ^~~~
a.cc:6:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    5 | #include<cstdio>
  +++ |+#include <ostream>
    6 |
Language: C

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

int i,j,k,block[500000][5],hhh,max[5],left,from,time;
int n,d,l,x;

int main(){
	while(scanf("%d",&n)*n){
		hhh=0;left=0;
		for(i=0;i<5;i++)max[i]=0;

		for(;n>0;n--){

			scanf("%d %d %d",&d,&l,&x); x--;
			left+=l;

			if(d==1){
				k=0;j=0;
				for(i=0;i<l;i++){if(max[x+i]>k){k=max[x+i];j=x+i;}}
				for(i=0;i<l;i++){max[x+i]=k+1;block[k][x+i]=1;}
				from=k;time=1;
			}
			else{
				for(i=0;i<l;i++)block[max[x]+i][x]=1;
				from=max[x];
				max[x]+=l;
				time=l;
				j=x;
			}

			if(hhh<max[j])hhh=max[j];

			for(i=0;i<time;i++){
				if(block[from][0]==1 && block[from][1]==1 && block[from][2]==1 && block[from][3]==1 && block[from][4]==1){
					for(j=0;j<5;j++){block[from][j]=0;}
					for(k=from+1;k<hhh+1;k++){
						for(j=0;j<5;j++){
							&block[k-1][j]=&block[k][j];
						}
					}
					left-=5;hhh--;
				}
				else from++;
			}

			for(j=0;j<5;j++){
				for(k=max[j];k>=0;k--){
					if(block[k][j]==1)break;
				}
				max[j]=k+1;
			}
		}

		for(i=0;i<hhh;i++){
			for(j=0;j<5;j++){
				block[i][j]=0;
			}
		}

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

Compiler output:
main.c: In function 'main':
main.c:39:71: error: lvalue required as left operand of assignment
   39 |                                                         &block[k-1][j]=&block[k][j];
      |                                                                       ^
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

#define INF 1e9

int field[5000][5],tmp[5000][5];

void down(){
  memset(tmp,0,sizeof(tmp));
  for(int j = 0 ; j < 5 ; j++){
    int p = 4999;
    for(int i = 4999 ; i >= 0 ; i--){
      if(field[i][j] == -1) continue;
      tmp[p--][j] = field[i][j];
    }
  }
  for(int i = 0 ; i < 5000 ; i++){
    for(int j = 0 ; j < 5 ; j++){
      field[i][j] = tmp[i][j];
    }
  }
}

void remove(){
  bool flg = false;
  for(int i = 0 ; i < 5000 ; i++){
    int cnt = 0;
    for(int j = 0 ; j < 5 ; j++,cnt++){
      if(!field[i][j]) break;
    }
    if(cnt == 5){
      flg = true;
      for(int j = 0 ; j < 5 ; j++){
        field[i][j] = -1;
      }
    }
  }
  
  if(flg){
    down();
  }
}

int main(){
  int N,d,p,q;

  while(cin >> N,N){
    memset(field,0,sizeof(field));
    for(int i = 0 ; i < N ; i++){
      cin >> d >> p >> q; q--;

      if(d == 1){
        int min = INF;
        for(int j = q ; j < p+q ; j++){
          for(int i = 0 ; i < 5000 ; i++){
            if(i == 4999 || field[i+1][j] == 1){
              min = std::min(min,i);
              break;
            }
          }
        }
        for(int j = q ; j < p+q ; j++){
          field[min][j] = 1;
        }
      }else{
        for(int i = 0 ; i < 5000 ; i++){
          if(i == 4999 || field[i+1][q] == 1){
            for(int j = 0 ; j < p ; j++){
              field[i-j][q] = 1;
            }
            break;
          }
        }
      }
      remove();
    }
    int ans = 0;
    for(int i = 0 ; i < 5000 ; i++){
      for(int j = 0 ; j < 5 ; j++){
        if(field[i][j] == 1) ans++;
      }
    }
    cout << ans << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'void down()':
a.cc:11:3: error: 'memset' was not declared in this scope
   11 |   memset(tmp,0,sizeof(tmp));
      |   ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 | 
a.cc: In function 'int main()':
a.cc:50:5: error: 'memset' was not declared in this scope
   50 |     memset(field,0,sizeof(field));
      |     ^~~~~~
a.cc:50:5: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <vector>
#include <iostream>

using namespace std;

int n, d, p, q;

int main()
{
    cin >> n;
    
    vector<vetcor<bool> > c(5000, vector<int>(5, false));
    
    for(int i = 0; i < n; i++)
    {
        cin >> d >> p >> q;
        
        if(d == 1)
        {
            int maxh = -1;
            
            for(int j = p - 1; j < p + q - 1; j++)
            {
                int r = 5000;
                
                while(r--)
                {
                    if(c[r][j] == true)
                    {
                        break;
                    }
                }
                
                maxh = max(maxh, r + 1);
            }
            
            for(int j = p - 1; j < p + q - 1; j++)
            {
                c[maxh][j] = true;
            }
        }
        else
        {
            int r = 5000;
            
            while(r--)
            {
                if(c[r][p] == true)
                {
                    break;
                }
            }
            
            for(int j = r + 1; j < r + q + 1; j++)
            {
                c[j][p] = true;
            }
        }
    }
    
    int sum = 0;
    
    for(int i = 0; i < 5000; i++)
    {
        for(int j = 0; j < 5; j++)
        {
            sum += (c[j][p] ? 1 : 0);
        }
    }
    
    cout << sum << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: 'vetcor' was not declared in this scope
   12 |     vector<vetcor<bool> > c(5000, vector<int>(5, false));
      |            ^~~~~~
a.cc:12:23: error: template argument 1 is invalid
   12 |     vector<vetcor<bool> > c(5000, vector<int>(5, false));
      |                       ^
a.cc:12:23: error: template argument 2 is invalid
a.cc:12:25: error: expected unqualified-id before '>' token
   12 |     vector<vetcor<bool> > c(5000, vector<int>(5, false));
      |                         ^
a.cc:28:24: error: 'c' was not declared in this scope
   28 |                     if(c[r][j] == true)
      |                        ^
a.cc:39:17: error: 'c' was not declared in this scope
   39 |                 c[maxh][j] = true;
      |                 ^
a.cc:48:20: error: 'c' was not declared in this scope
   48 |                 if(c[r][p] == true)
      |                    ^
a.cc:56:17: error: 'c' was not declared in this scope
   56 |                 c[j][p] = true;
      |                 ^
a.cc:67:21: error: 'c' was not declared in this scope
   67 |             sum += (c[j][p] ? 1 : 0);
      |                     ^
Language: C++

#include<iostream>
#define N 10020
using namespace std;
int main(){
  while(true){
    int n;
    int ans=0;
    scanf("%d",&n);

    if(n==0)break;
    int row[N]={0,};
    int h[5]={0,};
    for(int i = 0; i < n; ++i){
      int mh = 0;
      int d,p,q;
      scanf("%d%d%d", &d, &p, &q);
      --q;
      
      if(d==1){
	int maxh = 0;
	for(int j = q; j < q + p; ++j){
	  maxh = max( maxh, h[j] );
	}
	for(int j = q; j < q + p; ++j){
	  h[j] = maxh + 1;
	}
	row[maxh]+=p;
      }else{
	for(int j = h[q]; j < p + h[q]; ++j){
	  ++row[ j ];
	}
	h[q]+=p;
      }

      // cout << " DROPPED : " << i << endl;
      for(int j = 0; j < 5; ++j){
	mh = max( mh , h[j] );
      }

      for(int j = 0; j < mh; ++j){
	// cout << " row["<<j<<"] = " << row[j] << endl;
	if( row[j] == 5 ){
	  for(int k = 0; k < 5; ++k){
	    --h[k];
	    if(h[k]<0)=h[k]=0;
	  }
	  for(int k = j; k < mh+2; ++k){
	    row[k] = row[k + 1];
	  }
	  j = -1;
	  continue;
	}
      }
    }
    for(int i = 0; i < N; ++i){
      ans += row[i];
    }
    printf("%d\n",ans);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:23: error: expected primary-expression before '=' token
   45 |             if(h[k]<0)=h[k]=0;
      |                       ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int n;

typedef struct Block
{
	int d;
	int p;
	int q;
} B;

int F[5000][5];
int H[5];

B blocks[1000];

int highest(int r, int l)
{
	int max = 0;
	for(int i=r; i<l; i++)
	{
		if(max < H[i])
		{
			max =H[i];
		}
	}
	return max;
}

void yoko_set(B b)
{
	int hp = highest(b.q, b.p+b.q);
	for(int i=b.q; i<b.p+b.q; i++)
	{
		F[hp][i] =1;
		H[i] = hp+1;
	}
}

void tate_set(B b)
{
	int hp = H[b.q];
	for(int i=hp; i<hp+b.p; i++)
	{
		F[i][b.q] = 1;
	}
	H[b.q] = hp+b.p;
}

void col_clear()
{
	
	int hp = highest(0, 5);
	bool is_ok = false;
	vector<int> cols;
	for(int i=0; i<=hp; i++)
	{
		is_ok =true;
		for(int j=0; j<5; j++)
		{
			if(F[i][j]==1) continue;
			is_ok = false;
			break;
		}
		
		if(is_ok)
		{
			cols.push_back(i);
		}
	}
	
	if(cols.empty()) return;
	
	int c = 0;
	for(int i=0; i<hp; i++)
	{
		if(cols[c]==i)
		{
			c++;
			continue;
		}
		
		for(int j=0; j<5; j++)
		{
			F[i-c][j] = F[i][j];
		}
	}
	
	for(int i=hp-cols.size(); i<hp; i++)
	{
		for(int j=0; j<5; j++)
		{
			F[i][j] = 0;
		}
	}
	
	for(int i=0; i<5; i++)
	{
		H[i] -= cols.size();
	}
}

int main()
{
	while(cin >> n, n)
	{
		for(int i=0; i<n; i++)
		{
			cin >> blocks[i].d;
			cin >> blocks[i].p;
			cin >> blocks[i].q;
			blocks[i].q--;
		}
		
		memset(&F[0][0], 0, sizeof(int)*25000);
		memset(&H[0], 0, sizeof(int)*5);
		
		for(int i=0; i<n; i++)
		{
			if(blocks[i].d == 2)
			{
				tate_set(blocks[i]);
			}
			else
			{
				yoko_set(blocks[i]);
			}
			
			col_clear();
		}
		
		int hp = highest(0, 5);
		int c = 0;
		for(int i=0; i<hp; i++)
		{
			for(int j=0; j<5; j++)
			{
				if(F[i][j]==1) c++;
			}
		}
		cout << c<< endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:118:17: error: 'memset' was not declared in this scope
  118 |                 memset(&F[0][0], 0, sizeof(int)*25000);
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <vector>
  +++ |+#include <cstring>
    3 |