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

//ACCEPT????????????????????????Wrong Answer?????????????????£?????????????????????????????¨?????¨????????????
#include <iostream>
#include <string>
#include <tuple>
#include <algorithm>
using namespace std;

int T, P, R;
int team, prob, t; string mes;

bool isAccepted[50][10];
int acTimeSum[50];
int wrongCnt[50][10];

int main() {
	int i, j;
	
	while (cin >> T >> P >> R) {
		if (!T) break;
		for (i = 0; i < T; i++) {
			acTimeSum[i] = 0;
			for (j = 0; j < P; j++) {
				isAccepted[i][j] = false;
				wrongCnt[i][j] = 0;
			}
		}
		
		for (i = 0; i < R; i++) {
			cin >> team >> prob >> t >> mes;
			team--; prob--;
			if (mes == "CORRECT") {
				isAccepted[team][prob]++;
				acTimeSum[team] += t;
			}
			else {
				wrongCnt[team][prob]++;
			}
		}
		
		typedef tuple<int, int, int> Tuple;
		Tuple d[50];
		for (i = 0; i < T; i++) {
			int penalty = acTimeSum[i];
			int acCnt = 0;
			for (j = 0; j < P; j++) {
				if (isAccepted[i][j]) {
					acCnt++;
					penalty += 1200 * wrongCnt[i][j];
				}
			}
			d[i] = Tuple(-acCnt, penalty, i);
		}
		sort(d, d + T);
		
		for (i = 0; i < T; i++) {
			cout << get<2>(d[i]) + 1 << " " << -get<0>(d[i]) << " " << get<1>(d[i]) << endl;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:54: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   32 |                                 isAccepted[team][prob]++;
      |                                 ~~~~~~~~~~~~~~~~~~~~~^
Language: C++

3 3 5
3 1 800 WRONG
1 1 1200 CORRECT
3 1 1400 CORRECT
1 2 2400 CORRECT
1 3 3600 CORRECT
5 2 5
3 1 1000 WRONG
5 2 2000 CORRECT
3 1 2800 CORRECT
4 1 4000 CORRECT
5 1 5000 CORRECT
6 3 15
2 1 10 WRONG
3 3 15 WRONG
3 3 20 CORRECT
1 1 50 CORRECT
4 2 60 WRONG
1 2 70 WRONG
4 1 80 CORRECT
1 2 90 WRONG
1 2 150 CORRECT
3 1 160 WRONG
3 1 180 CORRECT
3 2 210 WRONG
5 3 500 CORRECT
4 2 720 CORRECT
5 1 1500 CORRECT
0 0 0


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

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

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

struct Info
{
    int solved, time, tid, wrong[11];
    bool operator< (const Info &rhv) const {
        return solved == rhv.solved ?
        (time == rhv.time ? tid < rhv.tid : time < rhv.time) :
        solved > rhv.solved;
    }
};

int main()
{
    int T, P, R, tid, pid, time;
    string msg;
    Info info[55];
    
    while(cin >> T >> P >> R && T)
    {
        memset(info, 0, sizeof(info));
        rep(i, T) info[i].tid = i + 1;
        rep(i, R)
        {
            cin >> tid >> pid >> time >> msg;
            --tid;
            if(msg == "CORRECT") {
                ++info[tid].solved;
                info[tid].time += time + 1200 * info[tid].wrong[pid];
            } else
                ++info[tid].wrong[pid];
        }
        sort(info, info + T);
        rep(i, T) {
            cout << info[i].tid << ' ' << info[i].solved << ' ' << info[i].time << endl;
        }
    }
}

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

#include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

class State
{
public:
	int No,ok,pena;
	State(int No = 0,int ok = 0, int pena = 0):
	No(No),ok(ok),pena(pena){}

	bool operator < (const State &ano) const{
		if(ok > ano.ok)return true;
		else if(ok == ano.ok && pena < ano.pena)return true;
		else if(ok == ano.ok && pena == ano.pena && No < ano.No)
			return true;
			return false;
	}
};

int main()
{
	int T,P,R;

	while(cin >> T >> P >> R, T){
		int **d = new int *[T];
		State *a = new State[T];
		for(int i = 0; i < T; i++){
			d[i] = new int [P];
			a[i].No = i+1,a[i].ok = 0,a[i].pena = 0;

			for(int j = 0; j < P; j++)
				d[i][j] = 0;
		}

		int team,prog,time;
		string str;
		while(R > 0){
			R--;
			cin >> team >> prog >> time >> str;

			if(str == "WRONG")
				d[team-1][prog-1]++;
			else {
				a[team-1].pena += d[team-1][prog-1]*1200+time;	//ペナルティ
				a[team-1].ok++;	//正解数
			}
		}

		sort(a,a+T);

		for(int i = 0; i < T; i++)
			printf("%d %d %d\n",a[i].No,a[i].ok a[i].pena);

			



	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:60: error: expected ')' before 'a'
   55 |                         printf("%d %d %d\n",a[i].No,a[i].ok a[i].pena);
      |                               ~                            ^~
      |                                                            )
Language: C++

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

int t, p, r, tID, pID, times;
int point[100], wrong[100][100], penalty[100], ans[100];
string message;

bool AC_comp(const int &a, const int &b){
    if(point[a] == point[b]){
	if(penalty[a] == penalty[b])
	    return return a < b;
	return penalty[a] < penalty[b];
    }
    return point[a] > point[b];
}

int main(){
    while(true){
	cin >> t >> p >> r;
	if(t == 0 && p == 0 && r == 0)return 0;
	memset(point, 0, sizeof(point));
	memset(penalty, 0, sizeof(penalty));
	memset(wrong, 0, sizeof(wrong));
	for(int i = 0;i < r;i++){
	    cin >> tID >> pID >> times >> message;
	    if(message == "CORRECT"){
		point[tID]++;
		penalty[tID] += times + wrong[tID][pID] * 1200;
	    }
	    else{
		wrong[tID][pID]++;
	    }
	}
	for(int i = 0;i < t;i++){
	    ans[i] = i + 1;
	}
	sort(ans, ans + t, AC_comp);
	for(int i = 0;i < t;i++){
	    int team = ans[i];
	    cout << team << ' ' << point[team] << ' ' << penalty[team] << endl;
	}
    }
}

Compiler output:
a.cc: In function 'bool AC_comp(const int&, const int&)':
a.cc:14:20: error: expected primary-expression before 'return'
   14 |             return return a < b;
      |                    ^~~~~~
a.cc:14:19: error: expected ';' before 'return'
   14 |             return return a < b;
      |                   ^~~~~~~
      |                   ;
Language: C++

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


struct A{
	int n;
	int pena;
	int id;
	bool operator<(const A &a)const{
		if(n!=a.n)return n>a.n;
		if(pena!=a.pena)return pena<a.pena;
		return id<a.id;
	}
};
int main(){
	int T,P,R;
	int p[50][10];
	A team[50];
	while(cin>>T>>P>>R,T|P|R){
		memset(p,0,sizeof(p));
		for(int i=0;i<T;i++){
			team[i].n=team[i].pena=0;
			team[i].id=i+1;
		}
		while(R--){
			int a,b,c;
			string mes;
			cin>>a>>b>>c>>mes;
			if(mes=="WRONG")p[a-1][b-1]++;
			else{
				team[a-1].n++;
				team[a-1].pena += p[a-1][b-1]*1200+c;
			}
		}
		sort(team,team+T);
		for(int i=0;i<T;i++){
			cout<<team[i].id<<' '<<team[i].n<<' '<<team[i].pena<<endl;
		}
	}
	return 0;
}

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

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define between(a,x,b) ((a)<=(x)&&(x)<=(b))
using namespace std;
typedef pair<int, pair<int, int> > tpair;

struct hoge{
  bool operator()(const tpair& a, const tpair& b){
    if(a.second.first != b.second.first) return a.second.first > b.second.first;
    else if(a.second.second != b.second.second) return a.second.second < b.second.second;
    else return a.first < b.first;
  }
}; 

int main(){
  int T, P, R;
  while(scanf("%d%d%d", &T, &P, &R) && (T||P||R)){
    //    vector<pair<int, pair<int, int> > > t(T); // team ac p
    vector<tpair> t(T);
    int fail[11][11] = {};
    int tid, pid, time;
    char message[16];
    rep(i, T) t[i].first = i+1;     
    rep(i, R){
      scanf("%d%d%d%s", &tid, &pid, &time, message); tid--; pid--;
      if(message[0] == 'C'){
	if(fail[tid][pid] != -1){
	//  t[tid].second.first++;
	  t[tid].second.second += 1 //fail[tid][pid] * 1200 + time;
	  fail[tid][pid] = -1; 
	}
      }else if(message[0] == 'W'){
	if(fail[tid][pid] != -1)
	  fail[tid][pid]++;
      }
    } 
    sort(t.begin(), t.end(), hoge());
    rep(i, T) printf("%d %d %d\n", t[i].first, t[i].second.first, t[i].second.second);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:36: error: expected ';' before 'fail'
   41 |           t[tid].second.second += 1 //fail[tid][pid] * 1200 + time;
      |                                    ^
      |                                    ;
   42 |           fail[tid][pid] = -1;
      |           ~~~~
Language: C

/*
AizuOnline A2401
Title Equation
13/3/24 WA
*/
#include <stdio.h>
// Select Below
//#include <stdlib.h>
#include <string.h>
//#include <float.h>
//#include <math.h>
//#include <limits.h>
//Global data section
#define MAXLEN 1001
#define NVARS 10
char expr[MAXLEN];

//
void strreplace(char * s,int len,char from,char to)
{
  int i;
  for(i=0;i<len;i++)
    if(s[i]==from)
      s[i]=to;
}
char * find_binary_operator2(char * s,int len,char op1,char op2)
{
  int i,d;
  char *p;
  
  d=0;
  for(i=len-1;i>=0;i--)
    { 
      if(s[i]==')')
	d++;
      else if (s[i]=='(')
	d--;
      else
	{
	  if((op1==s[i]) && (op2==s[i+1]) && d==0)
	    return(&s[i]);
	}
    }
  return(NULL);
}

char * find_binary_operator(char * s,int len,char op)
{
  int i,d;
  char *p;
  
  d=0;
  for(i=len-1;i>=0;i--)
    { 
      if(s[i]==')')
	d++;
      else if (s[i]=='(')
	d--;
      else
	{
	  if((op==s[i]) && d==0)
	    return(&s[i]);
	}
    }
  return(NULL);
}
int logical_equal(int e1,int e2)
{
#ifdef DEBUG
  printf("EQ:%d %d\n",e1,e2);
#endif
  return((e1==e2)?1:0);
}
int logical_and(int e1,int e2)
{
  return((e1 && e2)?1:0);
}
int logical_or(int e1,int e2)
{
  return((e1 || e2)?1:0);
}
int logical_naraba(int e1,int e2)
{
  return((e1<=e2)?1:0);
}
int logical_cpl(int e1)
{
  return((!e1)?1:0);
}
int logical_eval(char * exp,int len)
{
  char * r;
  
  if(len==1)
    {
      if(exp[0]=='T')
	return(1);
      else
	return(0);
    }
  if(r=find_binary_operator(exp,len,'='))
    {
      return(logical_equal(logical_eval(exp,r-exp),
			   logical_eval(r+1,len-(r-exp+1))));
    }
  if(r=find_binary_operator(exp,len,'*'))
    {
      return(logical_and(logical_eval(exp,r-exp),
			   logical_eval(r+1,len-(r-exp+1))));
    }
  if(r=find_binary_operator(exp,len,'+'))
    {
      return(logical_or(logical_eval(exp,r-exp),
			   logical_eval(r+1,len-(r-exp+1))));
    }
  if(r=find_binary_operator2(exp,len,'-','>'))
    {
      return(logical_naraba(logical_eval(exp,r-exp),
			   logical_eval(r+2,len-(r-exp+2))));
    }
  if(exp[0]=='-')
     return(logical_cpl(logical_eval(exp+1,len-1)));
  else   if(exp[0]=='(' && exp[len-1]==')')
    return(logical_eval(exp+1,len-2));
  return(0);
}
int check_log_equation(char * exp,int len)
{
  int i,j;
  char wk[MAXLEN];
  memset(wk,0,MAXLEN);

    for(i=0;i<1024;i++)   // 2^NVARS
    {
      memcpy(wk,exp,len);
      for(j=0;j<10;j++)
	  {
	    strreplace(wk,len,'a'+j,(i & (1<<j)?'T':'F'));
	  }
#ifdef DEBUG
      printf("%*s\n",len+1,wk);
#endif
      
      if(!logical_eval(wk,len))
	return(0);
    }
    return(1);

}
main()
{
  char *p;
  int ret;

  while(EOF!=scanf("%s",expr) && s[0]!='#')
    {
      ret=check_log_equation(expr,strlen(expr));

      printf("%s\n",ret?"YES":"NO");
    }
  return(0);
}

Compiler output:
main.c:150:1: error: return type defaults to 'int' [-Wimplicit-int]
  150 | main()
      | ^~~~
main.c: In function 'main':
main.c:155:34: error: 's' undeclared (first use in this function)
  155 |   while(EOF!=scanf("%s",expr) && s[0]!='#')
      |                                  ^
main.c:155:34: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
using namespace std;
int i, v; string s;
int () {
  i++;
  if(s[i]=='T') return 1;
  if(s[i]=='F') return 0;
  if(isalpha(s[i])) return v>>(s[i]-'a')&1;
  if(s[i]=='-') return !P();
  int l=P();
  i++;char o=s[i];if(o=='-')i++;
  int r=P();i++;
  if(o=='*') return l&r;
  if(o=='+') return l|r;
  if(o=='-') return l<=r;
}
 
int main() {
  while(cin>>s) {
    if(s=="#") break;
    bool k=true;
    for(v=0;v<(1<<11);v++) {
      i=-1; int l=P();
      i++;
      if(l!=P()) { k=false; break; }
    }
    cout<<(k ? "YES\n":"NO\n");
  }
  return 0;
}

Compiler output:
a.cc:4:6: error: expected unqualified-id before ')' token
    4 | int () {
      |      ^
a.cc: In function 'int main()':
a.cc:23:19: error: 'P' was not declared in this scope
   23 |       i=-1; int l=P();
      |                   ^
Language: C++

#include<bits/stdc++.h>
int i,v;string s;
int P() {
  i++;
  if(s[i]=='T')return 1;
  if(s[i]=='F')return 0;
  if(isalpha(s[i]))return v>>(s[i]-'a')&1;
  if(s[i]=='-')return !P();
  int l=P();
  i++;int o=s[i];if(o=='-')i++;
  int r=P();i++;
  if(o=='*')return l&r;
  if(o=='+')return l|r;
  if(o=='-')return l<=r;
}
int main() {
  while(std::cin>>s){
    if(s=="#")break;
    bool k=true;
    for(v=0;v<(1<<11);v++) {
      i=-1;int l=P();
      i++;
      if(l!=P()){k=false;break;}
    }
    std::cout<<(k?"YES\n":"NO\n");
  }
  return 0;
}

Compiler output:
a.cc:2:9: error: 'string' does not name a type; did you mean 'stdin'?
    2 | int i,v;string s;
      |         ^~~~~~
      |         stdin
a.cc: In function 'int P()':
a.cc:5:6: error: 's' was not declared in this scope
    5 |   if(s[i]=='T')return 1;
      |      ^
a.cc:6:6: error: 's' was not declared in this scope
    6 |   if(s[i]=='F')return 0;
      |      ^
a.cc:7:14: error: 's' was not declared in this scope
    7 |   if(isalpha(s[i]))return v>>(s[i]-'a')&1;
      |              ^
a.cc:8:6: error: 's' was not declared in this scope
    8 |   if(s[i]=='-')return !P();
      |      ^
a.cc:10:13: error: 's' was not declared in this scope
   10 |   i++;int o=s[i];if(o=='-')i++;
      |             ^
a.cc: In function 'int main()':
a.cc:17:19: error: 's' was not declared in this scope
   17 |   while(std::cin>>s){
      |                   ^
Language: C++


#include <iostream>
#include <string>

using namespace std;

string s;
int i;
bool f[256];

bool imp(bool x, bool y){
	if ( x &&  y)return true;
	if ( x && !y)return false;
	if (!x &&  y)return true;
	if (!x && !y)return true;
}

bool form(){
	
	if (s[i] == 'T'){ i++; return true; }
	if (s[i] == 'F'){ i++; return false; }

	if (s[i] >= 'a' && s[i] <= 'k'){
		i++; return f[s[i]];
	}else
	if (s[i] == '-'){
		i++; return !form();
	}else
	if (s[i] == '('){
		i++; bool c = form();

		if (s[i] == '*'){
			i++;  bool tc = form(); i++; return tc && c;
		}
		if (s[i] == '+'){
			i++;  bool tc = form(); i++; return tc || c;
		}
		if(s[i] == '-' && s[i+1] == '>')
		{
			i+=2; bool tc = form(); i++; return imp(c,tc);
		}
	}
}

bool equation(){
	i = 0;
	bool t = form();i++;
	return t == form();
}

bool dfs(int n){

	if (n == 'k' + 1){
		return equation();
	}
	f[n] = true;
	bool ret = dfs(n+1);
	f[n] = false;
	return ret && dfs(n + 1);
}


int main()
{

	while (cin >> s && s != "#"){
		memset(f,0,256*sizeof(bool));
		s += " ";
		if (dfs('a'))
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:17: error: 'memset' was not declared in this scope
   67 |                 memset(f,0,256*sizeof(bool));
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <iostream>
  +++ |+#include <cstring>
    3 | #include <string>
a.cc: In function 'bool imp(bool, bool)':
a.cc:16:1: warning: control reaches end of non-void function [-Wreturn-type]
   16 | }
      | ^
a.cc: In function 'bool form()':
a.cc:43:1: warning: control reaches end of non-void function [-Wreturn-type]
   43 | }
      | ^
Language: C++

#include <iostream>
#include <string>
#include <stack>

using namespace std;

char wa(char a, char b);
char seki(char a, char b);
char naraba(char a, char b);
char not(char a);

bool kaiseki(string b) {
	stack<char> stk1;
	stack<char> stk2;
	char aa, bb;
	for (int i = 0; i < b.size(); i++) {
		if (b[i] == '=') {
			aa = stk2.top();
			stk2.pop();
		} else {
			if (b[i] == '0' || b[i] == '1') {
				while (!stk1.empty() && stk1.top() == '-') {
					stk1.pop();
					b[i] = not(b[i]);
				}
				stk2.push(b[i]);
			} else if (b[i] == '+' || b[i] == '*' || b[i] == '>' || b[i] == '(') {
				stk1.push(b[i]);
			} else if (b[i] == ')') {
				char p = stk2.top();
				stk2.pop();
				char q = stk2.top();
				stk2.pop();
				char k = stk1.top();
				stk1.pop();
				if (k == '+') {
					p = wa(p, q);
				} else if (k == '*'){
					p = seki(p, q);
				} else if (k == '>') {
					p = naraba(q, p);
				} else {
					stk2.push(q);
					p = not(p);
				}
				stk1.pop();
				while (!stk1.empty() && stk1.top() == '-') {
					stk1.pop();
					p = not(p);
				}
				stk2.push(p);
			} else if (b[i] == '-') {
				if (b[i+1] == '>') {
				} else {
					stk1.push(b[i]);
				}
			}
		}
	}
	bb = stk2.top();
	stk2.pop();
	return aa == bb;
}

char wa(char a, char b) {
	if (a == '0' && b == '0') {
		return '0';
	} else {
		return '1';
	}
}

char seki(char a, char b) {
	if (a == '1' && b == '1') {
		return '1';
	} else {
		return '0';
	}
}

char naraba(char a, char b) {
	if (a == '1' && b == '0') {
		return '0';
	} else {
		return '1';
	}
}

char not(char a) {
	if (a == '0') {
		return '1';
	} else {
		return '0';
	}
}

int main() {
	string a;
	string abc = "abcdefghijk";
	while (cin >> a) {
		if (a == "#") {
			break;
		}
		int counter = 1;
		counter <<= 11;
		string b;
		bool hantei = true;
		for (int i = 0; i < a.size(); i++) {
			if (a[i] == 'T') {
				a[i] = '1';
			} else if (b[i] == 'F') {
				a[i] = '0';
			}
		}
		for (int i = 0; i < counter; i++) {
			b = a;
			for (int j = 0; j < 11; j++) {
				if ((i&(1<<j)) != 0) {
					while (b.find(abc[j]) != string::npos) {
						b[b.find(abc[j])] = '1';
					}
				} else {
					while (b.find(abc[j]) != string::npos) {
						b[b.find(abc[j])] = '0';
					}
				}
			}
			if (!kaiseki(b)) {
				hantei = false;
				break;
			}
		}
		if (hantei) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
	return 0;
}

Compiler output:
a.cc:10:6: error: expected unqualified-id before 'not' token
   10 | char not(char a);
      |      ^~~
a.cc:89:6: error: expected unqualified-id before 'not' token
   89 | char not(char a) {
      |      ^~~
Language: C++

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

string s;
int p;

int equation();
int formula();

//1:true 0:false
int equation(){
  int a=formula();
  if(s[p]=='=')p++;//'='
  int b=formula();
  cout<<"a "<<a<<" b "<<b<<endl;
  //if(a==b && a!=-1)return 1;
  else return 0;
}

//1:true 0:false -1:?????°
int formula(){
  if(s[p]=='-'){
    p++;//'-'
    int a=formula();
    if(a==1)return 0;
    else return 1;
  }
  else if(s[p]=='('){
    p++;//'('
    int a=formula();
    char tmp=s[p];//?????????
    p++;//'*', '+', '->'
    if(s[p]=='>')p++;//'->'
    int b=formula();
    p++;//')'

    if(tmp=='*'){
      if(a==b && a==1)return 1;
      else return 0;
    }
    else if(tmp=='+'){
      if(a==1 || b==1)return 1;
      else return 0;
    }
    else{
      if(a==1 && b==0)return 0;
      else return 1;
    }
  }
  else{
    if(s[p]=='T'){p++; return 1;}
    else if(s[p]=='F'){p++; return 0;}
    else{p++; return -1;}//?????°
  }
}


int main(){
  while(cin>>s, s!="#"){
    p=0;
    if(equation())cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int equation()':
a.cc:17:3: error: 'else' without a previous 'if'
   17 |   else return 0;
      |   ^~~~
Language: C++

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define INF (1e9+1)
//#define INF (1LL<<59)

typedef string::const_iterator State;


string getop(State &begin){
	if(*begin=='*'){
		begin++;
		return "*";
	}
	else if(*begin=='+'){
		begin++;
		return "+";
	}else{
		begin++;
		begin++;
		return "->";
	}
}


bool mul(bool a,bool b){
	if(a&&b)return true;
	else return false;
}


bool add(bool a,bool b){
	if(!a&&!b)return false;
	else return true;
}


bool imp(bool a,bool b){
	if(a&&!b)return false;
	else return true;
}


bool exp(State &begin){
	if(isnumber(*begin)){
		begin++;
		return '0'+*begin;
	}
	else if(*begin=='-'){
		begin++;
		return !exp(begin);
	}else if(*begin=='('){
		begin++;
		bool ll = exp(begin);
		string op = getop(begin);
		bool rr = exp(begin);
		begin++;
		
		if(op=="*")return mul(ll,rr);
		else if(op=="+")return add(ll,rr);
		else return imp(ll,rr);
	}
	
	assert(1);
	return 0;
}


bool check(string s){
	string left="",right="";
	bool f=false;
	rep(i,s.size()){
		if(s[i]=='=')f=true;
		else if(f)right+=s[i];
		else left+=s[i];
	}
	
	State bl = left.begin(),br = right.begin();
	bool l = exp(bl);
	bool r = exp(br);
	
	if(l==r)return true;
	else return false;
}


int main(){
	string s;
	while(cin>>s&&s!="#"){
		set<char> var;
		int c=0;
		rep(i,s.size()){
			if(isalpha(s[i])){
				var.insert(s[i]);
			}
		}
		
		
		bool f = false;
		int en = 1<<var.size();
		rep(i,en){
			map<char,int> mp;
			int num = i;
			for(auto &e:var){
				mp[e] = num%2;
				num/=2;
			}
			string t = s;
			rep(j,t.size()){
				if( isalpha(t[j]) ){
					t[j] = '0'+mp[t[j]];
				}
			}
			if(check(t)==false)f=true;
		}
		if(f)cout<<"NO"<<endl;
		else cout<<"YES"<<endl;}
}

Compiler output:
a.cc: In function 'bool exp(State&)':
a.cc:49:12: error: 'isnumber' was not declared in this scope
   49 |         if(isnumber(*begin)){
      |            ^~~~~~~~
Language: C++

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

int not(int a){
	if(a==1) return 0;
	return 1;
}

int and(int a,int b){
	if(a==1 && b==1) return 1;
	return 0;
}

int or(int a,int b){
	if(a==0 && b==0) return 0;
	return 1;
}

int naraba(int a,int b){
	if(a==0 || (a==1 && b==1)) return 1;
	return 0;
}

string s;
int bit=0;
int p=0;

int to_int(char a){
	if(a=='T') return 1;
	if(a=='F') return 0;
	int k=a-'a';
	if(bit & (1<<k)) return 1;
	return 0;
}


int calc(){
	if(isalpha(s[p])) return to_int(s[p++]);
	if(s[p]=='-'){
		p++;
		return not(calc());
	}
	if(s[p]=='('){
		p++;
		int res1=calc();
		if(s[p]=='*'){
			p++;
			int res2=calc();
			p++;
			return and(res1,res2);
		}
		else if(s[p]=='+'){
			p++;
			int res2=calc();
			p++;
			return or(res1,res2);
		}
		else if(s[p]=='-'){
			p+=2; //>を読み飛ばす
			int res2=calc();
			p++;
			return naraba(res1,res2);
		}
	}
	cout<<"Error "<<s[p]<<endl;
	return -1;
}


int main()
{
	while(cin>>s && s[0]!='#'){

		bool ok=true;
		for(bit=0;bit<(1<8);bit++){
			p=0;
			int ans1=calc();
			p++;
			int ans2=calc();
			if(ans1!=ans2){ok=false;break;}
		}
		if(ok) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}

Compiler output:
a.cc:5:5: error: expected unqualified-id before 'not' token
    5 | int not(int a){
      |     ^~~
a.cc:10:9: error: expected unqualified-id before 'int'
   10 | int and(int a,int b){
      |         ^~~
a.cc:10:9: error: expected ')' before 'int'
   10 | int and(int a,int b){
      |        ~^~~
      |         )
a.cc:15:5: error: expected unqualified-id before 'or' token
   15 | int or(int a,int b){
      |     ^~
a.cc: In function 'int calc()':
a.cc:51:35: error: expected identifier before '(' token
   51 |                         return and(res1,res2);
      |                                   ^
a.cc:51:35: error: expected ';' before '(' token
   51 |                         return and(res1,res2);
      |                                   ^
      |                                   ;
a.cc:57:32: error: expected primary-expression before 'or' token
   57 |                         return or(res1,res2);
      |                                ^~
Language: C++

#include <iostream>
using namespace std;

bool formula(string &s, int &p)
{
    if (s[p] == 'T') {
	++p;
	return true;
    } else if (s[p] == 'F') {
	++p;
	return false;
    } else if (s[p] == '-') {
	++p;
	return !formula(s, p);
    } else if (s[p] == '(') {
	++p;
	bool lhs = formula(s, p);
	if (s[p] == '*') {
	    ++p;
	    bool rhs = formula(s, p);
	    ++p;
	    return (lhs&&rhs);
	} else if (s[p] == '+') {
	    ++p;
	    bool rhs = formula(s, p);
	    ++p;
	    return (lhs||rhs);
	} else {
	    ++p;
	    ++p;
	    bool rhs = formula(s, p);
	    ++p;
	    if (lhs && !rhs)
		return false;
	    else
		return true;
	}
    }
}

bool equation(string& s, int& p)
{
    bool lhs = formula(s, p);
    ++p;
    bool rhs = formula(s, p);

    //cout << lhs << " " << rhs << endl;
    if (lhs == rhs)
	return true;
    else
	return false;
}

int main()
{
    const string V = "abcdefghijk";

    string s;
    while (cin >> s) {
	if (s == "#")
	    break;

	bool ans = true;
	for (int i = 0; i < (1 <<11); ++i) {
	    string t = s;
	    for (int j = 0; j < t.size(); ++j) {
		if (binary_search(V.begin(), V.end(), t[j])) {
		    if (i & (1 << (t[j]-'a')))
			t[j] = 'T';
		    else
			t[j] = 'F';
		}
	    }

	    int p = 0;
	    if (!equation(t, p))
		ans = false;
	}

	if (ans)
	    cout << "YES" << endl;
	else
	    cout << "NO" << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:21: error: 'binary_search' was not declared in this scope
   67 |                 if (binary_search(V.begin(), V.end(), t[j])) {
      |                     ^~~~~~~~~~~~~
a.cc: In function 'bool formula(std::string&, int&)':
a.cc:39:1: warning: control reaches end of non-void function [-Wreturn-type]
   39 | }
      | ^
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#define all(c) c.begin(),c.end()
#define uni(c) c.erase(unique(c.begin(),c.end()),c.end())
#define pb push_back
using namespace std;

int expr(string& s, int& i);
int term(string& s, int& i);
int factor(string& s, int& i);
int number(string& s, int& i);


int expr(string& s, int& i) {
  int val = term(s, i);
  while(s[i] == '+' || s[i] == '-') {
    char op = s[i];
    i++;
  	if(!isdigit(s[i])){
  		i++;
  		int val2 = term(s, i);
  		if(val==1&&val2==0){
  			val=0;
  		}else{
  			val=1;
  		}
  	}else{
  	  int val2 = term(s, i);
    	if (op == '+') val |= val2;
  	}
  }
  return val;
}

int term(string& s, int& i) {
  int val = factor(s, i);
  while(s[i] == '*') {
    char op = s[i];
    i++;
    int val2 = factor(s, i);
    if (op == '*') val *= val2;
  }
  return val;
}

int factor(string& s, int& i) {
	int flag=0;
	if(s[i]=='-'){
		flag=1;
		i++;
	}
	if (isdigit(s[i])){
		if(flag)
			return flag^number(s, i);
			return number(s,i);
	}

  // ここで構文が正しければ s[i] == '(' となる
  i++; // '('を読み飛ばす
  int ret = expr(s, i);
  i++; // ')'を読み飛ばす
	if(flag)
	return flag^ret;
	return ret;
}

int number(string& s, int& i) {
  int n = s[i++] - '0';
  while(isdigit(s[i])) n = n*10 + s[i++] - '0';
  return n;
}

int main(){
	string s;
	while(cin>>s,s!="#"){
		int eq=0;
		string a,b;
		for(;s[eq]!='=';eq++);
		a=s.substr(0,eq),b=s.substr(eq+1,s.size()-eq);
		//cout<<a<<" "<<b<<endl;
		vector<char> ap;
		for(int i=0;i<s.size();i++){
			if(isalpha(s[i]))
				ap.pb(s[i]);
		}
		sort(all(ap));
		uni(ap);
		bool flag=true;
		for(int i=0;i<(1<<ap.size());i++){
			string x=a,y=b;
			for(int j=0;j<ap.size();j++){
				char c=ap[j];
				bool wh=false;
				if((1<<j)&i)
					wh=true;
				for(int k=0;k<x.size();k++){
					if(x[k]==c){
						if(wh)
							x[k]='1';
						else
							x[k]='0';
					}
				}
				for(int k=0;k<y.size();k++){
					if(y[k]==c){
						if(wh)
							y[k]='1';
						else
							y[k]='0';
					}
				}
			}
			
			
			\if(expr(x,0)!=expr(y,0)){
				cout<<"NO"<<endl;
				flag=false;
				break;
			}
			
		}
		if(flag)
			cout<<"YES"<<endl;
	}
	return 0;
}

Compiler output:
a.cc:117:25: error: stray '\' in program
  117 |                         \if(expr(x,0)!=expr(y,0)){
      |                         ^
a.cc: In function 'int main()':
a.cc:117:36: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
  117 |                         \if(expr(x,0)!=expr(y,0)){
      |                                    ^
a.cc:16:26: note:   initializing argument 2 of 'int expr(std::string&, int&)'
   16 | int expr(string& s, int& i) {
      |                     ~~~~~^
a.cc:117:47: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
  117 |                         \if(expr(x,0)!=expr(y,0)){
      |                                               ^
a.cc:16:26: note:   initializing argument 2 of 'int expr(std::string&, int&)'
   16 | int expr(string& s, int& i) {
      |                     ~~~~~^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>
 
#define rep(i, n) for(int i = 0; i < (n); i++)
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define all(v) (v).begin(), (v).end()
#define rev(s) (s).rbegin(), (s).rend()
#define MP make_pair
#define X first
#define Y second
 
using namespace std;
 
typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vi;

void fin(){
	freopen("test.txt", "r", stdin);
}

bool formula(const string &s){
	rep(i,2){
		if(s[0] == "FT"[i]) return i;
	}

	if(s[0] == '-'){
		return !formula(s.substr(1));
	}

	int lidx = 1, llen, ridx, rlen;
	char ope;
	int nest = 0;
	rep(i, s.size()){
		if(s[i] == '(') nest++;
		if(s[i] == ')') nest--;
		if(nest != 1) continue;
		rep(j, 3) if(s[i] == "*+>"[j]){
			ope = s[i];
			llen= i-1-(s[i] == '>');
			ridx = i+1;
			rlen = s.size()-ridx-1;
			goto next;
		}
	}
next:
	bool lhs = formula(s.substr(lidx, llen));
	bool rhs = formula(s.substr(ridx, rlen));
	
	if(ope == '+') return lhs|rhs;
	if(ope == '*') return lhs&rhs;
	if(lhs&(!rhs)) return false;
	return true;
}

bool equation(string &s){
	rep(i, s.size()){
		if(s[i] != '=') continue;
		return formula(s.substr(0, i)) == formula(s.substr(i+1, s.size()));
	}
}

string replace(const string &s, char from, char to){
	string res = s;
	rep(i, res.size()){
		if(res[i] == from) res[i] = to;
	}
	return res;
}

bool include(const string &s, const char c){
	rep(i, s.size()){
		if(s[i] == c) return true;
	}
	return false;
}

string val = "abcdefghijk";
bool dfs(string &s, int i = 0){
	if(i == val.size()) return equation(s);
	if(!include(s, val[i])) return dfs(s, i+1);
	rep(j, 2){
		if(!dfs(replace(s, val[i], "TF"[j]), i+1)) return false;
	}
	return true;
}

int main(){
//	fin();
	string s;
	while(cin >> s){
		if(s[0] == '#') break;
		cout << (dfs(s)?"YES":"NO") << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'bool dfs(std::string&, int)':
a.cc:95:32: 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>'}
   95 |                 if(!dfs(replace(s, val[i], "TF"[j]), i+1)) return false;
      |                         ~~~~~~~^~~~~~~~~~~~~~~~~~~~
a.cc:91:18: note:   initializing argument 1 of 'bool dfs(std::string&, int)'
   91 | bool dfs(string &s, int i = 0){
      |          ~~~~~~~~^
a.cc: In function 'bool equation(std::string&)':
a.cc:73:1: warning: control reaches end of non-void function [-Wreturn-type]
   73 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>
 
#define rep(i, n) for(int i = 0; i < (n); i++)
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define all(v) (v).begin(), (v).end()
#define rev(s) (s).rbegin(), (s).rend()
#define MP make_pair
#define X first
#define Y second
 
using namespace std;
 
typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vi;

void fin(){
	freopen("test.txt", "r", stdin);
}

bool formula(const string &s){
	rep(i,2){
		if(s[0] == "FT"[i]) return i;
	}

	if(s[0] == '-'){
		return !formula(s.substr(1));
	}

	int lidx = 1, llen, ridx, rlen;
	char ope;
	int nest = 0;
	rep(i, s.size()){
		if(s[i] == '(') nest++;
		if(s[i] == ')') nest--;
		if(nest != 1) continue;
		rep(j, 3) if(s[i] == "*+>"[j]){
			ope = s[i];
			llen= i-1-(s[i] == '>');
			ridx = i+1;
			rlen = s.size()-ridx-1;
			goto next;
		}
	}
next:
	bool lhs = formula(s.substr(lidx, llen));
	bool rhs = formula(s.substr(ridx, rlen));
	
	if(ope == '+') return lhs|rhs;
	if(ope == '*') return lhs&rhs;
	if(lhs&(!rhs)) return false;
	return true;
}

bool equation(string &s){
	rep(i, s.size()){
		if(s[i] != '=') continue;
		return formula(s.substr(0, i)) == formula(s.substr(i+1, s.size()));
	}
	return false;
}

string replace(const string &s, const char from, const char to){
	string res = s;
	rep(i, res.size()){
		if(res[i] == from) res[i] = to;
	}
	return res;
}

bool include(const string &s, const char c){
	rep(i, s.size()){
		if(s[i] == c) return true;
	}
	return false;
}

string val = "abcdefghijk";
bool dfs(string &s, int i = 0){
	if(i == val.size()) return equation(s);
	if(!include(s, val[i])) return dfs(s, i+1);
	rep(j, 2){
		if(!dfs(replace(s, val[i], "TF"[j]), i+1)) return false;
	}
	return true;
}

int main(){
//	fin();
	string s;
	while(cin >> s){
		if(s[0] == '#') break;
		cout << (dfs(s)?"YES":"NO") << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'bool dfs(std::string&, int)':
a.cc:96:32: 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>'}
   96 |                 if(!dfs(replace(s, val[i], "TF"[j]), i+1)) return false;
      |                         ~~~~~~~^~~~~~~~~~~~~~~~~~~~
a.cc:92:18: note:   initializing argument 1 of 'bool dfs(std::string&, int)'
   92 | bool dfs(string &s, int i = 0){
      |          ~~~~~~~~^
Language: C++

// Equation
import java.util.*;

public class Main {
	static int pos;
	static String equation;
	static int a, b, c, d, e, f, g, h, i, j, k;

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			equation = scanner.next();
			if (equation.equals("#"))
				break;
			boolean result = true;
			out: for (a = 0; a < 2; a++)
				for (b = 0; b < 2; b++)
					for (c = 0; c < 2; c++)
						for (d = 0; d < 2; d++)
							for (e = 0; e < 2; e++)
								for (f = 0; f < 2; f++)
									for (g = 0; g < 2; g++)
										for (h = 0; h < 2; h++)
											for (i = 0; i < 2; i++)
												for (j = 0; j < 2; j++)
													for (k = 0; k < 2; k++) {
														pos = 0;
														result = result
																&& eval();
														if (!result)
															break out;
													}
			if (result)
				System.out.println("YES");
			else
				System.out.println("NO");
		}
		scanner.close();
	}

	static boolean eval() {
		boolean boola = formura();
		pos++;
		boolean boolb = formura();
		return boola == boolb;
	}

	static boolean formura() {
		char cha = equation.charAt(pos);
		pos++;
		switch (cha) {
		case 'T':
			return true;
		case 'F':
			return false;
		case 'a':
			return a == 1;
		case 'b':
			return b == 1;
		case 'c':
			return c == 1;
		case 'd':
			return d == 1;
		case 'e':
			return e == 1;
		case 'f':
			return f == 1;
		case 'g':
			return g == 1;
		case 'h':
			return h == 1;
		case 'i':
			return i == 1;
		case 'j':
			return j == 1;
		case 'k':
			return k == 1;
		case '-':
			return !formura();
		case '(':
			boolean boola = formura();
			char chb = equation.charAt(pos);
			pos++;
			boolean boolb;
			switch (chb) {
			case '*':
				boolb = formura();
				pos++;
				return boola && boolb;
			case '+':
				boolb = formura();
				pos++;
				return boola || boolb;
			case '-':
				pos++;
				boolb = formura();
				pos++;
				return !boola || boolb;
			}
		}
		return false;
	}
}

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

1 1 1
5 5 0 5
2 1 2
5 5 0 5
15 5 0 5
3 2 3
15 15 0 5
5 5 10 5
25 25 20 5
0 0 0


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

#include<vector>
#include<iostream>
#include<string>
#include<algorithm>
#include<complex>
#include<cmath>
#define pb(a) push_back(a)
const double EPS = 1e-8;
using namespace std;
const double INF = 1e12;
typedef complex<double> P;
namespace std{
	bool operator<(const P& a,const P& b){
		return real(a)!=real(b)?real(a)<real(b):imag(a)<imag(b);
	}
}
double cr(const P& a, const P& b){
	return imag(conj(a)*b);
}	
double dt(const P& a, const P& b){
	return real(conj(a)*b);
}
struct L : public vector<P>{
	L(const P &a,const P& b){
		pb(a);pb(b);
	}
};
typedef vector<P> G;

struct C{
	P p;double r;
	C(const P &p,double r) : p(p),r(r){}
};

int ccw(P a,P b,P c){
	b -= a;
	c -= a;
	if(cr(b,c) > 0)return 1;
	if(cr(b,c)< 0)return -1;
	if(dt(b,c)<0)return 2;
	if(norm(b)<norm(c))return -2;
	return 0;
}
P pro(const L &l,const P &p){
	double t=dt(p-l[0],l[0]-l[1])/norm(l[0]-l[1]);
	return l[0]+t*(l[0]-l[1]);
}

bool itSP(const L &s, const P &p){
	return abs(s[0]-p)+abs(s[1]-p)-abs(s[0]-s[1]) < EPS;
}

bool itSS(const L &s, const L &t){
	return ccw(s[0],s[1],t[0])*ccw(s[0],s[1],t[1]) <= 0 &&
		ccw(t[0],t[1],s[0])*ccw(t[0],t[1],s[1]) <= 0;
}

double dstSP(const L &s,const P &p){
	const P r = pro(s,p);
	if(itSP(s,r))return abs(r-p);
	return min(abs(s[0]-p),abs(s[1]-p));
}
double dstSS(const L &s,const L &t){
	if(itSS(s,t))return 0;
	return min(min(dstSP(s,t[0]),dstSP(s,t[1])),min(dstSP(t,s[0]),dstSP(t,s[1])));
}
#define rep(i,j) for(int i=0;i<j;i++)
vector<L> hoge(int x,int y,int r,int th_){
	double th=th_*1.*2*M_PI/360+M_PI/2;
	vector<P> ps(5);
	rep(i,5){
		double a=th+i*2*M_PI/5;
		ps[i].real()=x+cos(a);
		ps[i].imag()=y+sin(a);
	}
	vector<L> re;
	rep(i,5){
		re.pb(L(ps[i],ps[(i+1)%5]));
	}
	return re;
}
int main(){
	int n,m,l;
	while(cin >> n >> m >> l&&n){
	vector<vector<L> > st;
	rep(i,n){
		int x,y,a,r;
		cin >> x >> y >> a >> r;
		st.pb(hoge(x,y,r,a));
	}
	double dst[100][100];
	fill_n(dst[0],sizeof(dst)/sizeof(double),INF);
	rep(i,n){
		rep(j,n){
			double d = INF;
			vector<L> t = st[i];
			vector<L> u = st[j];
			rep(k,5){
				rep(kk,5){
					d = min(dstSS(t[k],u[kk]),d);
				}
			}
			dst[i][j]=d;
		}
	}
	rep(k,n)rep(i,n)rep(j,n){
		dst[i][j] = min(dst[i][j],dst[i][k]+dst[k][j]);
	}
	cout <<fixed << setprecision(10)<< dst[m-1][l-1] << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'std::vector<L> hoge(int, int, int, int)':
a.cc:73:27: error: lvalue required as left operand of assignment
   73 |                 ps[i].real()=x+cos(a);
      |                 ~~~~~~~~~~^~
a.cc:74:27: error: lvalue required as left operand of assignment
   74 |                 ps[i].imag()=y+sin(a);
      |                 ~~~~~~~~~~^~
a.cc: In function 'int main()':
a.cc:109:25: error: 'setprecision' was not declared in this scope
  109 |         cout <<fixed << setprecision(10)<< dst[m-1][l-1] << endl;
      |                         ^~~~~~~~~~~~
a.cc:7:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    6 | #include<cmath>
  +++ |+#include <iomanip>
    7 | #define pb(a) push_back(a)
Language: C++

#include<iostream>
#include<cstdio>
#include<vector>
#include<cstring>
#include<cctype>
#include<complex>
#include<algorithm>
#include<iomanip>
#define rep(X,Y) for(int X=0;(X)<(Y);++X)
#define X first
#define Y second
#define pb push_back

using namespace std;

typedef pair<int,int> pii;
typedef pair<int,pii> piii;

const double EPS=1e-8;
typedef complex<double> P;
namespace std{
  bool operator< (const P &a, const P &b){
    return real(a)!=real(b)?real(a)<real(b):imag(a)<imag(b);
  }
}

double cross(const P &a,const P &b){
  return imag(conj(a)*b);
}
double dot(const P &a,const P &b){
  return real(conj(a)*b);
}

struct L : public vector<P>{
  L(const P &a,const P &b){
    pb(a); pb(b);
  }
};

P proj(const L &l,const P &p){
  double t=dot(p-l[0],l[0]-l[1])/norm(l[0]-l[1]);
  return l[0]+t*(l[0]-l[1]);
}

int ccw(P a,P b,P c){
  b-=a; c-=a;
  if(cross(b,c)>EPS) return 1;
  if(cross(b,c)<-EPS) return -1;
  if(dot(b,c)<-EPS) return 2;
  if(norm(b)<norm(c)+EPS) return -2;
  return 0;
}

double intersectSS(const L &s,const L &t){
  return ccw(s[0],s[1],t[0])*ccw(s[0],s[1],t[1])<=0 &&
    ccw(t[0],t[1],s[0])*ccw(t[0],t[1],s[1])<=0;
}

double intersectSP(const L &s,const P &p){
  return abs(s[0]-p)+abs(s[1]-p)-abs(s[1]-s[0])<EPS;
}

double distSP(const L &s, const P &p){
  const P r=proj(s,p);
  if(intersectSP(s,r))return abs(r-p);
  return min(abs(s[0]-p), abs(s[1]-p));
}

double distSS(const L &s,const L &t){
  if(intersectSS(s,t)) return 0;
  return min({distSP(s,t[0]),distSP(s,t[1]),distSP(t,s[0]),distSP(t,s[1])});	 
}

const double M_PI=3.14159265358979;

int main(){
  int n,m,l;
  while(cin>>n>>m>>l,n){
    vector<vector<L>> st(n);
    cout<<fixed<<setprecision(10);
    int x,y,a,r;
    rep(i,n){
      cin>>x>>y>>a>>r;
      double th=M_PI/2+1.*a*M_PI/180;
      vector<P> ps(5);
      rep(j,5){
	ps[j]=P(x+r*cos(th),y+r*sin(th));
	th+=72.*M_PI/180;
      }
      rep(j,5){
	st[i].pb(L(ps[j],ps[(j+2)%5]));
      }
    }
    
    double d[n][n];
    fill(d[0],d[0]+n*n,1e20);
    rep(i,n)rep(j,n)rep(a,5)rep(b,5)
      d[i][j]=min(d[i][j],distSS(st[i][a],st[j][b]));
    //rep(i,n){rep(j,n)cout<<d[i][j]<<" ";cout<<endl;}
    rep(k,n)rep(i,n)rep(j,n)
      d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
    cout<<d[m-1][l-1]<<endl;
  }
}

Compiler output:
In file included from /usr/include/c++/14/cmath:47,
                 from /usr/include/c++/14/complex:44,
                 from a.cc:6:
a.cc:74:14: error: expected unqualified-id before numeric constant
   74 | const double M_PI=3.14159265358979;
      |              ^~~~
Language: C++

#include <complex>
#include <cmath>
#include <iostream>
#include <utility>
#include <vector>
#include <cassert>
#include <algorithm>
#include <cstdio>
#include <climits>
using namespace std;

#define X real()
#define Y imag()

#define fi first
#define se second

typedef complex<double> PT;
typedef PT VC;
typedef pair<PT,PT> LN;
typedef pair<PT,PT> SG;

const double EPS = 1e-8;

double dot_prod(VC a, VC b) {
	return a.X * b.X + a.Y * b.Y;
}
double cross_prod(VC a, VC b) {
	return a.X * b.Y - a.Y * b.X;
}

double dist_pts_line(PT p, LN l) {
	VC a, b;
	a = l.fi - p;
	b = l.se - p;
	return abs(cross_prod(a,b) / abs(l.fi-l.se));
}

// ??\??????????????????????????????

// ???????????´??????????????£???????????????false??????????????§??¨???
bool has_intersec_seg_seg(SG a, SG b) {
	VC va, vb, vc;
	bool res = true;
	for(int i = 0; i < 2; i++) {
		va = b.fi-a.fi; vb = b.se-a.fi; vc = a.se-a.fi;
		res = res && cross_prod(va, vc) * cross_prod(vb, vc) < EPS;
		swap(a,b);
	}
	res = res && abs(cross_prod(a.fi-a.se, b.fi-b.se)) > EPS;
	return res;
}

double dist_pts_seg(PT p, SG a) {
	double res;
	res = min(abs(a.fi-p), abs(a.se-p));
	if(dot_prod(a.se - a.fi, p - a.fi) > -EPS
			&& dot_prod(a.fi - a.se, p - a.se) > -EPS)
		res = min(res, dist_pts_line(p, a));
	return res;
}

double dist_seg_seg(SG a, SG b) {
	double res = DBL_MAX;
	for(int i = 0; i < 2; i++) {
		res = min(res, min(dist_pts_seg(a.fi,b), dist_pts_seg(a.se,b)));
		swap(a,b);
	}
	if(has_intersec_seg_seg(a,b))
		res = 0;
	return res;
}

/* //???????????????
int main() {
	SG a(PT(0,0),PT(0,2));
	SG b(PT(-1,1),PT(2,1));
	cout << dist_seg_seg(a,b) << endl;
} // */

//*
int N, M, L;
vector<vector<SG> > star;
double edge[120][120];

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

void init() {
	star.clear();
	rep(i,120) {
		rep(j,120)
			edge[i][j] = 1e9;
		edge[i][i] = 0;
	}
}

int main() {
	while(cin >> N >> M >> L, N || M || L) {
		init();
		M--; L--;
		rep(i,N) {
			int x, y, a, r;
			cin >> x >> y >> a >> r;
			vector<PT> tmp;
			double theta = (a+90) / 180.0 * M_PI;
			double phi = 360.0 / 5.0 / 180.0 * M_PI;
			rep(i,5) {
				tmp.push_back(polar((double)r, theta + phi * i) + PT(x,y));
			//	cout << tmp[i] << endl;
			}
			vector<SG> push;
			rep(i,5) {
				push.push_back(SG(tmp[i],tmp[(i+2)%5]));
			}
			star.push_back(push);
		}

		rep(i,N) {
			for(int j = i+1; j < N; j++) {
				double tmp = 1e9;
				rep(k,5) {
					rep(l, 5) {
						tmp = min(tmp, dist_seg_seg(star[i][k], star[j][l]));
					}
				}
				edge[i][j] = edge[j][i] = tmp;
			}
		}

		rep(i,N) {
			rep(j,N) {
				rep(k,N) {
					edge[j][k] = min(edge[j][k], edge[j][i] + edge[i][k]);
				}
			}
		}
		printf("%.10lf\n", edge[L][M]);
	}
}
// */

Compiler output:
a.cc: In function 'double dist_seg_seg(SG, SG)':
a.cc:64:22: error: 'DBL_MAX' was not declared in this scope
   64 |         double res = DBL_MAX;
      |                      ^~~~~~~
a.cc:10:1: note: 'DBL_MAX' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
    9 | #include <climits>
  +++ |+#include <cfloat>
   10 | using namespace std;
Language: C++

#include <iostream>
#include <iomanip>
#include <cmath>
#define REP(i,n) for(int i = 0;i < (n);i++)
#define FOR(i,a,n) for(int i = (a);i < (n);i++)
const double M_PI = acos(-1);
const double EPS = 1e-10;
const double INF = 1e9;
using namespace std;

int N,M,L;

struct Point{
    double x,y;
    Point operator - (const Point& p){ return Point{x-p.x,y-p.y};}
};

struct Segment{
    Point p1,p2;
};

double norm(Point a){return a.x*a.x+a.y*a.y;}
double abs(Point a){return sqrt(norm(a));}
double dot(Point a, Point b){return a.x * b.x + a.y * b.y;}
double cross(Point a,Point b){return a.x*b.y - a.y*b.x;}

int ccw(Point p1,Point p2,Point p3){
    Point a = {p2.x-p1.x, p2.y - p1.y};
    Point b = {p3.x-p1.x, p3.y - p1.y};
    if(cross(a,b) > EPS) return 1;
    if(cross(a,b) < -EPS) return -1;
    if(dot(a,b) < -EPS) return 2;
    if(norm(a) < norm(b)) return -2;
    return 0;
}

bool intersect(Point p1, Point p2, Point p3, Point p4){
    return ccw(p1,p2,p3)*ccw(p1,p2,p4) <= 0 && ccw(p3,p4,p1)*ccw(p3,p4,p2) <= 0;
}

bool intersect(Segment s1, Segment s2){
    return intersect(s1.p1,s1.p2, s2.p1, s2.p2);
}

double getDistSP(Segment s, Point p){
    if(dot(s.p2 - s.p1, p - s.p1) < -EPS) return abs(p - s.p1);
    if(dot(s.p1 - s.p2, p - s.p2) < -EPS) return abs(p - s.p2);
    return abs(cross(s.p2 - s.p1, p - s.p1) / abs(s.p2 - s.p1));
}
    

Segment star[102][5];
double mindist[102][102];



double getdist(int u, int v){
    REP(i,5){
        REP(j,5){
            if(intersect(star[u][i],star[v][j])){
                    return 0;
            }
        }
    }
    double ans = INF;
    REP(k,2){
        if(k) swap(u,v);
        REP(i,5){
            REP(j,5){
                ans = min(getDistSP(star[u][i],star[v][j].p1),ans);
            }
        }
    }
    return ans;
}

int main(){
    while(cin>>N>>M>>L,N){
        REP(i,N){
            int x,y,a,r;
            cin>>x>>y>>a>>r;
            Point p[5];
            REP(j,5) p[j] = Point{x + r*sin((double)(72*j - a)/180*M_PI), y + r*cos((double)(72*j - a)/180*M_PI)};//star's vertex
            REP(j,5){
                star[i][j] = Segment{p[j], p[(j+2)%5]};
            }
        }

        //caluculate min distance
        REP(i,N){
            FOR(j,i,N){
                mindist[i][j] = mindist[j][i] = getdist(i,j);
            }
        }

        //WF        
        REP(k,N){
            REP(i,N){
                REP(j,N){
                    mindist[i][j] = min(mindist[i][j], mindist[i][k] + mindist[k][j]);
                }
            }
        }
        cout << fixed << setprecision(8) << mindist[M-1][L-1] << endl;
    }
}

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