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

#include<iostream>
using namespace std;
int main()
{
    int buy;
    int have[4],turi[4];
    int en[4]={10,50,100,500};
    while(cin>>buy)
    {
        for(int i=0;i<4;i++){
            cin>>have[i];
        }
        for(int i=3,i>=0;i--){
            turi[i]=buy/en[i];
            if(turi[i]>have[i]){
                buy-=have[i]*en[i];
                turi[i]=have[i];
            }
            else{
                buy-=turi[i]*en[i];
            }
        }
        for(int i=0;i<4;i++){
            cout<<en[i]<<" "<<turi[i]<<endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:22: error: expected ';' before '>=' token
   13 |         for(int i=3,i>=0;i--){
      |                      ^~
      |                      ;
a.cc:13:22: error: expected primary-expression before '>=' token
   13 |         for(int i=3,i>=0;i--){
      |                      ^~
Language: C++

#include <iostream>
using namespace std;
const int c[] = { 10, 50, 100, 500 };
int main(){
    int price=0
    int n[4];
    int kaigyo=0;
    while( cin>>price ){
        for( int i = 0; i < 4; i++ ){
            cin >> n[i];
            price -= c[i] * n[i];
        }
        price *= -1;
        for( int i = 3; i >= 0; i-- ){
            if( price >= c[i] ){
                n[i] -= price / c[i];
                price %= c[i];
            }
        }
        if(kaigyo!=0)cout<<endl;
        for( int i = 0; i < 4; i++ ){
            if( n[i] > 0 ){
                cout << c[i] << ' ' << n[i] << endl ;
            }
        }
        kangyo=1;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: expected ',' or ';' before 'int'
    6 |     int n[4];
      |     ^~~
a.cc:10:20: error: 'n' was not declared in this scope
   10 |             cin >> n[i];
      |                    ^
a.cc:16:17: error: 'n' was not declared in this scope
   16 |                 n[i] -= price / c[i];
      |                 ^
a.cc:22:17: error: 'n' was not declared in this scope
   22 |             if( n[i] > 0 ){
      |                 ^
a.cc:26:9: error: 'kangyo' was not declared in this scope; did you mean 'kaigyo'?
   26 |         kangyo=1;
      |         ^~~~~~
      |         kaigyo
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
	vector<int> a(10);
	vector<int> b(10);
	for(int i=0;i<10;i++){
		cin >> a[i];
	}
	for(int i=0;i<10;i++){
		cin >> b[i];
	}
	reverse(a.begin(),a.end())
	reverse(b.begin(),b.end())
	sort(a.begin(),a.end());
	cout << a[0] + a[1] + a[2] << " ";
	sort(b.begin(),b.end());
	cout << b[0] + b[1] + b[2] << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:35: error: expected ';' before 'reverse'
   14 |         reverse(a.begin(),a.end())
      |                                   ^
      |                                   ;
   15 |         reverse(b.begin(),b.end())
      |         ~~~~~~~
Language: C++

#include <iostream>

using namespace std;

int main(){
  int flg=false;
  int p=0;
  while(cin >> p && p>0){
    int x[4]={};
    cin >> x[0] >> x[1] >> x[2] >> x[3];

    int r=(x[0]*10+x[1]*50+x[2]*100+x[3]*500)-p;

    int y[4]={};
    y[3]=r/500;    r-=y[3]*500;
    y[2]=r/100;    r-=y[2]*100;
    y[1]=r/50;     r-=y[1]*50;
    y[0]=r/10;
    if(!flg){
      cout << '' << endl;
      flg=true;
    }
    if(x[0]>y[0]) cout << "10 "  << (x[0]-y[0]) << endl;
    if(x[1]>y[1]) cout << "50 "  << (x[1]-y[1]) << endl;
    if(x[2]>y[2]) cout << "100 " << (x[2]-y[2]) << endl;
    if(x[3]>y[3]) cout << "500 " << (x[3]-y[3]) << endl;
  }
  return 0;
}

Compiler output:
a.cc:20:15: error: empty character constant
   20 |       cout << '' << endl;
      |               ^~
Language: C++


#include <iostream>

using namespace std;

int main(){
  int flg=false;
  int p=0;
  while(cin >> p && p>0){
    int x[4]={};
    cin >> x[0] >> x[1] >> x[2] >> x[3];

    int r=(x[0]*10+x[1]*50+x[2]*100+x[3]*500)-p;

    int y[4]={};
    y[3]=r/500;    r-=y[3]*500;
    y[2]=r/100;    r-=y[2]*100;
    y[1]=r/50;     r-=y[1]*50;
    y[0]=r/10;
    if(!flg){
      cout << '' << endl;
      flg=true;
    }
    if(x[0]>y[0]) cout << "10 "  << (x[0]-y[0]) << endl;
    if(x[1]>y[1]) cout << "50 "  << (x[1]-y[1]) << endl;
    if(x[2]>y[2]) cout << "100 " << (x[2]-y[2]) << endl;
    if(x[3]>y[3]) cout << "500 " << (x[3]-y[3]) << endl;
  }
  return 0;
}

Compiler output:
a.cc:21:15: error: empty character constant
   21 |       cout << '' << endl;
      |               ^~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<list>
using namespace std;
int inf = 1000000000;


int main(void) {
  int num[4] = {10, 50, 100, 500};
  int n;
  bool f = true;
  while(cin >> n){
    if( n == 0 ) break;
    if( !f ) cout << endl;
    f = false;
    vector<int> c(4);
    vector<int> a(4, 0);
    for(int i=0; i<4; i++) cin >> c[i];

    int ans = 100;
    for(int i=0; i<=c[0]; i++){
      for(int j=0; j<=c[1]; j++){
        for(int k=0; k<=c[2]; k++){
          for(int l=0; l<=c[3]; l++){
            vector<int> tmp = c;
            int p = i * 10 + j * 50 + k * 100 + l * 500;
            if( p < n ) continue;
            tmp[0] -= i; tmp[1] -= j; tmp[2] -= k; tmp[3] -= l;
            int r = p - n;
            while( r >= 500 ){r -= 500; tmp[3]++;}
            while( r >= 100 ){r -= 100; tmp[2]++;}
            while( r >= 50 ){r -= 50; tmp[1]++;}
            while( r >= 10 ){r -= 10; tmp[0]++;}
            int sum = accumulate(tmp.begin(), tmp.end(), 0);
            if( ans == sum ){
              if( accumulate(a.begin(), a.end(), 0) > i + j + k + l ){
                a[0] = i; a[1] = j; a[2] = k; a[3] = l;
              }
            }else if( ans > sum ){
              ans = sum;
              a[0] = i; a[1] = j; a[2] = k; a[3] = l;
            }

          }
        }
      }
    }
    for(int i=0; i<4; i++){
      if( a[i] == 0 ) continue;
      cout << num[i] << " " << a[i] << endl;
    }

  }
javascript:void(0)
  return 0;
}

// EOF

Compiler output:
a.cc: In function 'int main()':
a.cc:64:19: error: expected ';' before 'return'
   64 | javascript:void(0)
      |                   ^
      |                   ;
   65 |   return 0;
      |   ~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
    while(true){
        int money[4] = {10, 50, 100, 500};
        int n, have[4];
        cin >> n;
        if(n == 0)
            break;
        for(int i=0; i<4; i++){
            cin >> have[i];
            sum += have[i]*money[i];
        }
        sum -= n;

        int aft[4];
        for(int i=0; i<4; i++){
            aft[3-i] = sum/money[3-i];
            sum -= aft[3-i] * money[3-i];
        }
        for(int i=0; i<4; i++){
            if(aft[i] < have[i])
                cout << money[i] << ' ' << have[i]-aft[i] << endl;
        }
    }
  
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: 'sum' was not declared in this scope
   13 |             sum += have[i]*money[i];
      |             ^~~
a.cc:15:9: error: 'sum' was not declared in this scope
   15 |         sum -= n;
      |         ^~~
Language: C++

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

int main()
{
  vector<int> c{10, 50, 100, 500};
  vector<int> k;  //余った硬貨の枚数
  vector<int> num; //所持している硬貨の枚数
  int pay； //支払金額

  while(1) {
    cin >> pay;
    if(pay == 0)
      break;

    for(int i = 0; i < 4; i++) {
      int C;
      cin >> C;
      num.push_back(C);
    }

    int sum = 0;
    for(int i = 0; i < 4; i++) {
      sum += c[i] * num[i];
    }
    pay = sum - pay;

    for(int i = 3; i >= 0; i--){
      k[i] = pay / c[i];
      pay = (k[i] * c[i]) - pay;
    }

    for (int i = 0; i < 4; i++) {
      if(num[i] > k[i]) {
        cout << c[i] << " " << num[i] - k[i] << endl;
      }
    }

    k.clear();
    coin.clear();
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: expected initializer before 'while'
   12 |   while(1) {
      |   ^~~~~
Language: C++

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

int main()
{
  int c[4] = {10, 50, 100, 500};
  vector<int> num; //所持している硬貨の枚数
  int pay; //支払金額

  while(1) {
    cin >> pay;
    if(pay == 0)
      break;

    for(int i = 0; i < 4; i++) {
      int C;
      cin >> C;
      num.push_back(C);
    }

    int sum = 0;
    for(int i = 0; i < 4; i++) {
      sum += c[i] * num[i];
    }
    pay = sum - pay;

    int k[4] = {}; //余った硬貨の枚数

    for(int i = 3; i >= 0; i--){
      k[i] = pay / c[i];
      pay = pay - (k[i] * c[i]);
    }

    for (int i = 0; i < 4; i++) {
      if(num[i] > k[i]) {
        cout << c[i] << '' << num[i] - k[i] << endl;
      }
    }
    
    cout << endl;
    num.clear();
  }
}



Compiler output:
a.cc:37:25: error: empty character constant
   37 |         cout << c[i] << '' << num[i] - k[i] << endl;
      |                         ^~
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
const double PI = 3.14159265358979;
const double E = 2.718281828459045;
const double root2 = sqrt(2);
typedef pair<int, int> P;
typedef unsigned int ui;
int main() {
	int x;
　　　　bool g=true;
	while (cin >> x) {
		if (x == 0)break;
                if(!g)cout<<endl;  
                if(g)g=false;
		int a, b, c, d;
		cin >> a >> b >> c >> d;
		int memo[4];
		int mi = (int)MOD;
		for (int i = 0; i <= a; i++) {
			for (int j = 0; j <= b; j++) {
				for (int k = 0; k <= c; k++) {
					for (int l = 0; l <= d; l++) {
						if (10 * i + 50 * j + 100 * k + 500 * l >= x) {
							int count = a+b+c+d-(i + j + k + l);
							int aaa = 10 * i + 50 * j + 100 * k + 500 * l - x;
							int atmemo[4] = {};
							atmemo[3] = aaa / 500; count += atmemo[3]; aaa %= 500;
							atmemo[2] = aaa / 100; count += atmemo[2]; aaa %= 100;
							atmemo[1] = aaa / 50; count += atmemo[1]; aaa %= 50;
							atmemo[0] = aaa / 10; count += atmemo[0];
							if (mi > count) {
								bool f = true;
								if (atmemo[0] * i > 0)f = false;
								if (atmemo[1] * j > 0)f = false;
								if (atmemo[2] * k > 0)f = false;
								if (atmemo[3] * l > 0)f = false;
								if (f) {
									mi = count;
									memo[0] = i; memo[1] = j; memo[2] = k; memo[3] = l;
								}
							}
						}
					}
				}
			}
		}
		if (memo[0] > 0) {
			cout << 10 << " " << memo[0] << endl;
		}
		if (memo[1] > 0) {
			cout << 50 << " " << memo[1] << endl;
		}
		if (memo[2] > 0) {
			cout << 100 << " " << memo[2] << endl;
		}
		if (memo[3] > 0) {
			cout << 500 << " " << memo[3] << endl;
		}
	}
	return 0;
}


Compiler output:
a.cc:24:1: error: extended character 　 is not valid in an identifier
   24 | 　　　　bool g=true;
      | ^
a.cc:24:1: error: extended character 　 is not valid in an identifier
a.cc:24:1: error: extended character 　 is not valid in an identifier
a.cc:24:1: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:24:1: error: '\U00003000\U00003000\U00003000\U00003000bool' was not declared in this scope
   24 | 　　　　bool g=true;
      | ^~~~~~~~~~~~
a.cc:27:21: error: 'g' was not declared in this scope
   27 |                 if(!g)cout<<endl;
      |                     ^
a.cc:28:20: error: 'g' was not declared in this scope
   28 |                 if(g)g=false;
      |                    ^
Language: C++

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

using namespace std;

using namespace std;
int main() {
    int a[4], b[4], 
    int c[4] = {10,50,100,500}
    int d,e = 0, ju, i;
    while (cin>>d, d){
        if( e ) cout<<endl;
        e++;
        int sum = 0;
        for(i = 0; i < 4; i++) {
            cin>>a[i];
            sum += a[i] * c[i];
        }
        sum -= d;
        for (i = 4; i--;) {
            b[i] = sum / c[i];
            sum %= c[i];
        }
        for (i = 0; i < 4; i++) {
            ju = a[i] - b[i];
            if (ju>0) cout<<c[i]<<' '<<ju<<endl;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: expected unqualified-id before 'int'
   15 |     int c[4] = {10,50,100,500}
      |     ^~~
a.cc:23:27: error: 'c' was not declared in this scope
   23 |             sum += a[i] * c[i];
      |                           ^
a.cc:27:26: error: 'c' was not declared in this scope
   27 |             b[i] = sum / c[i];
      |                          ^
a.cc:32:29: error: 'c' was not declared in this scope
   32 |             if (ju>0) cout<<c[i]<<' '<<ju<<endl;
      |                             ^
Language: C++

import java.util.*;
import static java.util.Arrays.*;
import static java.lang.Math.*;
public class Main {

	static Scanner sc = new Scanner(System.in);
	static int tc;
	public static void main(String[] args) {
		tc = 0;
		while (read()) {
			solve();
			tc++;
		}
	}
	
	static int M;
	static int[] nc = new int[4], cv = {10, 50, 100, 500, 10000};
	static boolean read() {
		M = sc.nextInt();
		if (M == 0) return false;
		if (tc > 0) System.out.println();
		for (int i = 0; i < 4; i++) nc[i] = sc.nextInt();
		return true;
	}

	static void solve() {
		int[] ans = new int[4];
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < nc[i]; j++) {
				if (M > 0) {
					M -= cv[i];
					ans[i]++;
				}
			}
		}
		
		for (int i = 0; i < 4; i++) 
			if (ans[i] > 0) 
				System.out.println(cv[i] + " " + ans[i]);
	}	
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import static java.util.Arrays.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import static java.lang.Math.*;
      | ^~~~~~
a.cc:3: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++

#include <iostream>

using namespace std;
int value;
int v[4]={500,100,50,10};
int c[4];
//k~o·ÌÅ¬Ì
int change(int k){
	int res=0;
	for(int i=0;i<4;i++)
	{
		res += k / v[i];
		k %= v[i];
	}
	return res;
}
int mincount,minsum;
int r[4];
int t[4];
//aÔÚÌRCðp¢éBpµ½ªbB
void dfs(int a,int b,int sum){
	if(a==4){
		if(sum<value)return;
		int count=change(sum-value)-b;
		if(count<mincount||(count==mincount&&minsum>sum)){
			minsum=sum;
			mincount=count;
			for(int i=0;i<4;i++)
				r[i]=t[i];
		}
	}else{
		for(int i=0;i<=c[a];i++){
			t[a]=i;
			dfs(a+1,b+i,sum+v[a]*i);
		}
	}
}
int main(){
	int s=0;
	for(;;){
		cin>>value;
		if(value==0)break;
		if((s++)>0)cout<<endl;
		for(int i=3;i>=0;i--)
			cin>>c[i];
		mincount=minsum=INT_MAX;
		dfs(0,0,0);
		for(int i=3;i>=0;i--){
			if(r[i]>0){
				cout << v[i] << " " << r[i] << endl;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:33: error: 'INT_MAX' was not declared in this scope
   46 |                 mincount=minsum=INT_MAX;
      |                                 ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include <iostream>
  +++ |+#include <climits>
    2 |
Language: C++

v[5];a[]={0,10,50,100,500,v};c,b;main(z){for(;c>4?b>3?c=0,b=-1:++b?z=v[b]+*v%a[b+1]/a[b],z<1||printf("%d %d\n",a[b],z):puts(""):~scanf("%d",v+c)?*v-=v[c]*a[c],++c:0;);}

Compiler output:
a.cc:1:1: error: 'v' does not name a type
    1 | v[5];a[]={0,10,50,100,500,v};c,b;main(z){for(;c>4?b>3?c=0,b=-1:++b?z=v[b]+*v%a[b+1]/a[b],z<1||printf("%d %d\n",a[b],z):puts(""):~scanf("%d",v+c)?*v-=v[c]*a[c],++c:0;);}
      | ^
a.cc:1:6: error: 'a' does not name a type
    1 | v[5];a[]={0,10,50,100,500,v};c,b;main(z){for(;c>4?b>3?c=0,b=-1:++b?z=v[b]+*v%a[b+1]/a[b],z<1||printf("%d %d\n",a[b],z):puts(""):~scanf("%d",v+c)?*v-=v[c]*a[c],++c:0;);}
      |      ^
a.cc:1:30: error: 'c' does not name a type
    1 | v[5];a[]={0,10,50,100,500,v};c,b;main(z){for(;c>4?b>3?c=0,b=-1:++b?z=v[b]+*v%a[b+1]/a[b],z<1||printf("%d %d\n",a[b],z):puts(""):~scanf("%d",v+c)?*v-=v[c]*a[c],++c:0;);}
      |                              ^
a.cc:1:38: error: expected constructor, destructor, or type conversion before '(' token
    1 | v[5];a[]={0,10,50,100,500,v};c,b;main(z){for(;c>4?b>3?c=0,b=-1:++b?z=v[b]+*v%a[b+1]/a[b],z<1||printf("%d %d\n",a[b],z):puts(""):~scanf("%d",v+c)?*v-=v[c]*a[c],++c:0;);}
      |                                      ^
Language: C++

/**
 *  Make Purse Light (Problem B, Practice Contest for Japan Domestic, 2005-06-19)
 *  by Kenji Inoue, 2006-12-22
 **/

#include <iostream>

using namespace std;

int main() {
  int m, c[4], p[4], r[4]; // money, coins, paid coins, returned coins
  int d[4] = {10, 50, 100, 500};

  bool firstline = true;
  while (cin >> m, (m)) {
    if (!firstline) { cout << endl; }
    firstline = false;

    for (int i=0; i<4; i++) { cin >> c[i]; }

    int min=20*20*20*20, minc[4];
    memset(minc, 0, sizeof(minc));
    for (p[0]=0; p[0]<=c[0]; p[0]++) {
      for (p[1]=0; p[1]<=c[1]; p[1]++) {
        for (p[2]=0; p[2]<=c[2]; p[2]++) {
          for (p[3]=0; p[3]<=c[3]; p[3]++) {
            memset(r, 0, sizeof(r));

            int sum = 0;
            for (int i=0; i<4; i++) {
              sum += d[i] * p[i];
            }
            if (sum < m) { continue; }

            sum -= m;
            for (int i=3; i>=0; i--) {
              while (sum >= d[i]) { sum -= d[i]; r[i]++; }
            }

            int remain = 0;
            for (int i=0; i<4; i++) {
              remain += c[i] - p[i] + r[i];
            }
            if (remain < min) {
              min = remain;
              for (int i=0; i<4; i++) { minc[i] = p[i]; }
            }
          }
        }
      }
    }

    for (int i=0; i<4; i++) {
      if (minc[i] > 0) {
        cout << d[i] << " " << minc[i] << endl;
      }
    }
  }
}

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

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

void ans_print(int a[],int b,int c){
	int dat[501]={0};
	int data[]={10,50,100,500};
	for(int i=0;i<c;i++){
		if((b&1)==1) dat[a[i]]++;
		b>>=1;
	}
	for(int i=0;i<4;i++){
		if(dat[data[i]]>=1){
			cout<<data[i]<<" "<<dat[data[i]]<<endl;
		}
	}
}

int mai(int b,int c){
	int cnt=0;
	for(int i=0;i<c;i++){
		if((b&1)==1) cnt++;
		b>>=1;
	}
	return cnt;
}

int gaku(int a[],int b,int c){
	int sum=0;
	for(int i=0;i<c;i++){
		if((b&1)==1) sum+=a[i];
		b>>=1;
	}
	return sum;
}

int oturi(int n){
	int data[]={10,50,100,500};
	int cnt=0;
	for(int i=3;i>=0;i--){
		cnt+=n/data[i];
		n%=data[i];
	}
	return cnt;
}

int main(){

	int n,k[20],ci;
	int data[]={10,50,100,500};
	int cnt;
	int tnum,mnum,sum;
	int min_turi,min_use,ans;

	while(1){

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

		cnt=0;
		min_turi=10000000;
		min_use=10000000;

		for(int i=0;i<4;i++){
			cin>>ci;
			for(int j=0;j<ci;j++){
				k[cnt]=data[i];
				cnt++;
			}
		}

		for(long long i=0;i<(1<<cnt);i++){
			/*sum=gaku(k,i,cnt);
			if(sum>=n){
				mnum=mai(i,cnt);
				tnum=oturi(sum-n)+cnt;
				if(min_turi>tnum||(min_turi==tnum&&min_use>mnum)){
					min_turi=tnum;
					min_use=mnum;
					ans=i;
				}
			}*/
		}
		ans_print(k,i,cnt);
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:85:29: error: 'i' was not declared in this scope; did you mean 'ci'?
   85 |                 ans_print(k,i,cnt);
      |                             ^
      |                             ci
Language: Java

import java.util.*;

public class C2005{

    int n;
    int hx,hy,dx,dy;
    int[] x,y;
    double[][] distY;
    double[] distM;
    int[] collect;
    boolean can;

    void solve(){
	Scanner sc = new Scanner(System.in);

	while(true){
	    n = sc.nextInt();
	    hx = sc.nextInt();
	    hy = sc.nextInt();
	    dx = sc.nextInt();
	    dy = sc.nextInt();
	    if(n==0 && hx==0 && hy==0 && dx==0 && dy==0) break;
	    x = new int[n];
	    y = new int[n];
	    for(int i=0; i<n; i++){
		x[i] = sc.nextInt();
		y[i] = sc.nextInt();
	    }
	    
	    distY = new double[n+1][n+1];
	    distM = new double[n];
	    for(int i=0; i<n; i++){
		double dist = Math.sqrt((hx-x[i])*(hx-x[i])+(hy-y[i])*(hy-y[i]));
		distY[0][i+1] = dist;
		distY[i+1][0] = dist;
		dist = Math.sqrt((dx-x[i])*(dx-x[i])+(dy-y[i])*(dy-y[i]));
		distM[i] = dist;
	    }
	    for(int i=0; i<n; i++){
		for(int j=i+1; j<n; j++){
		    double dist = Math.sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]));
		    distY[i+1][j+1] = dist;
		    distY[j+1][i+1] = dist;
		}
	    }

	    collect = new int[n];
	    can = false;
	    dfs(0,0,0);
	    
	    if(can){
		System.out.println("YES");
	    }else{
		System.out.println("NO");
	    }
	}
    }

    void dfs(int point, int cnt, double d){
	if(can) return;
	if(cnt==n){
	    can = true;
	    return;
	}

	for(int i=0; i<n; i++){
	    if(collect[i]==0){
		if(d>=distM[i]){
		    return;
		}
	    }
	}

	for(int i=0; i<n; i++){
	    if(collect[i]==0){
		double newD = d+distY[point][i+1];
		if(newD>=distM[i]) continue;
		collect[i] = 1;
		dfs(i+1, cnt+1, newD);
		collect[i] = 0;
	    }
	}
    }

    public static void main(String[] args){
	new C2005().solve();
    }
}

Compiler output:
Main.java:3: error: class C2005 is public, should be declared in a file named C2005.java
public class C2005{
       ^
1 error
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define EPS (1e-10)

int used[20];
int cx[20],cy[20];
int dx,dy;
int n;
int tmp;

void dragon(int c,double sum,int hx,int hy)
{
	int i;
	double r;
	
	if(tmp)return;

	if(c==n){
		tmp = 1;
		return;
	}
	
	for(i=0;i<n;i++){
		if(used[i]==0){
		  r = sum + sqrt((hx-cx[i])*(hx-cx[i])+(hy-cy[i])*(hy-cy[i]));
			if(r + EPS > sqrt((dx-cx[i])*(dx-cx[i])+(dy-cy[i])*(dy-cy[i])) )return;
		}
	}
	
	for(i=0;i<n;i++){
		if(used[i]==0){
			used[i]=1;
			r = sum + sqrt((hx-cx[i])*(hx-cx[i])+(hy-cy[i])*(hy-cy[i]));
			dragon(c+1,r,cx[i],cy[i]);
			used[i]=0;
		}
	}
}

int main(void)
{
	int i,j,c;
	int hx,hy;

	while(1)
	{
		scanf("%d %d %d %d %d",&n,&hx,&hy,&dx,&dy);
		if(n==0 && hx==0 && hy==0 && dx==0 && dy==0)break;
		
		for(i=0;i<n;i++){
			scanf("%d %d",&cx[i],&cy[i]);
		}
	  
		for(i=0;i<n;i++){
			used[i]=0;
		}
    
    tmp = 0;
    dragon(0.0,hx,hy);
		if(tmp){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
		
	}
	return 0;
	
}	


		

Compiler output:
main.c: In function 'main':
main.c:60:5: error: too few arguments to function 'dragon'
   60 |     dragon(0.0,hx,hy);
      |     ^~~~~~
main.c:12:6: note: declared here
   12 | void dragon(int c,double sum,int hx,int hy)
      |      ^~~~~~
Language: C++

#include <iostream>
#include <cmath>
#include <vector>
#include <tr1/unordered_map>

using namespace std;

#define fi first
#define se second

int N;
int hx, hy, mx, my;
typedef pair<double, double> P;
P cs[21];

#define SQ(x) ((x)*(x))
inline double dist(P a, P b) {
  return sqrt(SQ(a.fi-b.fi) + SQ(a.se-b.se));
}

unordered_map<int, double> umap;

double G[22][22];
bool dfs(int S, int now, double cost) {
  
  if(S == (1<<N)-1) {
    return true;
  }
  
  umap[S] = cost;
  
  for(int i=0; i<N; i++) {
    if(S >> i & 1) continue;
    if(G[i][N+1] <= cost+G[now][i]) return false;
  }
  
  for(int i=0; i<N; i++) {
    if(S >> i & 1) continue;
    if(umap.count(S|(1<<i)) && umap[S|(1<<i)] <= cost+G[now][i]) continue;
    if(dfs(S|(1<<i), i, cost+G[now][i])) return true;
  }
  
  return false;
}

bool solve() {
  
  for(int i=0; i<N; i++) {
    for(int j=i+1; j<N; j++) {
      G[i][j] = G[j][i] = dist(cs[i], cs[j]);
    }
    G[N][i] = G[i][N] = dist(P(hx, hy), cs[i]);
    G[N+1][i] = G[i][N+1] = dist(P(mx, my), cs[i]);
  }
  
  for(int i=0; i<N; i++) {
    if(dfs(1<<i, i, 0.)) return true;
  }
  
  return false;
}

int main() {
  while(1) {
    cin >> N >> hx >> hy >> mx >> my;
    if(!N) break;
    for(int i=0; i<N; i++) {
      cin >> cs[i].fi >> cs[i].se;
    }
    cout << (solve() ? "YES" : "NO") << endl;
  }
  
  return 0;
}

Compiler output:
a.cc:21:1: error: 'unordered_map' does not name a type
   21 | unordered_map<int, double> umap;
      | ^~~~~~~~~~~~~
a.cc: In function 'bool dfs(int, int, double)':
a.cc:30:3: error: 'umap' was not declared in this scope
   30 |   umap[S] = cost;
      |   ^~~~
Language: C++

#include <iostream>
#include <cmath>
#include <vector>
#include <tr1/unordered_map.h>

using namespace std;

#define fi first
#define se second

int N;
int hx, hy, mx, my;
typedef pair<double, double> P;
P cs[21];

#define SQ(x) ((x)*(x))
inline double dist(P a, P b) {
  return sqrt(SQ(a.fi-b.fi) + SQ(a.se-b.se));
}

unordered_map<int, double> umap;

double G[22][22];
bool dfs(int S, int now, double cost) {
  
  if(S == (1<<N)-1) {
    return true;
  }
  
  umap[S] = cost;
  
  for(int i=0; i<N; i++) {
    if(S >> i & 1) continue;
    if(G[i][N+1] <= cost+G[now][i]) return false;
  }
  
  for(int i=0; i<N; i++) {
    if(S >> i & 1) continue;
    if(umap.count(S|(1<<i)) && umap[S|(1<<i)] <= cost+G[now][i]) continue;
    if(dfs(S|(1<<i), i, cost+G[now][i])) return true;
  }
  
  return false;
}

bool solve() {
  
  for(int i=0; i<N; i++) {
    for(int j=i+1; j<N; j++) {
      G[i][j] = G[j][i] = dist(cs[i], cs[j]);
    }
    G[N][i] = G[i][N] = dist(P(hx, hy), cs[i]);
    G[N+1][i] = G[i][N+1] = dist(P(mx, my), cs[i]);
  }
  
  for(int i=0; i<N; i++) {
    if(dfs(1<<i, i, 0.)) return true;
  }
  
  return false;
}

int main() {
  while(1) {
    cin >> N >> hx >> hy >> mx >> my;
    if(!N) break;
    for(int i=0; i<N; i++) {
      cin >> cs[i].fi >> cs[i].se;
    }
    cout << (solve() ? "YES" : "NO") << endl;
  }
  
  return 0;
}

Compiler output:
In file included from a.cc:4:
/usr/include/c++/14/tr1/unordered_map.h:44:24: error: expected template-name before '<' token
   44 |     : public _Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc,
      |                        ^
/usr/include/c++/14/tr1/unordered_map.h:44:24: error: expected '{' before '<' token
/usr/include/c++/14/tr1/unordered_map.h:93:24: error: expected template-name before '<' token
   93 |     : public _Hashtable<_Key, std::pair<const _Key, _Tp>,
      |                        ^
/usr/include/c++/14/tr1/unordered_map.h:93:24: error: expected '{' before '<' token
a.cc:21:1: error: 'unordered_map' does not name a type
   21 | unordered_map<int, double> umap;
      | ^~~~~~~~~~~~~
a.cc: In function 'bool dfs(int, int, double)':
a.cc:30:3: error: 'umap' was not declared in this scope
   30 |   umap[S] = cost;
      |   ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define fi first
#define se second

typedef pair<double, double> P;
int N;
P h, d, cs[20];

#define SQ(x) ((x)*(x))

inline bool getDist(P a, P b) {
  return sqrt(SQ(a.fi-b.fi) + SQ(a.se-b.se));
}

double dist[22][22];

map<int, double> mp;

bool dfs(int S, int now, double cost) {
  
  if(S = (1<<N)-1) {
    return true;
  }
  
  mp[S] = cost;
  
  for(int i=0; i<N; i++) {
    if(S >> i & 1) continue;
    if(dist[N+1][i] <= cost + dist[now][i]) return false;
  }
  
  for(int i=0; i<N; i++) {
    if(S >> i & 1) continue;
    if(mp.count(S+(1<<i)) && mp[S+(1<<i)] <= cost+dist[now][i]) continue;
    if(dfs(S+(1<<i), i, cost+dist[now][i])) return true;
  }
  
  return false;
}

bool solve() {
  
  mp.clear();
  
  for(int i=0; i<N; i++) {
    for(int j=i+1; j<N; j++) {
      dist[i][j] = dist[j][i] = getDist(cs[i], cs[j]);
    }
    dist[i][N] = dist[N][i] = getDist(cs[i], h);
    dist[i][N+1] = dist[N+1][i] = getDist(cs[i], m);
  }
  
  for(int i=0; i<N; i++) {
    if(dist[i][N+1] <= dist[i][N]) continue;
    if(dfs(1<<i, i, dist[N][i])) return true;
  }
  return false;
}

int main() {
  
  while(cin >> N >> h.fi >> h.se >> d.fi >> d.se && (N)) {
    for(int i=0; i<N; i++) {
      cin >> cs[i].fi >> cs[i].se;
    }
    
    cout << (solve() ? "YES" : "NO") << endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'bool solve()':
a.cc:53:50: error: 'm' was not declared in this scope
   53 |     dist[i][N+1] = dist[N+1][i] = getDist(cs[i], m);
      |                                                  ^
Language: C++

#include <iostream>
#include <cmath>

using namespace std;

int n,hx,hy,dx,dy;

float dist[21][21];
struct Crystal{
    int x,y;
    float dist;
    bool visited;
};
Crystal crystals[21];//[0]????????????????????????????????????

bool rec(int s,float t){
    crystals[s].visited=true;
    for(int i=0;i<n;i++){
        if(crystals[i].visited) continue;
        if(dist[i][s]+t<crystals[i].dist){
            if(rec(i,dist[i][s]+t)){
                return true;
            }else{
                continue;
            }
        }else{
            //???????????????????????????????????£??????
            crystals[s].visited=false;
            return false;
        }
    }
    //??¨???????????????????????????????????????
    return true;
}

int main(void){
    while(cin >> n >> crystals[0].x >> crystals[0].y >> dx >> dy,n){
        for(int i=1;i<=n;i++){
            cin >> crystals[i].x >> crystals[i].y;
            crystals[i].dist=sqrt(pow(crystals[i].x-dx,2)+pow(crystals[i].y-dy,2));
        }
        sort(crystals+1,crystals+n+1,[](const Crystal& a, const Crystal& b){return (a.dist==b.dist)?(a.x<b.x):(a.dist)<(b.dist);});
        for(int i=0;i<=n;i++){
            crystals[i].visited=false;
            for(int k=i+1;k<=n;k++){
                dist[i][k]=dist[k][i]=sqrt(pow(crystals[i].x-crystals[k].x,2)+pow(crystals[i].y-crystals[k].y,2));
            }
        }
        if(rec(0,0)){
            cout << "YES" << endl;
        }else{
            cout << "NO" << endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   42 |         sort(crystals+1,crystals+n+1,[](const Crystal& a, const Crystal& b){return (a.dist==b.dist)?(a.x<b.x):(a.dist)<(b.dist);});
      |         ^~~~
      |         sqrt
Language: C++

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

#define EPS	1.0e-10
#define MAX_CRYSTAL	32
#define rep(idx, max)	for(int idx = 0, idx##Max = max; idx < idx##Max; idx ++)

typedef struct _POINT
{
	int x, y;

	_POINT() {}
	_POINT(int _x, int _y) : x(_x), y(_y) {}
} POINT;

int g_crystalNum;
POINT	g_hero, g_devil;
POINT	g_crystals[MAX_CRYSTAL];

int	g_bSolved;
int	g_bReached[MAX_CRYSTAL];
int	g_reachedCount;

double Distance(const POINT &src1, const POINT &src2)
{
	double x = src1.x - src2.x;
	double y = src1.y - src2.y;
	return( ::sqrt(x * x + y * y) );
}

void Solve(const POINT &pt, const double time)
{
	//std::cout << time << std::endl;
	if (g_bSolved) { return; }

	if (g_reachedCount == g_crystalNum)
	{
		g_bSolved = true;
		return;
	}

	rep(n, g_crystalNum)
	{
		if (g_bReached[n]) { continue; }
		double r = time + ::Distance(pt, g_crystals[n]);	// Elapsed time of hero
		if (r - ::Distance(g_devil, g_crystals[n]) > EPS) { return; }	// Could not reached (You are too late :P)
	}

	rep(n, g_crystalNum)
	{
		double r = time + ::Distance(pt, g_crystals[n]);

		g_bReached[n] = true;
		g_reachedCount++;
		::Solve(g_crystals[n], r);
		g_bReached[n] = false;
		g_reachedCount--;
	}
}

int main(int nArgs, char **lplpszArgs)
{
	while (std::cin >> g_crystalNum, g_crystalNum)
	{
		std::cin >> g_hero.x >> g_hero.y >> g_devil.x >> g_devil.y;
		rep(i, g_crystalNum)
		{
			POINT &pt = g_crystals[i];
			std::cin >> pt.x >> pt.y;
		}

		::printf("Hero: (%d, %d), Devil: (%d, %d)\n", g_hero.x, g_hero.y, g_devil.x, g_devil.y);

		g_bSolved = false;
		::memset(g_bReached, 0, sizeof(g_bReached));
		g_reachedCount = 0;
		::Solve(g_hero, 0);
		std::cout << (g_bSolved ? "YES" : "NO") << std::endl;
	}
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:79:19: error: '::memset' has not been declared
   79 |                 ::memset(g_bReached, 0, sizeof(g_bReached));
      |                   ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <cmath>
  +++ |+#include <cstring>
    7 |
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>

using namespace std;

typedef struct { int x, y; } pt;

int n;
pt hero, dragon;

double eps = 1e-6;

vector<pt> targets;

double dist(pt& a, pt& b) {
    return sqrt(pow(a.x - b.x, 2) + pow(a.y - b.y, 2));
}

bool nearer_from_hero(const pt& a, const pt& b) {
    return dist(a, hero) < dist(b, hero);
}

bool can_visit(double d, map<int, bool>& visited, int k) {
    // cerr << "VISIT d=" << d << " k=" << k << endl;

    if (d >= dist(targets[k], dragon)) {
        // cerr << "NG " << d << " " << targets[k].x << "," << targets[k].y << " " << dragon.x << "," << dragon.y << endl;
        return false;
    }

    bool all_visited = true;
    bool ok = false;

    for (int i = 1; i <= n; ++i) {
        if (i == k || visited[i]) {
            continue;
        }

        all_visited = false;

        visited[i] = true;
        double delta = dist(targets[i], targets[k]);
        if (can_visit(d + delta, visited, i)) {
            ok = true;
        }
        visited[i] = false;
        if (ok) break;
    }

    return all_visited || ok;
}

bool nearer_dragon(pt a, pt b) {
    return dist(a, dragon) < dist(b, dragon);
}

int main() {
    while (true) {
        cin >> n >> hero.x >> hero.y >> dragon.x >> dragon.y;
        if (n == 0) break;

        bool ng = false;
        targets.clear();

        int s = 0;
        map< pair<int, int>, bool > seen;
        for (int i = 0; i < n; ++i) {
            pt t;
            cin >> t.x >> t.y;
            if (seen[make_pair(t.x, t.y)]) {
                s++;
                continue;
            }

            seen[make_pair(t.x, t.y)] = true;

            if (dist(t, hero) >= dist(t, dragon) - eps) {
                ng = true;
            }

            targets.push_back(t);
        }
        sort(targets.begin(), targets.end(), nearer_from_hero);
        targets.insert(targets.begin(), hero);

        n -= s;

        map<int, bool> v;
        for (int i = 0; i <= n; ++i) {
            v[i] = false;
        }
        cout << (!ng && can_visit(0, v, 0) ? "YES" : "NO") << endl;
    }
}

Compiler output:
a.cc: In function 'bool nearer_from_hero(const pt&, const pt&)':
a.cc:23:17: error: binding reference of type 'pt&' to 'const pt' discards qualifiers
   23 |     return dist(a, hero) < dist(b, hero);
      |                 ^
a.cc:18:17: note:   initializing argument 1 of 'double dist(pt&, pt&)'
   18 | double dist(pt& a, pt& b) {
      |             ~~~~^
a.cc:23:33: error: binding reference of type 'pt&' to 'const pt' discards qualifiers
   23 |     return dist(a, hero) < dist(b, hero);
      |                                 ^
a.cc:18:17: note:   initializing argument 1 of 'double dist(pt&, pt&)'
   18 | double dist(pt& a, pt& b) {
      |             ~~~~^
Language: C++

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

using namespace std;

#define rep(i,n) for(int i=0; i<int(n); i++)
#define pii pair<int,int>
#define fs first
#define sc second

typedef pair<pii,int> po;

int n;

bool cmp(po lhs, po rhs) {
  if(lhs.sc!=rhs.sc) return lhs.sc<rhs.sc;
  else return lhs.fs.fs<rhs.fs.fs;
}

bool rec(int bit, int t, const vector<po> c) {
  rep(k,n){
    if (t >= c[k].sc && (bit >> k)%2 == 1) return false; 
    else if (!rec(bit^(1<<k), t+1, c)) return false;
  }
  return true;
}

int main(){
  int hx,hy,dx,dy,x,y;
  while (cin>>n>>hx>>hy>>dx>>dy && n>0) {
    vector<po> c(n);
    rep(i,n){
      cin >> x >> y;
      c[i].fs.fs = x;
      c[i].fs.sc = y;
      c[i].sc = (x-dx)*(x-dx) + (y-dy)*(y-dy);
    }
    sort(c.begin(),c.end(),cmp);
    bit = (1<<(n+1))-1;
    if(rec(bit,0,c)) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:5: error: 'bit' was not declared in this scope
   41 |     bit = (1<<(n+1))-1;
      |     ^~~
a.cc: At global scope:
a.cc:47:1: error: expected declaration before '}' token
   47 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
// ????????????????????????±?????????±???
??
int n;
int x[30], y[30];
??
double dist(int a, int b){
????????return sqrt((x[a]-x[b])*(x[a]-x[b]) + (y[a]-y[b])*(y[a]-y[b]));
}
??
bool solve(){
????????for(int i=0;i<n;i++){
????????????????if(dist(n, 0) + dist(0, i) >= dist(n+1, i)) return false;
????????}
????????return true;
}
??
int main(){
????????while(1){
????????????????cin >> n;
????????????????if(n == 0) break;
????????????????cin >> x[n] >> y[n] >> x[n+1] >> y[n+1];
????????????????for(int i=0;i<n;i++){
????????????????????????cin >> x[i] >> y[i];
????????????????}
??
????????????????if(solve()) cout << "YES" << endl;
????????????????else cout << "NO" << endl;
????????}
????????return 0;
}

Compiler output:
a.cc:4:1: error: expected unqualified-id before '?' token
    4 | ??
      | ^
a.cc:7:1: error: expected unqualified-id before '?' token
    7 | ??
      | ^
a.cc:11:1: error: expected unqualified-id before '?' token
   11 | ??
      | ^
a.cc:18:1: error: expected unqualified-id before '?' token
   18 | ??
      | ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int n,h,w,d,e,x,y;
double k;
double j(int f,int g){return sqrt(f*f+g*g+0.0);}
int main(){
	while(1){
	cin>>n>>x>>y>>d>>e;
	if(!n)break;
	cin>>h>>w;
	bool o=(k<j(d-x,e-y));
	n--,k=j(h-x,w-y);
	while(n--){
		cin>>x>>y;
		if(k+j(h-x,w-y)>=j(d-x,e-y))o=0;
	}
	if(o)cout<<"YES"<<endl;
	else cout<<"NO"<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'double j(int, int)':
a.cc:6:30: error: 'sqrt' was not declared in this scope
    6 | double j(int f,int g){return sqrt(f*f+g*g+0.0);}
      |                              ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const int INF=100000000;
// e_ÔÌ£
double dist[22][22];
// e_ÌÀW
vector<pair<int,int> > points;
int n,hx,hy,dx,dy;
bool ok=false;
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) (EQ((a).real(),(b).real()) && EQ((a).imag(),(b).imag()))

// »ÝÌê©çßÄÂ\ÈÅ¬ÊßbðÔ·
void dfs(int s,int cp,double passedSec){
    if(ok)
        return;
    else if(s==0){
        ok=true;
        return;
    }
    for(int i = 0; i < n; i++){
        // Ü¾rbgª1ÈçÎ
        if((s>>i)&1){
            // áCªB·éOÉTõÂ\©Ç¤©ð`FbN
            double dt=dist[cp][i];
            // ¤©çÚ®æÖÌ¼aðæ¾
            double r=dist[n+1][i];
            // àµ¼aªz¦Ä¢½ç
            if(dt+passedSec>r||EQ(dt+passedSec,r))
                continue;
            dfs((s&(~(1<<i))),i,dt+passedSec);
        }
    }
}


int main(){
    while(cin>>n>>hx>>hy>>dx>>dy&&!(n==0&&hx==0&&hy==0&&dx==0&&dy==0)){
        points.clear();
        ok=false;
        // EÒÌúÊu
        for(int i = 0; i < n; i++){
            pair<int,int> p;
            cin>>p.second>>p.first;
            points.push_back(p);
        }
        points.push_back(make_pair(hy,hx));
        points.push_back(make_pair(dy,dx));

        for(int i = 0; i < points.size(); i++){
            for(int j = 0; j < points.size(); j++){
                dist[i][j]=sqrt((double)(points[i].first-points[j].first)*(points[i].first-points[j].first)
                    +(points[i].second-points[j].second)*(points[i].second-points[j].second));
            }
        }
        dfs(((1<<n)-1),n,0);
        if(ok)
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:28: error: 'sqrt' was not declared in this scope
   55 |                 dist[i][j]=sqrt((double)(points[i].first-points[j].first)*(points[i].first-points[j].first)
      |                            ^~~~
Language: C++

#include<iostream>
#include<vector>
#include<string.h>
using namespace std;
#define INF 10000000.0

int n,hx,hy,dx,dy;
int cx[20],cy[20];
double dp[20][1<<20];

int main()
{
	while(cin>>n>>hx>>hy>>dx>>dy && n!=0){
		for(int i=0;i<n;i++)
			cin>>cx[i]>>cy[i];

		for(int i=0;i<n;i++)
			for(int b=0;b<(1<<n);b++)
				dp[i][b]=INF;

		for(int i=0;i<n;i++)
			dp[i][0]=0;

		for(int bit=0;bit<(1<<n);bit++){
			for(int i=0;i<n;i++){
				double time=dp[i][bit];
				if(time>=INF) continue;
				int x=cx[i],y=cy[i];
				if(bit==0){x=0;y=0;}
				for(int k=0;k<n;k++){
					if(bit & (1<<k)) continue;
					time+=sqrt((double)(x-cx[k])*(x-cx[k])+(y-cy[k])*(y-cy[k]));
					if(time>=sqrt((double)(dx-cx[k])*(dx-cx[k])+(dy-cy[k])*(dy-cy[k]))) continue;
					dp[k][bit | (1<<k)]=min(dp[k][bit | (1<<k)],time);
//					cout<<dp[k][bit | (1<<k)]<<endl;
				}
			}
		}
		bool ok=false;
		for(int i=0;i<n;i++){
//			cout<<"a "<<dp[i][(1<<n)-1]<<endl;
			if(dp[i][(1<<n)-1]<INF)
				ok=true;
		}
		if(ok) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;

	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:47: error: 'sqrt' was not declared in this scope
   32 |                                         time+=sqrt((double)(x-cx[k])*(x-cx[k])+(y-cy[k])*(y-cy[k]));
      |                                               ^~~~
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
#define EPS (1e-10)

// n := クリスタルの個数 
int n;
// (hx,hy) := 勇者の初期位置
// (dx,dy) := 魔王の位置
int hx, hy, dx ,dy;
// (cx[i],cy[i]) := i 番目のクリスタルの位置
int cx[21], cy[21];
// done[i] := i 番目のクリスタルを回収したかどうか
bool done[21];]
// 答え
bool ans;

// 2 点間の距離
double dist(double x1, double y1, double x2, double y2){
    return sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) );
}


// 枝刈り探索
// t := 経過時間[s], (x,y) := 勇者の位置
void solve(double t, int x, int y){
    if( ans ) return ;
    
    // cnt := 現在回収したクリスタルの個数
    int cnt=0;
    for(int i=0 ; i < n ; i++ ){
        if( done[i] ) cnt++;
    }
    // n 個のクリスタルを回収したとき
    if( cnt == n ){
        ans = true;
        return;
    }
    
    // 回収できないクリスタルがあるか調べる
    for(int i=0 ; i < n ; i++ ){
        if( done[i] ) continue;
		
        double next_time = t + dist( x , y , cx[i] , cy[i] );
        // すでに回収できないクリスタルがあったら探索打ち切り
        if ( dist( dx , dy , cx[i] , cy[i] ) < next_time + EPS ){ 
            return; 
        }
    }
    for(int i=0 ; i < n ; i++ ){
        if( done[i] ) continue;
 
        double next_time = t + dist( x , y , cx[i] , cy[i] );
        done[i] = true;
        solve( next_time , cx[i] , cy[i] );
        done[i] = false;
    }
}
 
int main(){
    while( cin >> n >> hx >> hy >> dx >> dy , (n || hx || hy || dx || dy) ){
    	// (cx[i],cy[i]) := i 番目のクリスタルの位置
        for(int i=0 ; i < n ; i++ ){
            cin >> cx[i] >> cy[i];
        }
        
        // 初期化
        for(int i=0 ; i < 21 ; i++ ){
            done[i] = false;
        }
        
        ans = false;
        solve( 0.0 , hx , hy );
        if( ans ){
            cout << "YES" << endl;
        }else{
            cout << "NO" << endl;
        }
    }
}

Compiler output:
a.cc:14:15: error: expected unqualified-id before ']' token
   14 | bool done[21];]
      |               ^
a.cc: In function 'void solve(double, int, int)':
a.cc:27:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   27 |     if( ans ) return ;
      |         ^~~
      |         abs
a.cc:36:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   36 |         ans = true;
      |         ^~~
      |         abs
a.cc: In function 'int main()':
a.cc:72:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   72 |         ans = false;
      |         ^~~
      |         abs
Language: C++

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

#define EPS 1e-9 //許容される誤差の程度

int n;
double hx, hy, dx, dy;
double cry[2][1000];
bool visit[1000];

bool solve(int crynum, double radius, double x, double y)
{
	if(crynum >= n)
	{
		return true;
	}
	
	for(int i = 0; i < n; i++)
	{
		if(!visit[i]
			&&( hypot(cry[0][i]-dx, cry[1][i]-dy) < radius + hypot(cry[0][i]-x, cry[1][i]-y) + EPS))
			return false;
	}
	
	for(int i = 0; i < n; i++)
	{
		bool res = false;
		
		if(!visit[i])
		{
			visit[i] = true;
			res = solve(crynum+1, radius + hypot(cry[0][i]-x, cry[1][i]-y), cry[0][i], cry[1][i]);
			visit[i] = false;
		}
		
		if(res)
			return true;
	}
	
	return false;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <cstdio>
#include <stdio.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define EPS 1e-8

double cost[22][22];
double tlimit[22];
int xx[22];
int cx[22], cy[22];
int n;

bool DFS(int pos, int vis, double dis){
	if(vis == ((1<<(n+1))-1))return true;
	//枝狩り
	FOR(i, 1, n+1)if((vis&xx[i])==0 && (dis+cost[pos][i] > tlimit[i]+EPS))return false;
	FOR(i, 1, n+1){
		if(!(vis&xx[i])){
			if(DFS(i, vis|xx[i], dis+cost[pos][i])){
				return true;
			}
		}
	}
	return false;
}

int main(){
	REP(i,22)xx[i] = 1<<i;
	while(1){
		int dx,dy;
		cin>>n>>cx[0]>>cy[0]>>dx>>dy;
		if(n==0)return 0;
		FOR(i,1,n+1)scanf("%d%d",&cx[i],&cy[i]);
		REP(i, n+1){
			tlimit[i] = sqrt(pow(cx[i]*1.0-dx*1.0,2.0)+pow(cy[i]*1.0-dy*1.0,2.0));
			REP(j,i+1){
				cost[i][j] = sqrt(pow(cx[i]*1.0-cx[j]*1.0,2.0)+pow(cy[i]*1.0-cy[j]*1.0,2.0));
				cost[j][i] = cost[i][j];
			}
		}
		if(DFS(0, 1, 0.0))cout << "YES" << endl;
		else cout << "NO" << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:42: error: 'pow' was not declared in this scope
   39 |                         tlimit[i] = sqrt(pow(cx[i]*1.0-dx*1.0,2.0)+pow(cy[i]*1.0-dy*1.0,2.0));
      |                                          ^~~
a.cc:39:37: error: 'sqrt' was not declared in this scope
   39 |                         tlimit[i] = sqrt(pow(cx[i]*1.0-dx*1.0,2.0)+pow(cy[i]*1.0-dy*1.0,2.0));
      |                                     ^~~~
Language: C++

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

struct Point {
	int x, y;
};

const double EPS = 1E-8;
Point h, d, p[20];
int n;
bool flag[20];

bool dfs(double t, int s) 
{
	int i;
	for (i = 0; i < n; i++) {
		if (!flag[i]) break;
	}
	if (i == n) return true;
	
	Point pp = (s == -1) ? h : p[s];
	for (i = 0; i < n; i++) {
		if (flag[i]) continue;
		if (hypot(d.x - p[i].x, d.y - p[i].y) - hypot(pp.x - p[i].x, pp.y - p[i].y) < EPS) return false;
	}
	
	for (i = 0; i < n; i++) {
		if (flag[i]) continue;
		flag[i] = true;
		if (dfs(hypot(pp.x - p[i].x, pp.y - p[i].y), i)) return true;
		flag[i] = false;
	}
	
	return false;
}

int main()
{	
	while (cin >> n >> h.x >> h.y >> d.x >> d.y, n | h.x | h.y | d.x | d.y) {
		memset(flag, false, sizeof(flag));
		for (int i = 0; i < n; i++) {
			cin >> p[i].x >> p[i].y;
		}
		cout << (dfs(0, -1) ? "YES" : "NO") << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:17: error: 'memset' was not declared in this scope
   41 |                 memset(flag, false, sizeof(flag));
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cmath>
  +++ |+#include <cstring>
    3 | using namespace std;