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

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

int main() {

  while( true ) {

    long long int n;
    cin >> n;
    if ( n == 0 ) break;

    vector< string > v;

    long long int m = 0;

    for ( long long int i = 0; i < n; i++ ) {

      string in;
      cin >> in;
      for ( long long int j = 0; j < in.size(); j++ ) {
	if ( in[j] == '.' ) {
	  in[j] = ' ';
	}else {
	  if ( j != 0 ) in[j-1] = '+';
	  break;
	}
      }
      v.push_back( in );
      m = max( 1 * m, 1 * in.size() );

    }

    for ( long long int x = 0; x < m; x++ ) {
      bool f = false;
      for ( long long int i = n - 1; i >= 0; i-- ) {
	if ( x < v[i].size() ) {
	  if ( v[i][x] == '+' ) {
	    f = true;
	  }else if ( v[i][x] == ' ' ) {
	    if ( f == true ) {
	      v[i][x] = '|';
	    }
	  }else {
	    f = false;
	  }
	}
      }
    }

    for ( long long int i = 0; i < n; i++ ) {
      cout << v[i] << endl;
    }

  }

  return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:14: error: no matching function for call to 'max(long long int, std::__cxx11::basic_string<char>::size_type)'
   31 |       m = max( 1 * m, 1 * in.size() );
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~
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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:31:14: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
   31 |       m = max( 1 * m, 1 * in.size() );
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

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

int main() {

  while( true ) {

    long long int n;
    cin >> n;
    if ( n == 0 ) break;

    vector< string > v;

    long long int m = 0;

    for ( long long int i = 0; i < n; i++ ) {

      string in;
      cin >> in;
      for ( long long int j = 0; j < in.size(); j++ ) {
	if ( in[j] == '.' ) {
	  in[j] = ' ';
	}else {
	  if ( j != 0 ) in[j-1] = '+';
	  break;
	}
      }
      v.push_back( in );
      m = max( 1LL * m, 1LL * in.size() );

    }

    for ( long long int x = 0; x < m; x++ ) {
      bool f = false;
      for ( long long int i = n - 1; i >= 0; i-- ) {
	if ( x < v[i].size() ) {
	  if ( v[i][x] == '+' ) {
	    f = true;
	  }else if ( v[i][x] == ' ' ) {
	    if ( f == true ) {
	      v[i][x] = '|';
	    }
	  }else {
	    f = false;
	  }
	}
      }
    }

    for ( long long int i = 0; i < n; i++ ) {
      cout << v[i] << endl;
    }

  }

  return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:14: error: no matching function for call to 'max(long long int, long long unsigned int)'
   31 |       m = max( 1LL * m, 1LL * in.size() );
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:31:14: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int')
   31 |       m = max( 1LL * m, 1LL * in.size() );
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

browser=webdriver.Chrome('./chromedriver')

Compiler output:
a.cc:1:26: warning: multi-character literal with 14 characters exceeds 'int' size of 4 bytes
    1 | browser=webdriver.Chrome('./chromedriver')
      |                          ^~~~~~~~~~~~~~~~
a.cc:1:1: error: 'browser' does not name a type
    1 | browser=webdriver.Chrome('./chromedriver')
      | ^~~~~~~
Language: C++

#?????????????????¨?§?
    browser.get()

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #?
    1 | #?????????????????¨?§?
      |  ^
a.cc:1:21: error: extended character § is not valid in an identifier
    1 | #?????????????????¨?§?
      |                     ^
a.cc:2:5: error: 'browser' does not name a type
    2 |     browser.get()
      |     ^~~~~~~
Language: C++

#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);

signed main() {
	int n;
	while (cin >> n, n) {
		cout << n << endl;
		vector<string>v(n);
		rep(i, 0, n) {
			cin >> v[i];
			int cnt(0);
			rep(j, 0, v[i].size()) {
				if (v[i][j] == '.') {
					v[i][j] = ' ';
					cnt++;
				}#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);

signed main() {
	int n;
	while (cin >> n, n) {
		vector<string>v(n);
		rep(i, 0, n) {
			cin >> v[i];
			int cnt(0);
			rep(j, 0, v[i].size()) {
				if (v[i][j] == '.') {
					v[i][j] = ' ';
					cnt++;
				}
			}
			if (cnt&&i) {
				v[i][cnt - 1] = '+';
				for (int j = i-1; j >= 0 && cnt -1 <v[j].length(); j--) {
					if (v[j][cnt - 1] == ' ')v[j][cnt - 1] = '|';
					else break;
				}
			}
		}
		rep(i, 0, n)cout << v[i] << endl;
	}
	return 0;
}
			}
			if (cnt&&i) {
				v[i][cnt - 1] = '+';
				for (int j = i-1; j >= 0 && cnt -1 <v[j].length(); j--) {
					if (v[j][cnt - 1] == ' ')v[j][cnt - 1] = '|';
				}
			}
		}
		rep(i, 0, n)cout << v[i] << endl;
	}
	return 0;
}

Compiler output:
a.cc:28:34: error: stray '#' in program
   28 |                                 }#define _USE_MATH_DEFINES
      |                                  ^
a.cc: In function 'int main()':
a.cc:28:35: error: 'define' was not declared in this scope
   28 |                                 }#define _USE_MATH_DEFINES
      |                                   ^~~~~~
a.cc:43:12: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   43 | signed main() {
      |            ^~
a.cc:43:12: note: remove parentheses to default-initialize a variable
   43 | signed main() {
      |            ^~
      |            --
a.cc:43:12: note: or replace parentheses with braces to value-initialize a variable
a.cc:43:15: error: a function-definition is not allowed here before '{' token
   43 | signed main() {
      |               ^
Language: C++

#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);

signed main() {
	int n;
	while (cin >> n, n) {
		vector<string>v(n);
		rep(i, 0, n) {
			cin >> v[i];
			int cnt(0);
			rep(j, 0, v[i].size()) {
				if (v[i][j] == '.') {
					v[i][j] = ' ';
					cnt++;
				}
			}#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);

signed main() {
	int n;
	while (cin >> n, n) {
		vector<string>v(n);
		rep(i, 0, n) {
			cin >> v[i];
			int cnt(0);
			rep(j, 0, v[i].size()) {
				if (v[i][j] == '.') {
					v[i][j] = ' ';
					cnt++;
				}
			}
			if (cnt&&i) {
				v[i][cnt - 1] = '+';
				for (int j = i-1; j >= 0 && cnt -1 <v[j].length(); j--) {
					if (v[j][cnt - 1] == ' ')v[j][cnt - 1] = '|';
					else break;
				}
			}
		}
		rep(i, 0, n)cout << v[i] << endl;
	}
	return 0;
}
			if (cnt&&i) {
				v[i][cnt - 1] = '+';
				for (int j = i-1; j >= 0 && cnt -1 <v[j].length(); j--) {
					if (v[j][cnt - 1] == ' ')v[j][cnt - 1] = '|';
					else break;
				}
			}
		}
		rep(i, 0, n)cout << v[i] << endl;
	}
	return 0;
}

Compiler output:
a.cc:28:26: error: stray '#' in program
   28 |                         }#define _USE_MATH_DEFINES
      |                          ^
a.cc: In function 'int main()':
a.cc:28:27: error: 'define' was not declared in this scope
   28 |                         }#define _USE_MATH_DEFINES
      |                           ^~~~~~
a.cc:43:12: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   43 | signed main() {
      |            ^~
a.cc:43:12: note: remove parentheses to default-initialize a variable
   43 | signed main() {
      |            ^~
      |            --
a.cc:43:12: note: or replace parentheses with braces to value-initialize a variable
a.cc:43:15: error: a function-definition is not allowed here before '{' token
   43 | signed main() {
      |               ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int cnt[60],n;
	string s[1010],z;
	while(cin>>n&&n){
	cin>>z;cout<<z<<endl;n--;
	memset(cnt,-1,sizeof(cnt));
	for(int i=0;i<n;i++){
		cin>>s[i];
		int k=0;
		for(int j=s[i].size()-1;j>=0;j--){
			if(s[i][j]=='.')s[i][j]=' ';
			else k=j-1;
		}
		for(int j=k+1;j<60;j++)cnt[j]=-1;
		if(cnt[k]!=-1){
			for(int j=cnt[k]+1;j<i;j++)s[j][k]='|';
			
		}
		s[i][k]='+';cnt[k]=i;
	}
	for(int i=0;i<n;i++)cout<<s[i]<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'memset' was not declared in this scope
    9 |         memset(cnt,-1,sizeof(cnt));
      |         ^~~~~~
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 | using namespace std;
Language: C++

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

using namespace std;

int calcLevel(const string _str)
{
	int level = 0;
	for(const auto& c : _str)
	{
		if(c == '.')++level;
		else break;
	}
	return level;
}


int main()
{
	int n;
	while(cin >> n, n != 0)
	{
		vector<string> ans;
		ans.reserve(n);

		int postLevel = 0;

		for(int i = 0; i < n; ++i)
		{
			string input;
			cin >> input;

			int level = calcLevel(input);

			if(level > 0)
			{
				replace(input.begin(), input.end(), '.', ' ');	
				input[level - 1] = '+';
			}
			ans.push_back(input);

			if(level < postLevel)
			{
				for(int index = i-1; index >= 0; --index)
				{
					if(ans[index][level - 1] == ' ')ans[index][level - 1] = '|';
					else break;
				}
			}

			postLevel = level;

		}

		for(const auto& v : ans)
		{
			cout << v << endl;
		}
	}




}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:33: error: 'replace' was not declared in this scope
   38 |                                 replace(input.begin(), input.end(), '.', ' ');
      |                                 ^~~~~~~
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define mod 1000000007
#define all(c) begin(c),end(c)
template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
using ll = long long;
using vi = vector<int>; using vs = vector<string>;
int dd[] = { 0, 1, 0, -1, 0 }; //→↓←↑

void solve()
{
	int N;
	vi B;
	vi A;
	vs S);
	while (cin >> N, N)
	{
		B = vi(51, -1);
		A = vi(N);
		S = vi(N);
		for (int i = 0; i < N; i++)
		{
			cin >> S[i];
			for (int j = 0; j < S[i].size(); j++)
			{
				if (S[i][j] != '.')
				{
					A[i] = j;
					if (j > 0)S[i][j - 1] = '+';
					break;
				}
				else
				{
					S[i][j] = ' ';
				}
			}
			if (B[A[i]] >= 0)
			{
				for (int j = B[A[i]] + 1; j < i; j++)
				{
					S[j][A[i] - 1] = '|';
				}
			}
			else
			{
				B[A[i]] = i;
			}
		}
		for (int i = 0; i < N; i++)
		{
			cout << S[i] << endl;
		}
	}
}


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


Compiler output:
a.cc: In function 'void solve()':
a.cc:16:13: error: expected initializer before ')' token
   16 |         vs S);
      |             ^
a.cc:21:17: error: 'S' was not declared in this scope
   21 |                 S = vi(N);
      |                 ^
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define mod 1000000007
#define all(c) begin(c),end(c)
template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
using ll = long long;
using vi = vector<int>; using vs = vector<string>;
int dd[] = { 0, 1, 0, -1, 0 }; //→↓←↑

void solve()
{
	int N;
	while (cin >> N, N)
	{
		vi Bi(N + 1100, -1);
		vi A(N);
		vs S(N);
		for (int i = 0; i < N; i++)
		{
			cin >> S[i];
			for (int j = 0; j < S[i].size(); j++)
			{
				if (S[i][j] != '.')
				{
					A[i] = j;
					if (j > 0)S[i][j - 1] = '+';
					break;
				}
				else
				{
					S[i][j] = ' ';
				}
			}
			if (B[A[i]] >= 1)
			{
				bool flag = true;
				for (int j = B[A[i]] + 1; j < i; j++)
				{
					if (A[j] < A[i])flag = false;
				}
				if (flag)
				{
					for (int j = B[A[i]] + 1; j < i; j++)
					{
						S[j][A[i] - 1] = '|';
					}
				}
			}
			B[A[i]] = i;
		}
		for (int i = 0; i < N; i++)
		{
			cout << S[i] << endl;
		}
	}
}


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


Compiler output:
a.cc: In function 'void solve()':
a.cc:35:29: error: 'B' was not declared in this scope
   35 |                         if (B[A[i]] >= 1)
      |                             ^
a.cc:50:25: error: 'B' was not declared in this scope
   50 |                         B[A[i]] = i;
      |                         ^
Language: Java

while True:
    s = input()
    if s == '.':break
    while True:
        if s.find('+') == -1 and s.find('-') == -1:
            index = s.rfind('[')
            if index == -1:break
            e = s.find(']', index)
            s = s[:index] + s[index + 1:e][::-1] + s[e + 1:]
        else:
            index = s.find('+')
            if index == -1:
                index = s.find('-')
            if s.find('-') != -1:
                index = min(index, s.find('-'))
            e = index
            f = 0
            while s[e] == '+' or s[e] == '-':
                f += [-1, 1][s[e] == '+']
                e += 1
            r = s[e]
            if r != '?':
                r = chr((ord(r) - ord('A') + f) % 26 + ord('A'))
            s = s[:index] + r + s[e + 1:]
    print(s.replace('?', 'A'))


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

#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<vector>
#include<set>
#include<list>
#include<queue>
#include<cmath>
#include<functional>
#include<algorithm>
#define INF (1<<29)
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;




string form(string &s){
	string res;
	int p=0,m=0;
	rep(i,s.size()){
		if(s[i]=='+')p++;
		else if(s[i]=='-')m++;
		else if(isalnum(s[i])){
			res+=(s[i]-'A'+p-m+26*100)%26+'A';
			p=m=0;
		}
		else if(s[i]=='?'){
			res+='?';
			p=m=0;
		}
		else res+=s[i];
	}
	return res;
}

int p;
string rev(string &s){
	if(p==s.size())return "";
	string t;
	char c=s[p++];
	if(c=='['){
		t=rev(s);
		reverse(t.begin(),t.end());
		return t+rev(s);
	}else if(c==']'){
		return "";
	}else {
		return c+rev(s);
	}

}


int main(){
	int n;
	string s;
	while(cin>>s&&s!="."){
		p=0;
		string t=rev(form(s));
		rep(i,t.size())if(t[i]=='?')t[i]='A';
		cout<<t<<endl;

	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:62:34: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   62 |                 string t=rev(form(s));
      |                              ~~~~^~~
a.cc:40:20: note:   initializing argument 1 of 'std::string rev(std::string&)'
   40 | string rev(string &s){
      |            ~~~~~~~~^
Language: C++

#include<iostream>
#include<string>

using namespace std;

int main(){

	string sol[100];
	int nsol;
	string inp;
	int n;
	int c;

	while(1){

		cin>>inp;
		if(inp==".") break;

		n=0;
		c=0;
		for(int i=0;i<100;i++) sol[i]="";

		for(int i=0;i<inp.size();i++){
			switch(inp[i]){
			case '+':
				c++;
				break;
			case'-':
				c--;
				break;
			case'?':
				sol[n]+='A';
				c=0;
				break;
			case'[':
				n++;
				break;
			case']':
				reverse(sol[n].begin(),sol[n].end());
				sol[n-1]+=sol[n];
				sol[n]="";
				n--;
				break;
			default:
				nsol=(inp[i]-'A'+c)%26;
				if(nsol<0) nsol+=26;
				sol[n]+=nsol+'A';
				c=0;
				break;
			}
		}

		cout<<sol[0]<<endl;

	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:33: error: 'reverse' was not declared in this scope
   39 |                                 reverse(sol[n].begin(),sol[n].end());
      |                                 ^~~~~~~
Language: C++

#include<iostream>
#include<string>
#include<cstring>

using namespace std;

int main(){

	string sol[100];
	int nsol;
	string inp;
	int n;
	int c;

	while(1){

		cin>>inp;
		if(inp==".") break;

		n=0;
		c=0;
		for(int i=0;i<100;i++) sol[i]="";

		for(int i=0;i<inp.size();i++){
			switch(inp[i]){
			case '+':
				c++;
				break;
			case'-':
				c--;
				break;
			case'?':
				sol[n]+='A';
				c=0;
				break;
			case'[':
				n++;
				break;
			case']':
				reverse(sol[n].begin(),sol[n].end());
				sol[n-1]+=sol[n];
				sol[n]="";
				n--;
				break;
			default:
				nsol=(inp[i]-'A'+c)%26;
				if(nsol<0) nsol+=26;
				sol[n]+=nsol+'A';
				c=0;
				break;
			}
		}

		cout<<sol[0]<<endl;

	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:33: error: 'reverse' was not declared in this scope
   40 |                                 reverse(sol[n].begin(),sol[n].end());
      |                                 ^~~~~~~
Language: C++

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

using namespace std;

int main(){

	string sol[100];
	int nsol;
	string inp;
	int n;
	int c;

	while(1){

		cin>>inp;
		if(inp==".") break;

		n=0;
		c=0;
		for(int i=0;i<100;i++) sol[i]="";

		for(int i=0;i<inp.size();i++){
			switch(inp[i]){
			case '+':
				c++;
				break;
			case'-':
				c--;
				break;
			case'?':
				sol[n]+='A';
				c=0;
				break;
			case'[':
				n++;
				break;
			case']':
				reverse(sol[n].begin(),sol[n].end());
				sol[n-1]+=sol[n];
				sol[n]="";
				n--;
				break;
			default:
				nsol=(inp[i]-'A'+c)%26;
				if(nsol<0) nsol+=26;
				sol[n]+=nsol+'A';
				c=0;
				break;
			}
		}

		cout<<sol[0]<<endl;

	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:33: error: 'reverse' was not declared in this scope
   40 |                                 reverse(sol[n].begin(),sol[n].end());
      |                                 ^~~~~~~
Language: C++

#include <iostream>
#include<vector>
#include<string>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

int main(void){

	string g,h;
	int i = 0;
	vector<int>ireko;
	bool LeftKakko = false;
	int k = 0;
	while ((cin >> g), g != "."){
		REP(l, g.length()){
			char a = g[l];
			if (a == 43){ 
				i++; 
			}else if (a == 45){ 
				i--; 
			}else if (a == 91){ 
				ireko.push_back(k); 
			}else if (a == 93){  
				reverse(h.begin() + ireko.back(), h.end()); 
				ireko.pop_back(); 
			}else if (a == 63){ 
				h += 65;
				i = 0;
				++k; 
			}else{
				for (a += i; 64 >= a || a >= 91; (a >= 91) ? a -= 26 : a += 26){	
				}
				h.push_back(a);
				i = 0;
				++k;
			}
		}
		cout << h<<endl;
		h.erase();
		k = 0;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:33: error: 'reverse' was not declared in this scope
   24 |                                 reverse(h.begin() + ireko.back(), h.end());
      |                                 ^~~~~~~
Language: C++

#include <iostream>
#include<vector>
#include<string>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

int main(){

	string g,h;
	int i = 0;
	vector<int>ireko;
	bool LeftKakko = false;
	int k = 0;
	while ((cin >> g), g != "."){
		REP(l, g.length()){
			char a = g[l];
			if (a == 43){ 
				i++; 
			}else if (a == 45){ 
				i--; 
			}else if (a == 91){ 
				ireko.push_back(k); 
			}else if (a == 93){  
				reverse(h.begin() + ireko.back(), h.end()); 
				ireko.pop_back(); 
			}else if (a == 63){ 
				h += 65;
				i = 0;
				++k; 
			}else{
				for (a += i; 64 >= a || a >= 91; (a >= 91) ? a -= 26 : a += 26){	
				}
				h.push_back(a);
				i = 0;
				++k;
			}
		}
		cout << h<<endl;
		h.erase();
		k = 0;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:33: error: 'reverse' was not declared in this scope
   24 |                                 reverse(h.begin() + ireko.back(), h.end());
      |                                 ^~~~~~~
Language: C++

#include <iostream>
#include<vector>
#include<string>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

int main(){

	string g,h;
	int i = 0;
	vector<int>ireko;
	bool LeftKakko = false;
	int k = 0;
	while ((cin >> g), g != "."){
		REP(l, g.length()){
			char a = g[l];
			if (a == 43){ 
				i++; 
			}else if (a == 45){ 
				i--; 
			}else if (a == 91){ 
				ireko.push_back(k); 
			}else if (a == 93){  
				std::reverse(h.begin() + ireko.back(), h.end()); 
				ireko.pop_back(); 
			}else if (a == 63){ 
				h += 65;
				i = 0;
				++k; 
			}else{
				for (a += i; 64 >= a || a >= 91; (a >= 91) ? a -= 26 : a += 26){	
				}
				h.push_back(a);
				i = 0;
				++k;
			}
		}
		cout << h<<endl;
		h.erase();
		k = 0;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:38: error: 'reverse' is not a member of 'std'
   24 |                                 std::reverse(h.begin() + ireko.back(), h.end());
      |                                      ^~~~~~~
Language: C++

#include <iostream>
#include<vector>
#include<string>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
//using namespace std;

int main(){

	string g,h;
	int i = 0;
	std::vector<int>ireko;
	bool LeftKakko = false;
	int k = 0;
	while ((std::cin >> g), g != "."){
		REP(l, g.length()){
			char a = g[l];
			if (a == 43){ 
				i++; 
			}else if (a == 45){ 
				i--; 
			}else if (a == 91){ 
				ireko.push_back(k); 
			}else if (a == 93){  
				std::reverse(h.begin() + ireko.back(), h.end()); 
				ireko.pop_back(); 
			}else if (a == 63){ 
				h += 65;
				i = 0;
				++k; 
			}else{
				for (a += i; 64 >= a || a >= 91; (a >= 91) ? a -= 26 : a += 26){	
				}
				h.push_back(a);
				i = 0;
				++k;
			}
		}
		std::cout << h<<std::endl;
		h.erase();
		k = 0;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'string' was not declared in this scope
    9 |         string g,h;
      |         ^~~~~~
a.cc:9:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included 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:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:14:29: error: 'g' was not declared in this scope
   14 |         while ((std::cin >> g), g != "."){
      |                             ^
a.cc:24:38: error: 'reverse' is not a member of 'std'
   24 |                                 std::reverse(h.begin() + ireko.back(), h.end());
      |                                      ^~~~~~~
a.cc:24:46: error: 'h' was not declared in this scope
   24 |                                 std::reverse(h.begin() + ireko.back(), h.end());
      |                                              ^
a.cc:27:33: error: 'h' was not declared in this scope
   27 |                                 h += 65;
      |                                 ^
a.cc:33:33: error: 'h' was not declared in this scope
   33 |                                 h.push_back(a);
      |                                 ^
a.cc:38:30: error: 'h' was not declared in this scope
   38 |                 std::cout << h<<std::endl;
      |                              ^
Language: C++

#include <iostream>
#include<vector>
#include<string>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

int main(){

	string g,h;
	int i = 0;
	vector<int>ireko;
	bool LeftKakko = false;
	int k = 0;
	while ((std::cin >> g), g != "."){
		REP(l, g.length()){
			char a = g[l];
			if (a == 43){ 
				i++; 
			}else if (a == 45){ 
				i--; 
			}else if (a == 91){ 
				ireko.push_back(k); 
			}else if (a == 93){  
				std::reverse(h.begin() + ireko.back(), h.end()); 
				ireko.pop_back(); 
			}else if (a == 63){ 
				h += 65;
				i = 0;
				++k; 
			}else{
				for (a += i; 64 >= a || a >= 91; (a >= 91) ? a -= 26 : a += 26){	
				}
				h.push_back(a);
				i = 0;
				++k;
			}
		}
		cout << h<<endl;
		h.erase();
		k = 0;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:38: error: 'reverse' is not a member of 'std'
   24 |                                 std::reverse(h.begin() + ireko.back(), h.end());
      |                                      ^~~~~~~
Language: C++

#include <iostream>
#include<vector>
#include<string>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

int main(){

	string g,h;
	int i = 0;
	vector<int>ireko;
	bool LeftKakko = false;
	int k = 0;
	while ((std::cin >> g), g != "."){
		REP(l, g.length()){
			char a = g[l];
			if (a == 43){ 
				i++; 
			}else if (a == 45){ 
				i--; 
			}else if (a == 91){ 
				ireko.push_back(k); 
			}else if (a == 93){  
				reverse(h.begin() + ireko.back(), h.end()); 
				ireko.pop_back(); 
			}else if (a == 63){ 
				h += 65;
				i = 0;
				++k; 
			}else{
				for (a += i; 64 >= a || a >= 91; (a >= 91) ? a -= 26 : a += 26){	
				}
				h.push_back(a);
				i = 0;
				++k;
			}
		}
		cout << h<<endl;
		h.erase();
		k = 0;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:33: error: 'reverse' was not declared in this scope
   24 |                                 reverse(h.begin() + ireko.back(), h.end());
      |                                 ^~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <cctype>

using namespace std;

typedef string::const_iterator State;

string Cipher(State &begin, State &end);
string String(State &begin, State &end);
string Letter(State &begin);

string Cipher(State &begin, State &end)
{
    if (begin == end)
    {
        return "";
    }
    string ret;
    string str = String(begin, end);
    if (str.empty())
    {
        return "";
    }
    ret += str;
    ret += Cipher(begin, end);
    return ret;
}

string String(State &begin, State &end)
{
    string ret;
    if (*begin == '[')
    {
        ++begin;
        ret = Cipher(begin, end);
        reverse(ret.begin(), ret.end());
        ++begin;
    }
    else
    {
        ret = Letter(begin);
    }
    return ret;
}

string Letter(State &begin)
{
    int d = 0;

    while (true)
    {
        if (*begin == '+')
        {
            ++d;
        }
        else if (*begin == '-')
        {
            --d;
        }
        else
        {
            break;
        }
        ++begin;
    }

    int c = *begin;
    if (c == '?')
    {
        c = 'A';
    }
    else if (isupper(c))
    {
        d %= 26;
        c += d;
        if ('Z' < c)
        {
            c -= 26;
        }
        else if (c < 'A')
        {
            c += 26;
        }
    }
    else
    {
        return "";
    }

    ++begin;
    return string(1, c);
}

int main()
{
    string line;
    while (getline(cin, line))
    {
        cout << Cipher(line.begin(), line.end()) << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:101:34: error: cannot bind non-const lvalue reference of type 'State&' {aka 'std::__cxx11::basic_string<char>::const_iterator&'} to an rvalue of type 'State' {aka 'std::__cxx11::basic_string<char>::const_iterator'}
  101 |         cout << Cipher(line.begin(), line.end()) << endl;
      |                        ~~~~~~~~~~^~
In file included from /usr/include/c++/14/string:48,
                 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_iterator.h:1074:9: note:   after user-defined conversion: '__gnu_cxx::__normal_iterator<_Iterator, _Container>::__normal_iterator(const __gnu_cxx::__normal_iterator<_Iter, _Container>&) [with _Iter = char*; <template-parameter-2-2> = void; _Iterator = const char*; _Container = std::__cxx11::basic_string<char>]'
 1074 |         __normal_iterator(const __normal_iterator<_Iter, _Container>& __i)
      |         ^~~~~~~~~~~~~~~~~
a.cc:14:22: note:   initializing argument 1 of 'std::string Cipher(State&, State&)'
   14 | string Cipher(State &begin, State &end)
      |               ~~~~~~~^~~~~
Language: C++

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

string rev(string str){
    for(int i=0;i<str.length();i++){
        if(str[i]=='['){
            int j;
            int co=1;
            for(j=i+1;j<str.length();j++){
                if(str[j]=='[')co++;
                if(str[j]==']')co--;
                if(co==0)break;
            }
            string n=rev(str.substr(i+1,j-i-1));
            str=str.substr(0,i)+n+str.substr(j+1,str.length()-j-1);
        }
    }
    string tem="";
    for(int i=0;i<str.length();i++)
        tem+=str[str.length()-1-i];
    return tem;
}

string pm(string str){
    char c=str[str.length()-1];
    for(int i=0;i<str.length()-1;i++){
        if(str[i]=='+'){
            if(c=='Z')
                c='A';
            else c++;
        }
        if(str[i]=='-'){
            if(c=='A')
                c='Z';
            else c--;
        }
    }
    string tem="";
    tem+=c;
    return tem;
}

int main(){
    while(1){
        string str;
        cin>>str;
        if(str==".")break;
        for(int i=0;i<str.length();i++){
            if(str[i]=='+'||str[i]=='-'){
                int j;
                for(j=i+1;str[j]=='+'||str[j]=='-';j++);
                string n;
                if(str[j]=='?')n="A";
                else n=pm(str.substr(i,j-i+1));
                str=str.substr(0,i)+n+str.substr(j+1,str.length()-j-1);
            }
            if(str[i]=='?')n="A";
           // cout<<str<<endl;
        }
        for(int i=0;i<str.length();i++){
            if(str[i]=='['){
                int j;
                int co=1;
                for(j=i+1;j<str.length();j++){
                    if(str[j]=='[')co++;
                    if(str[j]==']')co--;
                    if(co==0)break;
                }
                string n=rev(str.substr(i+1,j-i-1));
                //cout<<n<<endl;
                str=str.substr(0,i)+n+str.substr(j+1,str.length()-j-1);
            }
        }
        cout<<str<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:28: error: 'n' was not declared in this scope
   58 |             if(str[i]=='?')n="A";
      |                            ^
Language: C++

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

string rev(string str){
    for(int i=0;i<str.length();i++){
        if(str[i]=='['){
            int j;
            int co=1;
            for(j=i+1;j<str.length();j++){
                if(str[j]=='[')co++;
                if(str[j]==']')co--;
                if(co==0)break;
            }
            string n=rev(str.substr(i+1,j-i-1));
            str=str.substr(0,i)+n+str.substr(j+1,str.length()-j-1);
        }
    }
    string tem="";
    for(int i=0;i<str.length();i++)
        tem+=str[str.length()-1-i];
    return tem;
}

string pm(string str){
    char c=str[str.length()-1];
    for(int i=0;i<str.length()-1;i++){
        if(str[i]=='+'){
            if(c=='Z')
                c='A';
            else c++;
        }
        if(str[i]=='-'){
            if(c=='A')
                c='Z';
            else c--;
        }
    }
    string tem="";
    tem+=c;
    return tem;
}

int main(){
    while(1){
        string str;
        cin>>str;
        if(str==".")break;
        for(int i=0;i<str.length();i++){
            if(str[i]=='+'||str[i]=='-'){
                int j;
                for(j=i+1;str[j]=='+'||str[j]=='-';j++);
                string n;
                if(str[j]=='?')n="A";
                else n=pm(str.substr(i,j-i+1));
                str=str.substr(0,i)+n+str.substr(j+1,str.length()-j-1);
            }
            if(str[i]=='?')str[i]="A";
           // cout<<str<<endl;
        }
        for(int i=0;i<str.length();i++){
            if(str[i]=='['){
                int j;
                int co=1;
                for(j=i+1;j<str.length();j++){
                    if(str[j]=='[')co++;
                    if(str[j]==']')co--;
                    if(co==0)break;
                }
                string n=rev(str.substr(i+1,j-i-1));
                //cout<<n<<endl;
                str=str.substr(0,i)+n+str.substr(j+1,str.length()-j-1);
            }
        }
        cout<<str<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:35: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   58 |             if(str[i]=='?')str[i]="A";
      |                                   ^~~
      |                                   |
      |                                   const char*
Language: C++

#include<bits/stdc++.h>
#define REP(i,n,N) for(int i=(n);i<(int)(N);i++)
#define p(s) cout<<(s)<<endl
#define ck(n,a,b) (a<=(n)&&(n)<=b
using namespace std;

string s,ans;
stack<int> st;
void bng(unsigned int pos,int diff){
	if(pos==s.size()) return;
	if(ck(s[pos],'A','Z')){
		ans+=(char) (s[pos]-'A'+diff)%26 + 'A';
		diff=0;
	}else if(s[pos]=='+'){
		diff++;
	}else if(s[pos]=='-'){
		diff--;
	}else if(s[pos]=='['){
		st.push(ans.size());
	}else if(s[pos]==']'){
		reverse(ans.begin()+st.top(),ans.end());
		st.pop();
	}else if(s[pos]=='?'){
		ans+='A';
		diff=0;
	}
	bng(pos+1,(diff+26)%26);
}

int main(){
	while(cin>>s){
		if(s==".") break;
		ans="";
		bng(0,0);
		p(ans);
	}
	return 0;
}

Compiler output:
a.cc: In function 'void bng(unsigned int, int)':
a.cc:11:31: error: expected ';' before '{' token
   11 |         if(ck(s[pos],'A','Z')){
      |                               ^
      |                               ;
a.cc:14:10: error: expected primary-expression before 'else'
   14 |         }else if(s[pos]=='+'){
      |          ^~~~
a.cc:14:10: error: expected ')' before 'else'
   14 |         }else if(s[pos]=='+'){
      |          ^~~~
      |          )
a.cc:11:11: note: to match this '('
   11 |         if(ck(s[pos],'A','Z')){
      |           ^
Language: C++

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

string S;

char step(char ch, int offset) {
    if (ch == '?') return 'A';
    return ((ch - 'A') + offset + 26*1000) % 26 + 'A';
}

pair<string, int> parse(int idx) {
    string res = "";
    while (idx < S.size()) {
        if (S[idx] == ']') {
            reverse(res.begin(), res.end());
            idx ++;
            break;
        }

        if (S[idx] == '[') {
            pair<string, int> sub = parse(idx+1);
            res += sub.first;
            idx = sub.second;
            continue;
        }

        int offset = 0;
        while (S[idx] == '+' || S[idx] == '-') {
            offset += (S[idx] == '+') ? 1 : -1;
            ++idx;
        }

        res += string(1, step(S[idx], offset));
        idx++;
    }

    return make_pair(res, idx);
}

void solve(){
    string res;
    pair<string, int> pr = parse(0);
    cout << pr.first << endl;
}

int main(){
    while(1){
        cin >> S;
        if (S == ".") break;
        solve();
    }
}



Compiler output:
a.cc: In function 'std::pair<std::__cxx11::basic_string<char>, int> parse(int)':
a.cc:18:13: error: 'reverse' was not declared in this scope
   18 |             reverse(res.begin(), res.end());
      |             ^~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <functional>
#include <queue>
#include <tuple>

using namespace std;

#define rep(i,n) for(int i = 0;i < n;i++)
#define each(i,n) for(auto i : n)
#define clr(n) memset(n,0,sizeof(n))
#define mclr(n) memset(n,-1,sizeof(n))

//2^8 * 100 * 500 * 24
int INF = 1e9;
int n, m, H, K;
int c[101][101];
int h[101][101];
int r[101][101];

int l[501];
int d[501];
int k[501];
int s, t, p;

int me[1 << 8][1 << 8];
int ct[101][30];

int solve(int i, int bit, int tg) {
	if (me[i][bit] != -1)return me[i][bit];
	if (i == p) {
		if ((bit & tg) == tg) {
			return 0;
		}
		else {
			return INF;
		}
	}
	return me[i][bit] = min(solve(i + 1, bit, tg), solve(i + 1, bit | k[i], tg) + d[i]);
}

vector<vector<int>> ce;
int main() {

	while (cin >> n >> m >> H >> K && n) {
		mclr(c);
		mclr(h);
		mclr(r);
		mclr(l);
		mclr(d);
		clr(k);
		ce.clear();
		ce.resize(n);
		rep(i, m) {
			int a, b, e, f, g;
			cin >> a >> b >> e >> f >> g;
			a--; b--;
			g--;
			ce[a].push_back(b);
			ce[b].push_back(a);
			c[a][b] = c[b][a] = e;
			h[a][b] = h[b][a] = f;
			r[a][b] = r[b][a] = g;
		}
		cin >> s >> t >> p;
		s--; t--;
		rep(i, p) {
			cin >> l[i] >> d[i];
			rep(j, l[i]) {
				int tmp;
				cin >> tmp;
				tmp--;
				k[i] |= (1 << tmp);
			}
		}
		int ans = INF;
		rep(bit, 1 << K) {
			mclr(me);
			int cost = solve(0, 0, bit);
			if (cost == INF)continue;
			rep(i, 101)rep(j, 30) {
				ct[i][j] = INF;
			}
			ct[s][0] = cost;
			typedef tuple<int, int, int> T;
			priority_queue<T, vector<T>, greater<T>> qu;
			qu.push(T(cost, s, 0));
			while (qu.size()) {
				int mc = get<0>(qu.top());
				int nw = get<1>(qu.top());
				int tm = get<2>(qu.top());
				qu.pop();
				if (ct[nw][tm] < mc)continue;
				each(i, ce[nw]) {
					if (c[nw][i] != -1) {
						int nt = tm + h[nw][i];
						if (nt <= H) {
							int nc = ct[nw][tm];
							if (!(bit & (1 << r[nw][i]))) {
								nc += c[nw][i];
							}
							if (nc <= ct[i][nt]) {
								ct[i][nt] = nc;
								qu.push(T(nc, i, nt));
							}
						}
					}
				}
			}
			rep(i, H + 1) {
				ans = min(ans, ct[t][i]);
			}
		}
		cerr << endl;
		if (ans == INF)ans = -1;
		cout << ans << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: 'memset' was not declared in this scope
   16 | #define mclr(n) memset(n,-1,sizeof(n))
      |                 ^~~~~~
a.cc:50:17: note: in expansion of macro 'mclr'
   50 |                 mclr(c);
      |                 ^~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include <queue>
  +++ |+#include <cstring>
    9 | #include <tuple>
Language: C++

#include <vector>
#include <iomanip>
#include <iostream>
using namespace std;
int n; double px[209], py[209], pz[209], vx[209], vy[209], vz[209], r[209], vr[209], t[209][209], ret[209];
int main() {
	while (cin >> n, n) {
		for (int i = 0; i < n; i++) cin >> px[i] >> py[i] >> pz[i] >> vx[i] >> vy[i] >> vz[i] >> r[i] >> vr[i];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				// ((px[i] + t * vx[i]) - (py[j] + t * vx[j])) ^ 2 + ... == ((r[i] - t * vr[i]) + (r[j] - t * vr[j])) ^ 2
				t[i][j] = 1.0e+9;
				double cx1 = vx[i] - vx[j], cx0 = px[i] - px[j];
				double cy1 = vy[i] - vy[j], cy0 = py[i] - py[j];
				double cz1 = vz[i] - vz[j], cz0 = pz[i] - pz[j];
				double cr1 = vr[i] + vr[j], cr0 = -(r[i] + r[j]);
				double dx2 = cx1 * cx1 + cy1 * cy1 + cz1 * cz1 - cr1 * cr1;
				double dx1 = 2 * (cx1 * cx0 + cy1 * cy0 + cz1 * cz0 - cr1 * cr0);
				double dx0 = cx0 * cx0 + cy0 * cy0 + cz0 * cz0 - cr0 * cr0;
				double D = dx1 * dx1 - 4 * dx2 * dx0;
				if (i == j || D < 0.0) continue;
				double alpha = (-dx1 - sqrt(D)) / (2 * dx2);
				if (alpha > 0.0) t[i][j] = alpha;
			}
		}
		for (int i = 0; i < n; i++) ret[i] = r[i] / vr[i];
		while(true) {
			int mi = -1, mj = -1;
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < n; j++) {
					if (t[i][j] < ret[i] && t[i][j] < ret[j]) {
						if (mi == -1 || t[mi][mj] > t[i][j]) mi = i, mj = j;
					}
				}
			}
			if (mi == -1) break;
			ret[mi] = t[mi][mj];
			ret[mj] = t[mi][mj];
		}
		for (int i = 0; i < n; i++) cout << fixed << setprecision(15) << ret[i] << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:56: error: 'sqrt' was not declared in this scope
   22 |                                 double alpha = (-dx1 - sqrt(D)) / (2 * dx2);
      |                                                        ^~~~
Language: C++

#include <iostream>
#include <cmath>
#include <tuple>
#include <vector>
using namespace std;
typedef tuple<double,double,double> T;

T operator-(const T Ta, const T Tb){
    double Xa,Ya,Za,Xb,Yb,Zb;
    tie(Xa,Ya,Za)=Ta;
    tie(Xb,Yb,Zb)=Tb;
    return T(Xa-Xb,Ya-Yb,Za-Zb);
}

double inner_cross(T Ta, T Tb){
    double Xa,Ya,Za,Xb,Yb,Zb;
    tie(Xa,Ya,Za)=Ta;
    tie(Xb,Yb,Zb)=Tb;
    return Xa*Xb+Ya*Yb+Za*Zb;
}

typedef tuple<T,T,double,double> Star;
typedef tuple<double,int,int> Event;


int main(){
    int N;
    cout<<fixed;
    cout.precision(10); 
    while(cin>>N,N){
        vector<Star> V;
        vector<Event> E;
        vector<double> lifetime(N);
        for(int i=0;i<N;i++){
            double px,py,pz,vx,vy,vz,r,vr;
            cin>>px>>py>>pz>>vx>>vy>>vz>>r>>vr;
            E.emplace_back(r/vr,i,i);
            V.emplace_back(T(px,py,pz),T(vx,vy,vz),r,vr);
        }
        for(int i=0;i<N;i++){
            for(int j=i+1;j<N;j++){
                T Pa,Pb,Va,Vb;
                double ra,rb,vra,vrb;
                tie(Pa,Va,ra,vra)=V[i];
                tie(Pb,Vb,rb,vrb)=V[j];
                double A=inner_cross(Va-Vb,Va-Vb)-pow(vra+vrb,2);
                double B=2.0*inner_cross(Pa-Pb,Va-Vb)+2.0*(ra+rb)*(vra+vrb);
                double C=inner_cross(Pa-Pb,Pa-Pb)-pow(ra+rb,2);
                double t=(-B-sqrt(B*B-4*A*C))/(2*A);
                // cout<<A<<' '<<B<<' '<<C<<' '<<t<<endl;
                if(isinf(t)||t<0) continue;
                E.emplace_back(t,i,j);
            }
        }
        sort(E.begin(), E.end());
        bool alive[N];
        fill(alive,alive+N,true);
        for(auto e:E){
            double t;
            int a,b;
            tie(t,a,b)=e;
            if(alive[a]&&alive[b]){
                lifetime[a]=lifetime[b]=t;
                alive[a]=alive[b]=false;
            }
        }
        for(auto l:lifetime){
            cout<<l<<endl;
        }
    }
}

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

#include <iostream>
#include <vector>
#include <cmath>
#include <cstdio>
#define REP(i, a, n) for(int i = ((int) a); i < ((int) n); i++)
#define EPS 1e-10
using namespace std;
typedef pair<int, int> pii;
typedef pair<double, pii> pdii;

int N;
double PX[200], PY[200], PZ[200], VX[200], VY[200], VZ[200], R[200], VR[200];

int main(void) {
  while(cin >> N, N) {
    REP(i, 0, N) cin >> PX[i] >> PY[i] >> PZ[i] >> VX[i] >> VY[i] >> VZ[i] >> R[i] >> VR[i];
    vector<pdii> vec;
    REP(i, 0, N) vec.push_back(pdii((double) R[i] / VR[i], pii(i, -1)));
    REP(i, 0, N) REP(j, i + 1, N) {
      double px = PX[i] - PX[j], py = PY[i] - PY[j], pz = PZ[i] - PZ[j], r = R[i] + R[j];
      double vx = VX[i] - VX[j], vy = VY[i] - VY[j], vz = VZ[i] - VZ[j], vr = VR[i] + VR[j];
      double a = vx * vx + vy * vy + vz * vz - vr * vr;
      double b = px * vx + py * vy + pz * vz + r * vr;
      double c = px * px + py * py + pz * pz - r * r;
      double d = b * b - a * c;
      if(d >= 0 && a > 0) {
        double t1 = (-b - sqrt(d)) / a;
        if(t1 > EPS) vec.push_back(pdii(t1, pii(i, j)));
      }
    }
    sort(vec.begin(), vec.end());
    bool b[200];
    REP(i, 0, N) b[i] = false;
    double ans[200];
    REP(i, 0, vec.size()) {
      double t = vec[i].first;
      int x = vec[i].second.first, y = vec[i].second.second;
      if(y == -1) {
        if(!b[x]) b[x] = true, ans[x] = t;
      } else {
        if(!b[x] && !b[y]) b[x] = b[y] = true, ans[x] = ans[y] = t;
      }
    }
    REP(i, 0, N) printf("%.10lf\n", ans[i]);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   31 |     sort(vec.begin(), vec.end());
      |     ^~~~
      |     sqrt