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

//莉頑律縺ョ謌先棡*AOJ0027*AOJ0028


#include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
using namespace std;
int stoi(string x){stringstream ss;ss<<x;int tmp;ss>>tmp;return tmp;}
string itos(int x){stringstream ss;ss<<x;return ss.str();}
int main(){
	
	int h,ans=0;
	while(cin>>h,h){
	ans=0;
	int ta[200][5]={{0},{0}};
	for(int i=0;i<h;i++)for(int j=0;j<5;j++)cin>>ta[i][j];
	//逶、髱「縺ョ蟄伜惠縺励↑縺?→縺薙ｍ縺ッ0
	while(true){
	bool f=1;
	for(int i=0;i<h;i++){
	int cnt=0,fi=0;
		for(int j=0;j<3;j++){
			if(ta[i][j]==ta[i][j+1]&&ta[i][j]==ta[i][j+2]&&ta[i][j]!=0){
			cnt++;
			if(fi==0)fi=j;
			}
		}//endfor
		if(cnt!=0)ans+=ta[i][fi]*(2+cnt),f=0;
		if(cnt!=0)for(int j=0;j<2+cnt;j++)ta[i][fi+j]=0;
	}//endfor
	if(f)break;
	//關ス縺ィ縺吝?逅?	for(int i=h-2;i>=0;i--){
		for(int j=0;j<5;j++){
			int ti=i;
			while(true){
			if(ti==h-1||ta[ti+1][j]!=0)break;
			ta[ti+1][j]=ta[ti][j];
			ta[ti][j]=0;
			ti++;
			}//endwhile
		}//endfor
	}//endfor
	}//endwhile
	cout<<ans<<endl;
	}//endwhile
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:32: error: 'i' was not declared in this scope; did you mean 'ti'?
   39 |                         int ti=i;
      |                                ^
      |                                ti
a.cc: At global scope:
a.cc:51:9: error: expected unqualified-id before 'return'
   51 |         return 0;
      |         ^~~~~~
a.cc:52:1: error: expected declaration before '}' token
   52 | }
      | ^
Language: C++

//莉頑律縺ョ謌先棡*AOJ0027*AOJ0028


#include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
using namespace std;
int stoi(string x){stringstream ss;ss<<x;int tmp;ss>>tmp;return tmp;}
string itos(int x){stringstream ss;ss<<x;return ss.str();}
int main(){
	
	int h,ans=0;
	while(cin>>h,h!=0){
	ans=0;
	int ta[200][5]={{0},{0}};
	for(int i=0;i<h;i++)for(int j=0;j<5;j++)cin>>ta[i][j];
	//逶、髱「縺ョ蟄伜惠縺励↑縺?→縺薙ｍ縺ッ0
	while(true){

	bool f=1;
	for(int i=0;i<h;i++){
	int cnt=0,fi=-1;
		for(int j=0;j<3;j++){
			if(ta[i][j]==ta[i][j+1]&&ta[i][j]==ta[i][j+2]&&ta[i][j]!=0){
			cnt++;
			if(fi==-1)fi=j;
			}
		}//endfor
		if(cnt!=0)ans+=ta[i][fi]*(2+cnt),f=0;
		if(cnt!=0)for(int j=0;j<2+cnt;j++)ta[i][fi+j]=0;
	}//endfor
	if(f)break;
	//關ス縺ィ縺吝?逅?	for(int i=h-2;i>=0;i--){
		for(int j=0;j<5;j++){
			int ti=i;
			while(true){
			if(ti==h-1||ta[ti+1][j]!=0)break;
			ta[ti+1][j]=ta[ti][j];
			ta[ti][j]=0;
			ti++;
			}//endwhile
		}//endfor
	}//endfor
	//for(int i=0;i<h;i++)printf("%d%d%d%d%d\n",ta[i][0],ta[i][1],ta[i][2],ta[i][3],ta[i][4]);
	//printf("\n");
	}//endwhile
	cout<<ans<<endl;
	}//endwhile
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:32: error: 'i' was not declared in this scope; did you mean 'ti'?
   40 |                         int ti=i;
      |                                ^
      |                                ti
a.cc: At global scope:
a.cc:54:9: error: expected unqualified-id before 'return'
   54 |         return 0;
      |         ^~~~~~
a.cc:55:1: error: expected declaration before '}' token
   55 | }
      | ^
Language: C++

//莉頑律縺ョ謌先棡*AOJ0027*AOJ0028


#include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
using namespace std;
int stoi(string x){stringstream ss;ss<<x;int tmp;ss>>tmp;return tmp;}
string itos(int x){stringstream ss;ss<<x;return ss.str();}
int main(){
	
	int h,ans=0;
	while(true){
	cin>>h;
	if(h==0)break;
	ans=0;
	int ta[200][5]={{0},{0}};
	for(int i=0;i<h;i++)for(int j=0;j<5;j++)cin>>ta[i][j];
	//逶、髱「縺ョ蟄伜惠縺励↑縺?→縺薙ｍ縺ッ0
	while(true){

	bool f=1;
	for(int i=0;i<h;i++){
	int cnt=0,fi=-1;
		for(int j=0;j<3;j++){
			if(ta[i][j]==ta[i][j+1]&&ta[i][j]==ta[i][j+2]&&ta[i][j]!=0){
			cnt++;
			if(fi==-1)fi=j;
			}
		}//endfor
		if(cnt!=0)ans+=ta[i][fi]*(2+cnt),f=0;
		if(cnt!=0)for(int j=0;j<2+cnt;j++)ta[i][fi+j]=0;
	}//endfor
	if(f)break;
	//關ス縺ィ縺吝?逅?	for(int i=h-2;i>=0;i--){
		for(int j=0;j<5;j++){
			int ti=i;
			while(true){
			if(ti==h-1||ta[ti+1][j]!=0)break;
			ta[ti+1][j]=ta[ti][j];
			ta[ti][j]=0;
			ti++;
			}//endwhile
		}//endfor
	}//endfor
	//for(int i=0;i<h;i++)printf("%d%d%d%d%d\n",ta[i][0],ta[i][1],ta[i][2],ta[i][3],ta[i][4]);
	//printf("\n");
	}//endwhile
	cout<<ans<<endl;
	}//endwhile
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:32: error: 'i' was not declared in this scope; did you mean 'ti'?
   42 |                         int ti=i;
      |                                ^
      |                                ti
a.cc: At global scope:
a.cc:56:9: error: expected unqualified-id before 'return'
   56 |         return 0;
      |         ^~~~~~
a.cc:57:1: error: expected declaration before '}' token
   57 | }
      | ^
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
using namespace std;
int stoi(string x){stringstream ss;ss<<x;int tmp;ss>>tmp;return tmp;}
string itos(int x){stringstream ss;ss<<x;return ss.str();}
int main(){
	
	int h,ans=0;
	while(true){
	cin>>h;
	if(h==0)break;
	ans=0;
	int ta[200][5]={{0},{0}};
	for(int i=0;i<h;i++)for(int j=0;j<5;j++)cin>>ta[i][j];
	//逶、髱「縺ョ蟄伜惠縺励↑縺?→縺薙ｍ縺ッ0
	while(true){

	bool f=1;
	for(int i=0;i<h;i++){
	int cnt=0,fi=-1;
		for(int j=0;j<3;j++){
			if(ta[i][j]==ta[i][j+1]&&ta[i][j]==ta[i][j+2]&&ta[i][j]!=0){
			cnt++;
			if(fi==-1)fi=j;
			}
		}//endfor
		if(cnt!=0)ans+=ta[i][fi]*(2+cnt),f=0;
		if(cnt!=0)for(int j=0;j<2+cnt;j++)ta[i][fi+j]=0;
	}//endfor
	if(f)break;
	//關ス縺ィ縺吝?逅?	for(int i=h-2;i>=0;i--){
		for(int j=0;j<5;j++){
			int ti=i;
			while(true){
			if(ti==h-1||ta[ti+1][j]!=0)break;
			ta[ti+1][j]=ta[ti][j];
			ta[ti][j]=0;
			ti++;
			}//endwhile
		}//endfor
	}//endfor
	//for(int i=0;i<h;i++)printf("%d%d%d%d%d\n",ta[i][0],ta[i][1],ta[i][2],ta[i][3],ta[i][4]);
	//printf("\n");
	}//endwhile
	cout<<ans<<endl;
	}//endwhile
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:32: error: 'i' was not declared in this scope; did you mean 'ti'?
   39 |                         int ti=i;
      |                                ^
      |                                ti
a.cc: At global scope:
a.cc:53:9: error: expected unqualified-id before 'return'
   53 |         return 0;
      |         ^~~~~~
a.cc:54:1: error: expected declaration before '}' token
   54 | }
      | ^
Language: C++

#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;

#define int long long int

size_t main()
{
	int N;
	while (cin >> N, N)
	{
		vector<vector<int>>data;
		data.clear();
		data.resize(N);
		for (size_t i = 0; i < N; i++)
		{
			data[i].resize(5);
			for (size_t j = 0; j < 5; j++)
			{
				cin >> data[i][j];
			}
		}
		int ans = 0;
		bool f = 1;
		while (f)
		{
			f = 0;
			for (size_t i = 0; i < N; i++)
			{
				int a = data[i][0];
				int b;
				int count = 1;
				int count2 = 1;
				for (size_t j = 1; j < 5; j++)
				{
					if (data[i][j] == a&&data[i][j])
					{
						count++;
					} else
					{
						if (count2 < count)
						{
							count2 = count;
							b = a;
						}
						a = data[i][j];
						count = 1;
					}
				}
				if (count2 < count)
				{
					count2 = count;
					b = data[i][4];
				}
				if (count2 >= 3)
				{
					f = 1;
					ans += count2*b;
					for (size_t j = 0; j < 5; j++)
					{
						if (data[i][j] == b)
						{
							data[i][j] = 0;
						}
					}
				}
			}
			for (int i = N - 1; i >= 0; i--)
			{
				
				for (size_t j = 0; j < 5; j++)
				{
					if (data[i][j] == 0)
					{
						int k = i;
						while (k >= 0 && data[k][j] == 0)
						{
							k--;
						}
						if (k < 0)data[i][j] = 0;
						else
						{
							data[i][j] = data[k][j];
							data[k][j] = 0;
						}
					}
				}
			}
		}
		cout << ans << endl;
	}
}

Compiler output:
a.cc:89:1: error: '::main' must return 'int'
   89 | size_t main()
      | ^~~~~~
Language: C++

1
6 9 9 9 9
5
5 9 5 5 9
5 5 6 9 9
4 6 3 6 9
3 3 2 9 9
2 2 1 1 1
10
3 5 6 5 6
2 2 2 8 3
6 2 5 9 2
7 7 7 6 1
4 6 6 4 9
8 9 1 1 8
5 6 1 8 1
6 8 2 1 2
9 6 3 3 5
5 3 8 8 8
5
1 2 3 4 5
6 7 8 9 1
2 3 4 5 6
7 8 9 1 2
3 4 5 6 7
3
2 2 8 7 4
6 5 7 7 7
8 8 9 9 9
0

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

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

int main()
{
  while(1){
    int H;
    cin >> H;
    if(H == 0) break;
    int p[H][5];
    int ans = 0;
    for(int i = 0; i < H; i++)
      for(int j = 0; j < 5; j++)
        cin >> p[i][j];
    bool flag = true;
    while(flag){
      flag = false;
      for(int i = 0; i < H; i++){
        int x = p[i][2];
        int n  = count(&p[i][0], &p[i + 1][0], x);
        if(x == -1) continue;
        if(n == 3){
          if(p[i][0] == x && p[i][1] == x){
            flag = true;
            ans += 3 * x;
            for(int j = 0; j < 3; j++)
              p[i][j] = -1;
          }else if(p[i][3] == x && p[i][4] == x){
            flag = true;
            ans += 3 * x;
            for(int j = 2; j < 5; j++)
              p[i][j] = -1;
          }else if(p[i][1] == x && p[i][3] == x){
            flag = true;
            ans += 3 * x;
            for(int j = 1; j < 4; j++)
              p[i][j] = -1;
          }
        }else if(n == 4){
          flag = true;
          ans += 4 * x;
          if(p[i][0] == x){
            for(int j = 0; j < 4; j++)
              p[i][j] = -1;
          }else{
            for(int j = 1; j < 5; j++)
              p[i][j] = -1;
          } 
        }else if(n == 5){
          flag = true;
          ans += 5 * x;
          for(int j = 0; j < 5; j++)
            p[i][j] = -1;
        }
      }
      for(int j = H - 1; j >= 0; j--){
        for(int k = 0; k < 5; k++){
          if(p[j][k] == -1){
            for(int l = j - 1; l >= 0; l--){
              if(p[l][k] != -1){
                swap(p[j][k], p[l][k]);
                break;
              }
            }
          }
        }
      }
    }
    cout << ans << endl;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:71:4: error: expected '}' at end of input
   71 |   }
      |    ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#include <cstdio>
#include <vector>

int disappear(std::vector<std::vector<int> > &p) {
  size_t W=p.size(), H=p[0].size();
  std::vector<std::vector<int> > to_erase(W, std::vector<int>(H));
  int diff=0;

  for (size_t i=0; i<H; ++i) {
    int l=2, r=3;
    if (p[2][i] == 0) continue;

    while (l > 0) {
      if (p[l][i] == p[l-1][i]) {
	--l;
      } else {
	break;
      }
    }

    while (r < 5) {
      if (p[r][i] == p[r-1][i]) {
	++r;
      } else {
	break;
      }
    }

    if (r-l < 3)
      continue;

    diff += (r-l)*p[2][i];
    for (int j=l; j<r; ++j)
      to_erase[j][i] = 1;
  }

  for (size_t j=0; j<W; ++j) {
    std::vector<int> tmp(H);
    size_t k=0;
    for (size_t i=H; i--;) {
      if (to_erase[j][i]) continue;
      if (p[j][i] == 0) break;

      tmp[k++] = p[j][i];
    }

    std::reverse(tmp.begin(), tmp.end());
    p[j] = std::move(tmp);
  }

  return diff;
}

int solve_testcase() {
  size_t H, W=5;
  scanf("%zu", &H);
  if (H == 0)
    return 1;

  int score=0;
  std::vector<std::vector<int> > board(W, std::vector<int>(H));  // irreg
  for (size_t i=0; i<H; ++i) {
    for (size_t j=0; j<W; ++j) {
      scanf("%d", &board[j][i]);
    }
  }

  int diff;
  while ((diff = disappear(board))) {
    score += diff;
  }

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

int main() {
  while (!solve_testcase()) {}

  return 0;
}

Compiler output:
a.cc: In function 'int disappear(std::vector<std::vector<int> >&)':
a.cc:47:10: error: 'reverse' is not a member of 'std'
   47 |     std::reverse(tmp.begin(), tmp.end());
      |          ^~~~~~~
Language: C++

#include <iostream>

using namespace std;

#define H 10

int map[10][5];

int calc_and_remove() {
  int res = [&]{
    int res = 0;
    for(int i = 0; i < H; i++) {
      for(int j = 0; j < 5; j++) {
        int left = j;
        int right = left;
        int prev = map[i][left];
        while(right < 5  && map[i][right] && map[i][right] == prev) right++;
        if (right - left >= 3) {
          for(int k = left; k < right; k++) {
            res += map[i][k];
            map[i][k] = 0;
          }
        }
      }
    }
    return res;
  }();

  for(int i = H-1; i >= 0; i--) {
    for(int j = 0; j < 5; j++) {
      int cnt = 0;
      while (map[i][j] == 0 && cnt < 5) {
        for(int k = i; k >= 0; k--) {
          if (k-1 == -1) {
            map[k][j] = 0;
          }
          else {
            map[k][j] = map[k-1][j];
          }
        }
        cnt ++;
      }
    }
  }

  return res;
}

int main() {
  int h;
  while(cin >> h, h) {
    memset(map, 0, H*5*sizeof(int));
    for(int i = 0; i < h; i++)
      for(int j = 0; j < 5; j++)
        cin >> map[i+(10-h)][j];

    int res = 0;
    for(int k = 0; k < 20; k++) {
      res += calc_and_remove();
    }

    cout << res << endl;
  }

  return 0;
}

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

// chain_disappears_puzzle.cpp
// 2017/11/03


#include "stdafx.h"
#include <iostream>

using namespace std;

//?¶???????????????°???????????????????????¢??° stone_erase
int stone_erase(int i, int *target) {
	if (i == 0) {
		if (target[i + 2] == target[i + 3] && target[i + 3] == target[i + 4]) { //1????????????5?????????????????????
			return 5; //?¶?????????????5?????§??????
		}
	}
	if (i == 0 || i == 1) {
		if (target[i + 2] == target[i + 3]) {
			return 4; //?¶?????????????4?????§??????
		}
	}
	return 3; //?????????????????£?????????????????´???????¶?????????????3?????§??????
}

int main()
{

	//??\???????????????H?????????
	int H; //??????
	cin >> H;

	int board[10][5]; //?????¢
	int point = 0;
	int erase_address[10][3]; //?¶??????´?????¨?¶???????????????°????¨???¶
	bool erase_flag = false;

	while (H != 0) { //H???0?????\??????????????´????????????

		//??\??????????????¢board?????\??????erase_address???????????????2????????\???)
		for (int i = 0; i < H; i++) {
			for (int j = 0; j < 5; j++) {
				cin >> board[i][j];
				if (j < 3) {
					erase_address[i][j] = 0;
				}
			}
		}
		
		//?????¢???????¶?????????¨?????§????????????????´¢????????¢??¢?´¢???
		do {
			erase_flag = false; //2???????????¢?´¢??§?????????
			for (int i = 0; i < H; i++) {
				for (int j = 0; j < 3; j++) {
					if (board[i][j] == -1) continue;
					if (board[i][j] == board[i][j + 1] && board[i][j + 1] == board[i][j + 2]) { //???????????????????¶???????3???????????§????????´???
						erase_flag = true;
						erase_address[i][j] = stone_erase(j, board[i]); //erase_address????¶???????????????°???????´????ex:3????¶??????????erase_address[i][j] = 3???
						point += (board[i][j] * erase_address[i][j]);
						break; //?¬???????????§????
					}
				}
			}
			
			//??????????????????
			for (int i = 0; i < H; i++) {
				for (int j = 0; j < 3; j++) {
					if (erase_address[i][j] != 0) {
						for (int k = i; k > 0; k--) {
							for (int l = j; l < j + erase_address[i][j]; l++) {
								board[k][l] = board[k - 1][l]; // 1?????????????????????????????£????????????????????????
							}
						}
						for (int k = j; k < j + erase_address[i][j]; k++) {
							board[0][k] = -1;
						}
					}
				}
			}

			/*
			for (int i = 0; i < H; i++) {
				for (int j = 0; j < 5; j++) {
					if (board[i][j] == -1) cout << board[i][j] << " ";
					else cout << board[i][j] << "  ";
				}
				cout << endl;
			}
			cout << endl;
			*/

			//erase_address???????????????
			for (int i = 0; i < 10; i++) { 
				for (int j = 0; j < 3; j++) {
					erase_address[i][j] = 0;
				}
			}

		} while (erase_flag != false); //erase_flag???false??????????????´???????¶??????????????????????????????´???????????¢?´¢???????????????do-while?????????????????????

		cout << point << endl; //??????????????????
		point = 0; //?????????????????????

		cin >> H; // ?¬?????????¢??????????????\???
	}
    return 0;
}

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

#include<iostream>
using namespace std;

int main(){
	while(true){
		int H;
		cin>>H;
		
		if(H==0)
			break;
		
		int S[10][5];
		for(int y=0;y<h;y++){
			for(int x=0;x<5;x++){
				cin>>S[y][x];
		
		int sco=0;
		
		while(true){
			bool flg =false;
		
			for(int y=0;y<H;y++){
				int m=S[y][2];
				if(m==0)
					continue;

				if(S[y][0]==m && S[y][1]==m){
					sco += m*3;
					S[y][0]=S[y][1]=S[y][2]=0;
					flg=true;
					if(S[y][3]==m){
					sco += m;
					S[y][3]=0;
					if(S[y][4]==m){
					sco += m;
					S[y][4]=0;
					}
					}
				}
				else if(S[y][1]==m&&S[y][3]==m){
					sco += m*3;
					S[y][1]=S[y][2]=S[y][3]=0;
					flg=true;
					if(S[y][4]==m){
					sco += m;
					S[y][4]=0;
					}
				}
				else if(S[y][4]==m&&S[y][3]==m){
					sco += m*3;
					S[y][2]=S[y][3]=S[y][4]=0;
					flg=true;
				}
				if(!flg)
					break;
	
				for(int x=0;x<5;x++){
					for(int y=H-1;y>=0;y--){
						if(S[y][x]!=0)
							continue;
		
						for(int y2=y-1;y2>=0;y2--){
							if(S[y2][x]!=0){
								S[y][x]=S[y2][x];
								S[y2][x]=0;
								break;
							}
						}
					}
				}

			}

			cout<<sco<<endl;
			}
		return 0;
	}



















Compiler output:
a.cc: In function 'int main()':
a.cc:13:31: error: 'h' was not declared in this scope
   13 |                 for(int y=0;y<h;y++){
      |                               ^
a.cc:77:10: error: expected '}' at end of input
   77 |         }
      |          ^
a.cc:13:37: note: to match this '{'
   13 |                 for(int y=0;y<h;y++){
      |                                     ^
a.cc:77:10: error: expected '}' at end of input
   77 |         }
      |          ^
a.cc:5:20: note: to match this '{'
    5 |         while(true){
      |                    ^
a.cc:77:10: error: expected '}' at end of input
   77 |         }
      |          ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;

int main(){
	while(true){
		int H;
		cin>>H;
		
		if(H==0)
			break;
		
		int S[10][5];
		for(int y=0;y<H;y++){
			for(int x=0;x<5;x++){
				cin>>S[y][x];
		
		int sco=0;
		
		while(true){
			bool flg =false;
		
			for(int y=0;y<H;y++){
				int m=S[y][2];
				if(m==0)
					continue;

				if(S[y][0]==m && S[y][1]==m){
					sco += m*3;
					S[y][0]=S[y][1]=S[y][2]=0;
					flg=true;
					if(S[y][3]==m){
					sco += m;
					S[y][3]=0;
					if(S[y][4]==m){
					sco += m;
					S[y][4]=0;
					}
					}
				}
				else if(S[y][1]==m&&S[y][3]==m){
					sco += m*3;
					S[y][1]=S[y][2]=S[y][3]=0;
					flg=true;
					if(S[y][4]==m){
					sco += m;
					S[y][4]=0;
					}
				}
				else if(S[y][4]==m&&S[y][3]==m){
					sco += m*3;
					S[y][2]=S[y][3]=S[y][4]=0;
					flg=true;
				}
				if(!flg)
					break;
	
				for(int x=0;x<5;x++){
					for(int y=H-1;y>=0;y--){
						if(S[y][x]!=0)
							continue;
		
						for(int y2=y-1;y2>=0;y2--){
							if(S[y2][x]!=0){
								S[y][x]=S[y2][x];
								S[y2][x]=0;
								break;
							}
						}
					}
				}

			}

			cout<<sco<<endl;
			}
		return 0;
	}



















Compiler output:
a.cc: In function 'int main()':
a.cc:77:10: error: expected '}' at end of input
   77 |         }
      |          ^
a.cc:13:37: note: to match this '{'
   13 |                 for(int y=0;y<H;y++){
      |                                     ^
a.cc:77:10: error: expected '}' at end of input
   77 |         }
      |          ^
a.cc:5:20: note: to match this '{'
    5 |         while(true){
      |                    ^
a.cc:77:10: error: expected '}' at end of input
   77 |         }
      |          ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;

int main(){
	while(1){
		int H;
		cin>>H;

		if(H==0)
			break;

		int S[10][5];
		for(int y=0;y<H;y++)
			for(int x=0;x<5;x++)
				cin>>S[y][xa];
	
		int sco=0;
	
		while(1){
			bool flg=false;
	
			for(int y=0;y<H;y++){
				int m=S[y][2];
				if(m==0)
					continue;
	
				if(S[y][0]==m&&S[y][1]==m){
					sco+=m*3;S[y][0]=S[y][1]=S[y][2]=0;flg=true;
					if(S[y][3]==m){
						sco+=m;S[y][3]=0;
						if(S[y][4]==m){
							sco+=m;S[y][4]=0;
						}
					}
				}
				else if(S[y][1]==m&&S[y][3]==m){
					sco+=m*3;S[y][1]=S[y][2]=S[y][3]=0;flg=true;
					if(S[y][4]==m){
						sco+=m;S[y][4]=0;
					}
				}
				else if(S[y][3]==m&&S[y][4]==m){
					sco+=m*3;S[y][2]=S[y][3]=S[y][4]=0;flg=true;
				}
			}
	
			if(!flg)
				break;
		
			for(int x=0;x<5;x++){
				for(int y=H-1;y>=0;y--){
					if(S[y][x]!=0)
						continue;

					for(int y2=y-1;y2>=0;y2--){
						if(S[y2][x]!=0){
							S[y][x]=S[y2][x];S[y2][x]=0;break;
						}
					}
				}
			}
		}

		cout<<sco<<endl;
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:43: error: 'xa' was not declared in this scope; did you mean 'x'?
   15 |                                 cin>>S[y][xa];
      |                                           ^~
      |                                           x
Language: C++

#include <iostream>
using namespace std;

int main()
{
  while(true){
    int H;
    cin>>H;

    if(H==0)
    break;

    int S[10][5];
    for(int y=0; y<H;y++)
    for(int x=0;xA<5;x++)
    cin>>S[y][x];

    int sco=0;

    while(true){
      boolflg=false;

      for(int y=0;y<H;y++){
        int m=S[y][2];
        if(m==0)
        continue;

        if(S[y][0]==m&&S[y][1]==m){
          sco+=m*3;s[y][0]=s[y][1]=S[y][2];flg=true;
          if(S[y][3]==m){
            sco+=m;S[y][3]=0;
            if(S[y][4]==m){
              sco+=m;S[y][4]=0;
            }
          }
        }
        else if(S[y][1]==m&&S[y][3]==m){
          sco+=m*3;s[y][1]=S[y][2]=s[y][3];flg=true;
            if(S[y][4]==m){
              sco+=m;S[y][4]=0;
            }
        }
        else if(S[y][3]==m&&S[y][4]==m){
          sco+=m*3;s[y][2]=s[y][3]=S[y][4];flg=true;
        }
      }
    }

    if(!flg)
    break;

    for(int x=0;x<5;x++){
      for(int y=H-1;y>=0;y--){
        if(S[y][x]!=0)
        continue;

        for(int y2=y-1;y2>=0;y2--){
          if(S[y2][x]!=0){
            S[y][x]=S[y][x];S[y2][x]=0;break;
          }
        }
      }
    }
  }
    cout<<tmax<<endl;

  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'xA' was not declared in this scope; did you mean 'x'?
   15 |     for(int x=0;xA<5;x++)
      |                 ^~
      |                 x
a.cc:21:7: error: 'boolflg' was not declared in this scope; did you mean 'bool'?
   21 |       boolflg=false;
      |       ^~~~~~~
      |       bool
a.cc:29:20: error: 's' was not declared in this scope
   29 |           sco+=m*3;s[y][0]=s[y][1]=S[y][2];flg=true;
      |                    ^
a.cc:29:44: error: 'flg' was not declared in this scope
   29 |           sco+=m*3;s[y][0]=s[y][1]=S[y][2];flg=true;
      |                                            ^~~
a.cc:38:20: error: 's' was not declared in this scope
   38 |           sco+=m*3;s[y][1]=S[y][2]=s[y][3];flg=true;
      |                    ^
a.cc:38:44: error: 'flg' was not declared in this scope
   38 |           sco+=m*3;s[y][1]=S[y][2]=s[y][3];flg=true;
      |                                            ^~~
a.cc:44:20: error: 's' was not declared in this scope
   44 |           sco+=m*3;s[y][2]=s[y][3]=S[y][4];flg=true;
      |                    ^
a.cc:44:44: error: 'flg' was not declared in this scope
   44 |           sco+=m*3;s[y][2]=s[y][3]=S[y][4];flg=true;
      |                                            ^~~
a.cc:49:9: error: 'flg' was not declared in this scope
   49 |     if(!flg)
      |         ^~~
a.cc:65:11: error: 'tmax' was not declared in this scope; did you mean 'tm'?
   65 |     cout<<tmax<<endl;
      |           ^~~~
      |           tm
a.cc: At global scope:
a.cc:68:3: error: expected unqualified-id before 'return'
   68 |   return 0;
      |   ^~~~~~
a.cc:69:1: error: expected declaration before '}' token
   69 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

int main()
{
  while(true){
    int H;
    cin>>H;

    if(H==0)
    break;

    int S[10][5];
    for(int y=0; y<H;y++)
    for(int x=0;xA<5;x++)
    cin>>S[y][x];

    int sco=0;

    while(true){
      bool flg=false;

      for(int y=0;y<H;y++){
        int m=S[y][2];
        if(m==0)
        continue;

        if(S[y][0]==m&&S[y][1]==m){
          sco+=m*3;S[y][0]=S[y][1]=S[y][2];flg=true;
          if(S[y][3]==m){
            sco+=m;S[y][3]=0;
            if(S[y][4]==m){
              sco+=m;S[y][4]=0;
            }
          }
        }
        else if(S[y][1]==m&&S[y][3]==m){
          sco+=m*3;S[y][1]=S[y][2]=S[y][3];flg=true;
            if(S[y][4]==m){
              sco+=m;S[y][4]=0;
            }
        }
        else if(S[y][3]==m&&S[y][4]==m){
          sco+=m*3;S[y][2]=S[y][3]=S[y][4];flg=true;
        }
      }
    }

    if(!flg)
    break;

    for(int x=0;x<5;x++){
      for(int y=H-1;y>=0;y--){
        if(S[y][x]!=0)
        continue;

        for(int y2=y-1;y2>=0;y2--){
          if(S[y2][x]!=0){
            S[y][x]=S[y][x];S[y2][x]=0;break;
          }
        }
      }
    }
  }
    cout<<sco<<endl;

  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'xA' was not declared in this scope; did you mean 'x'?
   15 |     for(int x=0;xA<5;x++)
      |                 ^~
      |                 x
a.cc:49:9: error: 'flg' was not declared in this scope
   49 |     if(!flg)
      |         ^~~
a.cc:65:11: error: 'sco' was not declared in this scope
   65 |     cout<<sco<<endl;
      |           ^~~
a.cc: At global scope:
a.cc:68:3: error: expected unqualified-id before 'return'
   68 |   return 0;
      |   ^~~~~~
a.cc:69:1: error: expected declaration before '}' token
   69 | }
      | ^
Language: C++

#include<iostream>
using namespace std;

int main(){
 while(true){
  int H;
  cin >> H;
  
  if(H==0) break;

  int S[H][5]; //盤面
  for(int y=0; y<H; y++){
   for(int x=0; x<5; x++){
    cin >> S[y][x];
   }
  } 

  int sco = 0; //スコア

  while(ture){
   bool flag = false;
   
   //消滅
   for(int y=0; y<H; y++){
    int m = S[y][2]; //消滅の際、真ん中のマスは必ず使用される。
    if(m==0)
     continue; //このループ内の以下の部分をスキップして文の始めに戻る。
    
    if(S[y][0]==m && S[y][1]==m){ //0～2が同じ
     sco += m*3;
     S[y][0] = S[y][1] = S[y][2] = 0;
     flag = true;

     if(S[y][3]==m){ //3も同じ
      sco += m;
      S[y][3] = 0;

      if(S[y][4]==m){ //3も同じかつ4も同じ
       sco += m;
       S[y][4] = 0;
      }
     }
    }

    else if(S[y][1]==m && S[y][3]==m){ //1～3が同じ
     sco += m*3;
     S[y][1] = S[y][2] = S[y][3] = 0;
     flag = true;
  
     if(S[y][4]==m){ //4も同じ
      sco += m;
      S[y][4] = 0;
     }
    }
     
    else if(S[y][3]==m && S[y][4]==m){
     sco += m*3;
     S[y][2] = S[y][3] = S[y][4] = 0;
     flag = true;
    }
   }

   if(!flag) break; //消滅しなかった場合、落下処理を行わない。

   //落下
   for(int x=0; x<5; x++){
    for(int y=H-1; y>=0; y--){
     if(S[y][x]!=0)
      continue;
     
     for(int y2=y-1; y2>=0; y2--){ //空きより上を探す。
      if(S[y2][x]!=0){
       S[y][x] = S[y2][x];
       S[y2][x] = 0;
       break;
      }
     }
    
    }
   }
  }
  cout << sco << endl;
 }
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'ture' was not declared in this scope
   20 |   while(ture){
      |         ^~~~
Language: C++

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

#include "../dump.hpp"

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

int main(){
  while(1){
    int h; cin >> h; if(h == 0) break;
    
    vector<deque<int>> stone(5, deque<int>(h));
    rep(j, h) rep(i, 5) cin >> stone[i][j]; // j = 0が天井, h-1が底
    
    int ans = 0;
    while(1){
      int tmp = ans;
      rep(j, h){ // 上から見る
	int l = 0, r = 1; // [l, r) : 同じ数字が並ぶ区間
	rep(i,4){
	  if(stone[i][j] == stone[i+1][j]){
	    r++;
	  }else{
	    if(r - l >= 3) break;
	    l = i + 1;
	    r = i + 2;
	  }
	}
	
	if(stone[l][j] != -1 and r - l >= 3){
	  FOR(i, l, r){
	    ans += stone[i][j];
	    stone[i].erase(stone[i].begin() + j); // 消して
	    stone[i].push_front(-1); // 上に詰める
	  }
	}
      }
      if(tmp == ans) break;
    }
    cout << ans << endl;
  }
}


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

#include "bits/stdc++.h"

using namespace std;

int N,M,K,L,R,H,W;

const long long int MOD=1000000007;



int main(){
	
	long double radius;
	vector<long double>ans;
	cout<<setprecision(20);
	while(cin>>radius>>N,r>0.5){
		vector<int>l(100);
		vector<int>r(100);
		for(int i=0;i<N;i++){
			cin>>L>>R>>K;
			r[L+50]=max(r[L+50],K);
			l[R+50]=max(l[R+50],K);
			for(int j=L+51;j<R+50;j++){
				r[j]=max(r[j],K);
				l[j]=max(l[j],K);
			}
		}
		long double ret=100;
		for(int i=-radius+1;i<radius;i++){
			long double h=min(r[i+50],l[i+50]);
			long double amari=radius*radius;
			amari-=i*i;
			amari=sqrt(amari);
			amari-=radius;
			ret=min(ret,h-amari);
		}
		ans.push_back(ret);
	}
	for(auto i:ans)cout<<i<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:30: error: 'r' was not declared in this scope
   16 |         while(cin>>radius>>N,r>0.5){
      |                              ^
Language: C++

#include <cstdlib>
#include <iostream>
#include <unordered_map>
using namespace std;

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

template<class T> inline void chmax(T &a, const T &b) { if(a < b) a = b; }
template<class T> inline void chmin(T &a, const T &b) { if(a > b) a = b; }

int main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout.setf(ios::fixed);
	cout.precision(10);

	constexpr int MAX_H = 20;

	for(int r, n; cin >> r >> n && r;) {
		unordered_map<int, int> max_height;

		rep(i, n) {
			int xl, xr, h;
			cin >> xl >> xr >> h;
			REP(x, xl, xr) {
				chmax(max_height[x], h);
			}
		}

		double ans = MAX_H;
		REP(i, -r, r) {
			const int h = max_height[i] + r;
			const int x = (i < 0 ? i + 1 : i);
			const double y = sqrt(r * r - x * x);
			chmin(ans, h - y);
		}

		cout << ans << endl;
	}

	return EXIT_SUCCESS;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:42: error: 'sqrt' was not declared in this scope
   35 |                         const double y = sqrt(r * r - x * x);
      |                                          ^~~~
Language: C++

#include <iostream>
#include <cmath>
#include <map>
using namespace std;
int r,n,L,R,h,i,x;int main(){while(cin>>r>>n,r){map<int,int> A,B;for(i=0;i<n;i++){cin>>L>>R>>h;for(x=L;x<=R;x++){if(x!=R)A[x]=max(A[x],h);if(x!=L)B[x]=max(B[x],h);}}float res=99;for(i=-r;i<=r-1;i++){res=min(res,min(r-sqrt(r*r-i*i)+A[i],r-sqrt(r*r-(i+1)*(i+1))+B[i+1]));}cout<<res<<"\n";}}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:207: error: no matching function for call to 'min(float&, const double&)'
    5 | int r,n,L,R,h,i,x;int main(){while(cin>>r>>n,r){map<int,int> A,B;for(i=0;i<n;i++){cin>>L>>R>>h;for(x=L;x<=R;x++){if(x!=R)A[x]=max(A[x],h);if(x!=L)B[x]=max(B[x],h);}}float res=99;for(i=-r;i<=r-1;i++){res=min(res,min(r-sqrt(r*r-i*i)+A[i],r-sqrt(r*r-(i+1)*(i+1))+B[i+1]));}cout<<res<<"\n";}}
      |                                                                                                                                                                                                            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:5:207: note:   deduced conflicting types for parameter 'const _Tp' ('float' and 'double')
    5 | int r,n,L,R,h,i,x;int main(){while(cin>>r>>n,r){map<int,int> A,B;for(i=0;i<n;i++){cin>>L>>R>>h;for(x=L;x<=R;x++){if(x!=R)A[x]=max(A[x],h);if(x!=L)B[x]=max(B[x],h);}}float res=99;for(i=-r;i<=r-1;i++){res=min(res,min(r-sqrt(r*r-i*i)+A[i],r-sqrt(r*r-(i+1)*(i+1))+B[i+1]));}cout<<res<<"\n";}}
      |                                                                                                                                                                                                            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

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

double r;

double calc(int x, int h){
     return h-sqrt(pow(r,2)-pow(x,2))+r;
}

int main(){
    int n;
    int map[50];
    while(cin>>r>>n,r!=0){
        fill(map, map+50,0);
        int xl,xr,h;
        for(int i=0;i<n;i++){
            cin>>xl>>xr>>h;
            for(int x=xl;x<xr;x++){
                if(map[x+25]<h)map[x+25]=h;
            }
        }
        double ans=calc(0,map[25]);
        for(int x=floor(-r)+1;x<=ceil(r)-1;x++){
            ans=min({ans,calc(x,map[25+x-1]),calc(x,map[25+x])});
        }
        cout.precision(8);
        cout<<fixed;
        cout<<ans<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:20: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
   25 |             ans=min({ans,calc(x,map[25+x-1]),calc(x,map[25+x])});
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 1 provided
Language: C++

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

int main(){
  int n, r, h, V[41], xl, xr;
  double ans;
  while(cin >> r >> n, r){
    for(int i = 0; i < 41; ++i) V[i] = 0;
    ans = 20.0;
    for(int i = 0; i < n; ++i){
      cin >> xl >> xr >> h;
      for(int j = xl; j < xr; ++j){
	if(j > r) break;
	V[j+r] = max(h, V[j+r]);
      }
      if(xr == r) V[2*r] = max(V[2*r],h);
    }
    for(int i = 0; i < 2*r+1; ++i){
      ans = min(ans, V[i] + r - sqrt(r*r - (i-r)*(i-r)));
      if(i+1-r <= r) ans = min(ans, V[i] + r - sqrt(r*r - (i+1-r)*(i+1-r)));
    }
    printf("%.4lf\n", ans);
  }			     
  return 0;
}
 #include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;

int main(){
  int n, r, h, V[41], xl, xr;
  double ans;
  while(cin >> r >> n, r){
    for(int i = 0; i < 41; ++i) V[i] = 0;
    ans = 20.0;
    for(int i = 0; i < n; ++i){
      cin >> xl >> xr >> h;
      for(int j = xl; j < xr; ++j){
	if(j > r) break;
	V[j+r] = max(h, V[j+r]);
      }
      if(xr == r) V[2*r] = max(V[2*r],h);
    }
    for(int i = 0; i < 2*r+1; ++i){
      ans = min(ans, V[i] + r - sqrt(r*r - (i-r)*(i-r)));
      if(i+1-r <= r) ans = min(ans, V[i] + r - sqrt(r*r - (i+1-r)*(i+1-r)));
    }
    printf("%.4lf\n", ans);
  }			     
  return 0;
}

Compiler output:
a.cc:33:5: error: redefinition of 'int main()'
   33 | int main(){
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main(){
      |     ^~~~
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
double w[2][44];
double s[44];
int r;
int n;
int x1, x2, h;
double nkr;
double a[3];

main(){
	while (cin >> r >> n, r || n){
		nkr = -1;
		for (int i = 0; i<2; i++)for (int j = 0; j<44; j++) w[i][j] = 0;

		for (int i = 0; i<n; i++){
			cin >> x1 >> x2 >> h;

			if (w[0][x2 + 20]<h || w[0][x2 + 20] == 0) w[0][x2 + 20] = h;
			if (w[1][x1 + 20]<h || w[1][x1 + 20] == 0) w[1][x1 + 20] = h;
			for (int j = x1 + 21; j<x2 + 20; j++){
				if (w[0][j]<h || w[0][j] == 0) w[0][j] = h;
				if (w[1][j]<h || w[1][j] == 0) w[1][j] = h;
			}

		}

		nkr = w[1][20 - r] + r;
		for (int i = r*(-1) + 1; i<r; i++){
			s[i + 20] = sqrt(r*r - i*i) - r;
			if (w[0][i + 20] - s[i + 20]<nkr) nkr = w[0][i + 20] - s[i + 20];
			if (w[1][i + 20] - s[i + 20]<nkr) nkr = w[1][i + 20] - s[i + 20];
		}
		if (w[0][20 + r] + r<nkr) nkr = w[0][20 + r] + r;



		printf("%.4f\n", nkr);
	}
}

Compiler output:
a.cc:12:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   12 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:31:37: error: 'sqrt' was not declared in this scope
   31 |                         s[i + 20] = sqrt(r*r - i*i) - r;
      |                                     ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <cstring>
#include <cmath>
#include <algorithm>
#undef max
#undef min

bool field[41][22] = {false};
bool field2[20][22] = { false };
constexpr int SUN_OFFSET_X = 20;
int main() {
	int r, n;
	while (std::cin >> r >> n && (r || n)) {
		std::memset(field, false, sizeof(bool) * 41 * 22);
		std::memset(field2, false, sizeof(bool) * 20 * 22);
		for (int i = 0; i < n; i++) {
			int x[2], h;
			std::cin >> x[0] >> x[1] >> h;
			x[0] += SUN_OFFSET_X; x[1] += SUN_OFFSET_X;
			//?????§???????????¶???
			for (int j = 0; j < h; j++) {
				for (int k = x[0]; k < x[1]; k++) {
					field[k][j] = true;
				}
			}
		}
		
		std::vector<double> circleHeights;
		for (int i = 0; i < 20; i++) {
			//?°??????????????????????x?????????????????£????????????????????????????????¨??????????????????
			for (int j = 0; j < 21; j++) {
				field2[19 - i][j] = field[i][j] && field[39 - i][j];
			}
		}

		for (int i = 0; i < r; i++) {
			//?????????????????????x??§???y=0?????????????¢????
			//h^2 + i^2 = r^2 
			//h^2 = r^2 - i^2
			circleHeights.push_back(-r + std::sqrt(r  * r - i * i));
		}

		std::vector<int> heights;
		for (int i = 0; i < r; i++) {
			int h = 0;
			for (h = 0; h < 21; h++) {
				if (!field2[i][h]) break;
			}
			heights.push_back(h);
		}

		//??¢???
		double y = -0.001;
		bool isOk = false;
		double cy = 0;
		for (int i = 0; i < 21 && !isOk; i++) {
			double dy = 0;
			for (int j = 0; j < circleHeights.size(); j++) {
				double tmp = heights[j] - circleHeights[i] - y;
				if (tmp > 0) dy = std::min(dy == 0 ? INT_MAX : dy, tmp);
			}
			if (!dy) dy = 1;

			y += dy;
			//?????£???????????°????????¢???
			for (int j = 0; j < circleHeights.size(); j++) {
				//??????x??§??¢?????????????????????
				if (std::abs(heights[j] - (circleHeights[j] + y)) < 0.001) {
					isOk = true;
				}
			}
		}
		std::cout << y << std::endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:70: error: 'INT_MAX' was not declared in this scope
   61 |                                 if (tmp > 0) dy = std::min(dy == 0 ? INT_MAX : dy, tmp);
      |                                                                      ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include <algorithm>
  +++ |+#include <climits>
    6 | #undef max
Language: C++

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

#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define abs(a) max((a),-(a))
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repe(i,n) rep(i,(n)+1)
#define per(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define pere(i,n) rep(i,(n)+1)
#define all(x) (x).begin(),(x).end()
#define SP <<" "<<
#define RET return 0
#define MOD 1000000007
#define INF 1000000000000000000

typedef long long LL;
typedef long double LD;

int main(){
  while(1){
    string s;
    cin >> s;
    if(s=="#") return 0;
    set<pair<string,int>> se;
    se.insert({s,0});
    string u;
    bool okflag,henflag;
    int pos;
    for(char i='a';i<='z';i++){
      // cout << i << endl;
      list<pair<string,int>> add;
      for(auto t:se){
        // cout << t.first << endl;
        pos=-1;
        okflag=false,henflag=false;
        if(i=='a') okflag=true;
        for(int j=0;j<s.length();j++){
          if(t.first[j]==i){
            if(t.second&(1<<j)){
              if(pos==-1) okflag=true,pos=j;
            }else{
              if(!okflag){
                if(!henflag){
                  if(i=='z') goto next;
                  t.first[j]=i+1;
                  t.second|=(1<<j);
                  henflag=true;
                }else{
                  goto next;
                }
              }
            }
          }
        }
        // cout << t.first << endl;
        add.push_back(t);
        if((!henflag)&&okflag){
          for(int j=pos+1;j<s.length();j++){
            if(t.first[j]==i){
              u=t.first;
              u[j]=i+1;
              add.push_back({u,t.second|(1<<j)});
            }
          }abcdefghijklmnopqrst
        }
        next:
        continue;
      }
      se.clear();
      for(auto t:add){
        se.insert(t);
      }
    }
    cout << se.size() << endl;
    if(se.size()<=10){
      for(auto t:se){
        cout << t.first << endl;
      }
    }else{
      int c=0;
      for(auto t=se.begin();t!=se.end();t++,c++){
        cout << t->first << endl;
        if(c>=4) break;
      }
      for(auto t=next(se.end(),-5);t!=se.end();t++){
        cout << t->first << endl;
      }
    }
  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:65:12: error: 'abcdefghijklmnopqrst' was not declared in this scope
   65 |           }abcdefghijklmnopqrst
      |            ^~~~~~~~~~~~~~~~~~~~
Language: C++

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

int cnt;
set<string> ans;

int rec(string s,int pos,bool u[26]){
  if(pos==s.length()){
    ans.insert(s);
    return 0;
  }
  bool used[26];
  for(int i=0;i<26;i++) used[i]=u[i];
  if(s[pos]=='a'){
    used[0]=true;
    rec(s,pos+1,used);
    used[0]=false;
    used[1]=true;
    s[pos]++;
    rec(s,pos+1,used);
  }else if(s[pos]=='z'){
    if(used[25]==false){
      return 0;
    }else{
      rec(s,pos+1,used);
    }
  }else if(used[s[pos]-'a']==true){
    rec(s,pos+1,used);
    used[s[pos]-'a'+1]=true;
    s[pos]++;
    rec(s,pos+1,used);
  }else{
    used[s[pos]-'a'+1]=true;
    s[pos]++;
    rec(s,pos+1,used);
  }
  return 0;
}

int main(){
  string s;
  while(cin>>s){
    ans.clear();
    cnt = 0;
    if(s=="#")break;
    bool used[26];
    memset(used,0,sizeof(used));
    rec(s,0,used);
    cout << ans.size() << endl;
    for(auto i:ans){
      if(cnt<5){
	cout << i << endl;
	}else if(cnt>ans.size()-6){
	cout << i << endl;
      }
      cnt++;
    }
  }
  return 0;
}

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

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <numeric>
#include <cctype>
#include <tuple>
#include <array>
#include <climits>
#include <bitset>
#include <cassert>

// BEGIN CUT HERE
#ifdef _MSC_VER
#include <agents.h>
#define __float128 long double
#endif
// END CUT HERE 

#define FOR(i, a, b) for(int i = (a); i < (int)(b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define REV(v) v.rbegin(), v.rend()
#define MEMSET(v, s) memset(v, s, sizeof(v))
#define UNIQUE(v) (v).erase(unique(ALL(v)), (v).end())
#define MP make_pair
#define MT make_tuple

using namespace std;

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

string s;
const int N = 1 << 21;
string v[N];

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

	while (cin >> s, s != "#"){
		string org = s;
		int idx = 0;

		int n = s.size();
		rep(i, 1 << n){
			rep(j, n){
				if (i >> j & 1) s[j] = org[j] + 1;
				else s[j] = org[j];

				if (s[j] > 'z') {
					i += (1 << j) - 1;
					goto nxt;
				}
			}
			string t = s;
			int used[26] = {};
			used[0] = 1;
			for (auto &c : t){
				if (used[c - 'a']) continue;
				used[c - 'a'] = 1;
				--c;
			}
			if (org == t) v[idx++] = s;
		nxt:;
		}

		sort(v, v + idx);
		cout << idx << '\n';

		if (idx <= 10){
			rep(i, idx){
				cout << v[i] << '\n';
			}
		}
		else{
			rep(i, 5){
				cout << v[i] << '\n';
			}
			FOR(i, idx - 5, idx){
				cout << v[i] << '\n';
			}
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:75:17: error: jump to label 'nxt'
   75 |                 nxt:;
      |                 ^~~
a.cc:63:46: note:   from here
   63 |                                         goto nxt;
      |                                              ^~~
a.cc:67:29: note:   crosses initialization of 'int used [26]'
   67 |                         int used[26] = {};
      |                             ^~~~
a.cc:66:32: note:   crosses initialization of 'std::string t'
   66 |                         string t = s;
      |                                ^