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

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<fstream>

#define A '.'
#define S 'S'
#define G 'G'
#define D '#'

using namespace std;

int N,T;
void getInputs(vector< vector<int> > &maze){

    cin >> N >> T;
    cin.ignore();
    
    for(int i=0;i<N;i++){
        int a,b;
        vector<int> row;
        cin >> a >> b;
        row.push_back(a);
        row.push_back(b);
        maze.push_back(row);
    }

}

int main(){

    vector< vector<int> > cow;

    getInputs(cow);

    vector< pair<int,int> > pea(N);

    int ans = 0;
    int start = 1;
    int end = 1;

    
    for(int i=0;i<N;i++){
        pea[i] = make_pair(cow[i][0],cow[i][1]);
    }

    sort(pea.begin(),pea.end());

    for(int i=N-1;i>=0;i--){
        cout << pea[i].second << "," << pea[i].first << endl;
    }

    end = T;
    start = T;

    for(int i=N-1;i>=0;i--){

        if(pea[i].second >= end ){
            end = pea[i].first;
            if(end == 1){
                break;
            }
        }
    }

    //cout << "end=" << end << endl;

    if(end > 1){
        cout << -1 << endl;
        return 0;
    }

    
    end = 1;


    for(int i=0;i<N;i++){

        if(t >= pea[i].first){
            if(t < pea[i].second){
                t = pea[i].second;
            }
        }
        
    }

    for(int i = 0;i<N;i++){
        if(start >= pea[i].first && end < pea[i].second){
            ans ++;
            start = pea[i].first;
            end = pea[i].second;
        }
    }

    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:80:12: error: 't' was not declared in this scope
   80 |         if(t >= pea[i].first){
      |            ^
Language: C++

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

bool myComparison(const pair<int,int> &a,const pair<int,int> &b)
{
       return a.second<b.second;
}


int main(){
	int n=0;
	cin>>n;
	vector< pair<int,int > > v;
	for(int i=0;i<n;i++){
		int t1,t2;
		cin>>t1>>t2;
		v.push_back(make_pair(t1,t2));
	}
	sort(v.begin(),v.end(),myComparison);
	int flag=0;
	int load=0;
	for(int i=0;i<v.size();i++){
		load+=v[i].first;
		if(load>v[i].second){
			flag=1;
			break;
		}

	}
	if(flag==0){
		cout<<"YES"<<endl;
	}else{
		cout<<"NO"<<endl;
	}
}
//ワーシャルフロイド法



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

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

bool myComparison(const pair<int,int> &a,const pair<int,int> &b)
{
       return a.second<b.second;
}


int main(){
	int n=0;
	cin>>n;
	vector< pair<int,int > > v;
	for(int i=0;i<n;i++){
		int t1,t2;
		cin>>t1>>t2;
		v.push_back(make_pair(t1,t2));
	}
	sort(v.begin(),v.end(),myComparison);
	int flag=0;
	int load=0;
	for(int i=0;i<v.size();i++){
		load+=v[i].first;
		if(load>v[i].second){
			flag=1;
			break;
		}

	}
	if(flag==0){
		cout<<"YES"<<endl;
	}else{
		cout<<"NO"<<endl;
	}
}
//ワーシャルフロイド法



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

#include<bits/stdc++.h>

using namespace std;

int main(){

  int n;

  while(cin>>n,n){

	int tre;
	int total=0;
	int bridge;
	int max=0;
	
	for(int i=0;i<n;++i){
	  cin>>tre>>bridge;
	  total+=tre;
	  max=max(max,bridge);
	}
		
	if(total<=bridge)
	  cout<<"Yes"<<endl;
	else
	  cout<<"No"<<endl;
	
  }

}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:18: error: 'max' cannot be used as a function
   19 |           max=max(max,bridge);
      |               ~~~^~~~~~~~~~~~
Language: C++

#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#define P pair<int,int>
#define rep(i,n) for(int i = 0;i<n;i++)
#define pb(n) push_back(n)
using namespace std;
int n;
int main() {
	while(true){
		cin >> n;
		if(n == 0) break;
		vector<P> V;
		rep(i,n){
			int d,w;
			cin >> w >> d;
			V.push_back(P(d,w));
		}
		sort(V.begin(),V.end());
		int sw = 0;
		bool ans = true;
		rep(i,n){
			sw += V[i].second;
			if(sw > V[i].first){
				ans = false;
				break;
			}
		}
		cout << (ans ? "Yes" : "No") << endl;
	}
	return 0;
}

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

#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#define P pair<int,int>ツ　
#define rep(i,n) for(int i = 0;i<n;i++)
#define pb(n) push_back(n)ツ　
using namespace std;
int main() {
	while(true){
		cin >> n;
		if(n == 0) break;
		vector<P> V;
		rep(i,n){
			int d,w;
			cin >> w >> d;
			V.push_back(P(d,w));
		}
		sort(V.begin(),V.end());
		int sw = 0;
		bool ans = true;
		rep(i,n){
			sw += V[i].second;
			if(sw > V[i].first){
				ans = false;
				break;
			}
		}
		cout << (ans ? "Yes" : "No") << endl;
	}
	return 0;
}

Compiler output:
a.cc:5:24: error: extended character 　 is not valid in an identifier
    5 | #define P pair<int,int>ツ　
      |                        ^
a.cc:7:27: error: extended character 　 is not valid in an identifier
    7 | #define pb(n) push_back(n)ツ　
      |                           ^
a.cc: In function 'int main()':
a.cc:11:24: error: 'n' was not declared in this scope; did you mean 'yn'?
   11 |                 cin >> n;
      |                        ^
      |                        yn
a.cc:13:25: error: template argument 1 is invalid
   13 |                 vector<P> V;
      |                         ^
a.cc:13:25: error: template argument 2 is invalid
a.cc:17:27: error: request for member 'push_back' in 'V', which is of non-class type 'int'
   17 |                         V.push_back(P(d,w));
      |                           ^~~~~~~~~
a.cc:5:24: error: expected primary-expression before '\U000030c4\U00003000'
    5 | #define P pair<int,int>ツ　
      |                        ^~~~
a.cc:17:37: note: in expansion of macro 'P'
   17 |                         V.push_back(P(d,w));
      |                                     ^
a.cc:19:24: error: request for member 'begin' in 'V', which is of non-class type 'int'
   19 |                 sort(V.begin(),V.end());
      |                        ^~~~~
a.cc:19:34: error: request for member 'end' in 'V', which is of non-class type 'int'
   19 |                 sort(V.begin(),V.end());
      |                                  ^~~
a.cc:19:17: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   19 |                 sort(V.begin(),V.end());
      |                 ^~~~
      |                 sqrt
a.cc:23:32: error: invalid types 'int[int]' for array subscript
   23 |                         sw += V[i].second;
      |                                ^
a.cc:24:34: error: invalid types 'int[int]' for array subscript
   24 |                         if(sw > V[i].first){
      |                                  ^
Language: C++

#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#define P pair<int,int>
#define rep(i,n) for(int i = 0;i<n;i++)
#define pb(n) push_back(n)
using namespace std;
int main() {
	while(true){
		cin >> n;
		if(n == 0) break;
		vector<P> V;
		rep(i,n){
			int d,w;
			cin >> w >> d;
			V.push_back(P(d,w));
		}
		sort(V.begin(),V.end());
		int sw = 0;
		bool ans = true;
		rep(i,n){
			sw += V[i].second;
			if(sw > V[i].first){
				ans = false;
				break;
			}
		}
		cout << (ans ? "Yes" : "No") << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:24: error: 'n' was not declared in this scope; did you mean 'yn'?
   11 |                 cin >> n;
      |                        ^
      |                        yn
a.cc:19:17: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   19 |                 sort(V.begin(),V.end());
      |                 ^~~~
      |                 sqrt
Language: C++

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

#define MAX 25

class Task {
public:
  int d, lim;
  Task(int d = 0, int lim = 0) : d(d), lim(lim) {}
  bool operator < ( const Task &t ) const {
    if( lim == t.lim ) return d < t.d;
    return lim < t.lim;
  }
};

int main() {
  int n;
  Task T[MAX];
  bool success;
  int cur;

  while(cin >> n && n) {
    for(int i = 0; i < n; i++) {
      cin >> T[i].d >> T[i].lim
    }
    sort(T, T+n);
    success = true;
    cur = 0;
    for(int i = 0; i < n && success; i++) {
      cur += T[i].d;
      if(T[i].lim < cur) success = false;
    }
  }
  if(success) cout << "Yes" << endl;
  else cout << "No" << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:32: error: expected ';' before '}' token
   25 |       cin >> T[i].d >> T[i].lim
      |                                ^
      |                                ;
   26 |     }
      |     ~
Language: C++

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

#define MAX 25

int jewelry[MAX], lim[MAX];
int n;
`
void bubbleSort() {
  for(int i = 0; i < n; i++) {
    for(int j = n-1; j>i; j--) {
      if(lim[j-1] > lim[j]) {
	swap(lim[j-1], lim[j]);
	swap(jewelry[j-1], jewelry[j]);
      }
    }
  }  
}

int main() {
  bool success;
  int cur;

  while(cin >> n && n) {
    for(int i = 0; i < n; i++) {
      cin >> jewelry[i] >> lim[i];
    }
    bubbleSort();
    success = true;
    cur = 0;
    for(int i = 0; i < n && success; i++) {
      cur += jewelry[i];
      if(lim[i] < cur) success = false;
    }
    if(success) cout << "Yes" << endl;
    else cout << "No" << endl;
  }

  return 0;
}

Compiler output:
a.cc:9:1: error: stray '`' in program
    9 | `
      | ^
Language: C

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

int main(void){
  double px,py,vx,vy,D;

  while(1){
    scanf("%lf",&D);
    if(D==0)break;
    scanf("%lf%lf%lf%lf",&px,&py,&vx,&vy);

    if(py/px==vy/vx && sqrt(px*px+py*py<D)printf("%.8f\n",sqrt(px*px+py*py));
    else printf("impossible\n");
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:43: error: expected ')' before 'printf'
   12 |     if(py/px==vy/vx && sqrt(px*px+py*py<D)printf("%.8f\n",sqrt(px*px+py*py));
      |       ~                                   ^~~~~~
      |                                           )
main.c:14:3: error: expected expression before '}' token
   14 |   }
      |   ^
Language: C

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

const string impossible = "impossible";

double get_dot( double x1, double y1, double x2, double y2 ) {
    return x1 * x2 + y1 * y2;
}

double get_abs( double x, double y ) {
    return sqrt( x * x + y * y );
}

bool check( double a, double b ) {
    return a < b || fabs( a - b ) < 1e-9;
}

int main() {
    double D;
    while ( cin >> D ) {
        if ( D < 1e-9 ) break;
        double px, py, vx, vy;
        cin >> px >> py >> vx >> vy;
        double a = get_dot( -px, -py, vx, vy ) / get_abs( px, py ) / get_abs( vx, vy );
        if ( get_abs( px, py ) > 1.0 ) {
            cout << impossible << endl;
        } else if ( fabs( a - (1.0) ) < 1e-9 ) {
            if ( check( get_abs( px, py ), D ) )
                cout << get_abs( px, py ) << endl;
            else 
                cout << impossible << endl;
        } else if ( fabs( a - (-1.0) ) < 1e-9 ) {
            if ( check( 2.0 - get_abs( px, py ), D ) )
                cout << 2.0 - get_abs( px, py ) << endl;
            else 
                cout << impossible << endl;
        } else {
            cout << impossible << endl;
        }
    }
    return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(a) (a).begin(),(a).end()
using namespace std;
typedef long double D;
typedef complex<double> P;
const D eps = 1e-8;

D dot(P a, P b){ return a.real()*b.real() + a.imag()*b.imag(); }
D cross(P a, P b){ return a.real()*b.imag() - a.imag()*b.real(); }

int on_segment(P a, P b, P c){
  b -= a; c -= a;
  if( abs(cross(b,c)) > EPS) return 0;
  if( dot(b,c) < EPS ) return -1
  return 1;
}

int main(){
  D d;
  while(cin >> d, abs(d)>EPS){
    D px, py, vx, vy;
    cin >> px >> py >> vx >> vy;
    P cur = P(px,py), nxt = P(px+vx, py+vy);

    int flag = on_segment(cur, nxt, P(0,0));
    if(flag == 0){
      cout << "impossible" << endl;
    }else{
      D ans = 0;
      if(flag == 1)ans = abs(cur);
      else ans = 2.0 - abs(cur);
      if(ans > D)cout << "impossible" << endl;
      else cout << ans << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int on_segment(P, P, P)':
a.cc:14:25: error: 'EPS' was not declared in this scope
   14 |   if( abs(cross(b,c)) > EPS) return 0;
      |                         ^~~
a.cc:15:18: error: 'EPS' was not declared in this scope
   15 |   if( dot(b,c) < EPS ) return -1
      |                  ^~~
a.cc:15:33: error: expected ';' before 'return'
   15 |   if( dot(b,c) < EPS ) return -1
      |                                 ^
      |                                 ;
   16 |   return 1;
      |   ~~~~~~                         
a.cc: In function 'int main()':
a.cc:21:26: error: 'EPS' was not declared in this scope
   21 |   while(cin >> d, abs(d)>EPS){
      |                          ^~~
a.cc:33:17: error: expected primary-expression before ')' token
   33 |       if(ans > D)cout << "impossible" << endl;
      |                 ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(a) (a).begin(),(a).end()
using namespace std;
typedef long double D;
typedef complex<D> P;
const D EPS = 1e-8;

D dot(P a, P b){ return a.real()*b.real() + a.imag()*b.imag(); }
D cross(P a, P b){ return a.real()*b.imag() - a.imag()*b.real(); }

int on_segment(P a, P b, P c){
  b -= a; c -= a;
  if( abs(cross(b,c)) > EPS) return 0;
  if( dot(b,c) < EPS ) return -1;
  return 1;
}

int main(){
  D d;
  while(cin >> d, abs(d)>EPS){
    D px, py, vx, vy;
    cin >> px >> py >> vx >> vy;
    P cur = P(px,py), nxt = P(px+vx, py+vy);

    int flag = on_segment(cur, nxt, P(0,0));
    if(flag == 0){
      cout << "impossible" << endl;
    }else{
      D ans = 0;
      if(flag == 1)ans = abs(cur);
      else ans = 2.0 - abs(cur);
      if(ans > D)cout << "impossible" << endl;
      else cout << ans << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:17: error: expected primary-expression before ')' token
   33 |       if(ans > D)cout << "impossible" << endl;
      |                 ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(a) (a).begin(),(a).end()
using namespace std;
typedef long double D;
typedef complex<D> P;
const D EPS = 1e-8;

D dot(P a, P b){ return a.real()*b.real() + a.imag()*b.imag(); }
D cross(P a, P b){ return a.real()*b.imag() - a.imag()*b.real(); }

int on_segment(P a, P b, P c){
  b -= a; c -= a;
  if( abs(cross(b,c)) > EPS) return 0;
  if( dot(b,c) < EPS ) return -1;
  return 1;
}

int main(){
  D d;
  while(cin >> d, abs(d)>EPS){
    D px, py, vx, vy;
    cin >> px >> py >> vx >> vy;
    P cur = P(px, py), nxt = P(px+vx, py+vy);

    int flag = on_segment(cur, nxt, P(0,0));
    if(flag == 0){
      cout << "impossible" << endl;
    }else{
      D ans = 0;
      if(flag == 1)ans = abs(cur);
      else ans = 2.0 - abs(cur);
      if(ans > D)cout << "impossible" << endl;
      else cout << ans << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:17: error: expected primary-expression before ')' token
   33 |       if(ans > D)cout << "impossible" << endl;
      |                 ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(a) (a).begin(),(a).end()
using namespace std;
typedef long double D;
typedef complex<D> P;
const D EPS = 1e-8;

D dot(P a, P b){ return a.real()*b.real() + a.imag()*b.imag(); }
D cross(P a, P b){ return a.real()*b.imag() - a.imag()*b.real(); }

int on_segment(P a, P b, P c){
  b -= a; c -= a;
  if( abs(cross(b,c)) > EPS ) return 0;
  if( dot(b,c) < EPS ) return -1;
  return 1;
}

int main(){
  D d;
  while(cin >> d, abs(d)>EPS){
    D px, py, vx, vy;
    cin >> px >> py >> vx >> vy;
    P cur = P(px, py), nxt = P(px+vx, py+vy);

    int flag = on_segment(cur, nxt, P(0,0));
    if(flag == 0){
      cout << "impossible" << endl;
    }else{
      D ans = 0;
      if(flag == 1)ans = abs(cur);
      else ans = 2.0 - abs(cur);
      if(ans > D)cout << "impossible" << endl;
      else cout << ans << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:17: error: expected primary-expression before ')' token
   33 |       if(ans > D)cout << "impossible" << endl;
      |                 ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(a) (a).begin(),(a).end()
using namespace std;
typedef long double D;
typedef complex<D> P;
const D EPS = 1e-8;

/*
D dot(P a, P b){ return a.real()*b.real() + a.imag()*b.imag(); }
D cross(P a, P b){ return a.real()*b.imag() - a.imag()*b.real(); }

int on_segment(P a, P b, P c){
  b -= a; c -= a;
  if( abs(cross(b,c)) > EPS) return 0;
  if( dot(b,c) < EPS ) return -1;
  return 1;
}
*/

int main(){
  D d;
  while(cin >> d, abs(d)>EPS){
    D px, py, vx, vy;
    cin >> px >> py >> vx >> vy;
    P cur = P(px, py), nxt = P(px+vx, py+vy);

    int flag = 1;//on_segment(cur, nxt, P(0,0));
    if(flag == 0){
      cout << "impossible" << endl;
    }else{
      D ans = 0;
      if(flag == 1)ans = abs(cur);
      else ans = 2.0 - abs(cur);
      if(ans > D)cout << "impossible" << endl;
      else cout << ans << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:17: error: expected primary-expression before ')' token
   35 |       if(ans > D)cout << "impossible" << endl;
      |                 ^
Language: C++

#include<iostream>
#include<stdio>
#include<complex>
#include<cmath>
using namespace std;typedef double elem;typedef complex<elem> point,vec;
const elem eps=1.0e-4;
#define ERR 0x00
#define FRONT 0x01
#define RIGHT 0x02
#define BACK 0x04
#define LEFT 0x08
#define OVER 0x10
point origin(0,0);bool eq(elem a, elem b){ return abs(a-b) < eps; }bool lt(elem a, elem b){ return !eq(a,b) && a < b; }bool leq(elem a, elem b){ return eq(a,b) || a < b; }bool gt(elem a, elem b){ return !eq(a,b) && a > b; }bool geq(elem a, elem b){ return eq(a,b) || a > b; }bool ltz(elem a){ return lt( a, 0 ); }bool gtz(elem a){ return gt( a, 0 ); }elem cross(vec a, vec b){ return ( a.real() * b.imag() - a.imag() * b.real() ); }elem dist(point a, point b){ return abs(a-b); }int ccw(point a, point b, point x){vec vb = b - a;vec vx = x - a;elem z = cross( vb, vx );if( eq(abs(vb),0) )return ERR;if( eq(z,0) ){elem d_ab = dist(a,b);elem d_bx = dist(b,x);elem d_ax = dist(a,x);if( eq(d_ab,d_ax+d_bx) )return OVER;if( gt( d_ax, d_ab ) && gt( d_ax, d_bx ) )return FRONT;if( gt( d_bx, d_ab ) && gt( d_bx, d_ax ) )return BACK;}else if( gtz( z ) )return LEFT;else if( ltz( z ) )return RIGHT;return ERR;}

int main()
{
  while(true){
    double D,px,py,vx,vy;
    scanf("%lf",&D);
    if(D==0)break;
    scanf("%lf%lf%lf%lf",
	  &px,&py,&vx,&vy);
    point p(px,py);
    vec v(vx,vy);
    int progress = ccw(p,p+v,origin);
    double going = -1;
    if(progress==FRONT&&leq(dist(p,origin),D))
      going=dist(p,origin);
    else if(progress==BACK&&leq(2-dist(p,origin),D)){
      going=2-dist(p,origin);
    }
    if(gtz(going))
      printf("%.6lf\n",going);
    else
      puts("impossible");
  }
  return 0;
}

Compiler output:
a.cc:2:9: fatal error: stdio: No such file or directory
    2 | #include<stdio>
      |         ^~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main(){
	double d,x,y,vy,vx;
	while(cin>>d,d){
		cin>>x>>y>>vx>>vy;
		if(x*x+y*y>=1){
			if(x*vy-y*vx==0&&x*x+y*y<=d*d&&(x*vx<=0&&y*vy<=0))
			printf("%.8lf\n",sqrt(x*x+y*y));
			else cout<<"impossible"<<endl;
		}else{
			if(x*vy-y*vx==0&&x*x+y*y<=d*d&&(x*vx<=0&&y*vy<=0))
			printf("%.8lf\n",sqrt(x*x+y*y));
			else if(x*vy+y*vx==0&&2-sqrt(x*x+y*y)<=d&&(x*vx<=0||y*vy<=0))
			printf("%.8lf\n",2-sqrt(x*x+y*y));
			else cout<<"impossible"<<endl;
			
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:42: error: 'sqrt' was not declared in this scope
   10 |                         printf("%.8lf\n",sqrt(x*x+y*y));
      |                                          ^~~~
a.cc:14:42: error: 'sqrt' was not declared in this scope
   14 |                         printf("%.8lf\n",sqrt(x*x+y*y));
      |                                          ^~~~
a.cc:15:49: error: 'sqrt' was not declared in this scope
   15 |                         else if(x*vy+y*vx==0&&2-sqrt(x*x+y*y)<=d&&(x*vx<=0||y*vy<=0))
      |                                                 ^~~~
Language: C++

#include <iostream>
#include <complex>

#define EPS 0.00001

using namespace std;

int main()
{
	
	double d, px, py, vx, vy;
	complex<double> p,v;
	
	
	while(cin >> d,  d >= EPS )
	{
		cin >> px >> py >> vx >> vy;
		p = complex<double>(px, py);
		v = complex<double>(vx, vy);

		double cos = ( p.real()*v.real() + p.imag()*v.imag() ) / ( abs(p)*abs(v) );
		
		cout << cos << endl;
		cout << abs(p) <<endl;
		
		
		if( -1.0 -EPS < cos && cos < -1.0 +EPS && abs(p) =< d  )
			cout << abs(p) <<endl;
		else if(  1.0 -EPS < cos && cos < 1.0 +EPS &&  2 - abs(p) =< d )
			cout << 2*(1-abs(p)) + abs(p) <<endl;
		else
			cout << "impossible" <<endl;
		
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:67: error: expected primary-expression before '<' token
   27 |                 if( -1.0 -EPS < cos && cos < -1.0 +EPS && abs(p) =< d  )
      |                                                                   ^
a.cc:29:76: error: expected primary-expression before '<' token
   29 |                 else if(  1.0 -EPS < cos && cos < 1.0 +EPS &&  2 - abs(p) =< d )
      |                                                                            ^
Language: Java

import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		scan.next();
		scan.next();
		String link = scan.next();
		D d = new D(link);
		for (int b = scan.nextInt(); b-- > 0;) {
			d.setA(link, scan.nextInt(), scan.nextInt(), scan.nextInt(), scan
					.nextInt(), scan.next());
		}
		for (; n-- > 1;) {
			link = scan.next();
			for (int b = scan.nextInt(); b-- > 0;) {
				d.setA(link, scan.nextInt(), scan.nextInt(), scan.nextInt(),
						scan.nextInt(), scan.next());
			}
		}
		for (int m = scan.nextInt(); m-- > 0;) {
			String command = scan.next();
			if (command.equals("click")) {
				d.click(scan.nextInt(), scan.nextInt());
			} else if (command.equals("show")) {
				System.out.println(d.show());
			} else if (command.equals("back")) {
				d.back();
			} else if (command.equals("forward")) {
				d.forward();
			}
		}
	}

	public D(String link) {
		history.add(link);
	}

	LinkedList<String> history = new LinkedList<String>();
	int i = 0;
	Map<String, Set<A>> pages = new HashMap<String, Set<A>>();

	void setA(String page, int left, int top, int right, int bottom, String link) {
		if (!pages.containsKey(page)) {
			pages.put(page, new HashSet<A>());
		}
		pages.get(page).add(new A(left, right, top, bottom, link));
	}

	String show() {
		return history.get(i);
	}

	void click(int x, int y) {
		for (A a : pages.get(history.get(i))) {
			if (a.contains(x, y)) {
				i++;
				while (history.size() > i) {
					history.pollLast();
				}
				history.add(a.toString());
				return;
			}
		}
	}

	void back() {
		if (i > 0) {
			i--;
		}
	}

	void forward() {
		if (i + 1 < history.size()) {
			i++;
		}
	}

	class A {
		int left, right, top, bottom;
		String link;

		public A(int left, int right, int top, int bottom, String link) {
			this.left = left;
			this.right = right;
			this.top = top;
			this.bottom = bottom;
			this.link = link;
		}

		boolean contains(int x, int y) {
			return (left <= x && x <= right) && (top <= y && y <= bottom);
		}

		@Override
		public String toString() {
			return link;
		}
	}
}

Compiler output:
Main.java:41: error: invalid method declaration; return type required
	public D(String link) {
	       ^
1 error
Language: C

#include <iostream>
#include <string>
#include <map>
#include <sstream>
#include <algorithm>
#include <vector>

using namespace std;

class B{
public:
  int x1, y1, x2, y2;
  string to;
  B(){}
  B(int x1, int y1, int x2, int y2, string to) : x1(x1), y1(y1), x2(x2), y2(y2), to(to) {}
};

int n, h, w, b[100], m;
vector<B> buttons[100];
string name[100];
map<string, int> stoi;

int clicked(int x, int y, int p){
  for(int i=0;i<b[p];i++){
    B but = buttons[p][i];
    if(but.x1 <= x && x <= but.x2 && but.y1 <= y && y <= but.y2) return stoi[but.to];
  }
  return -1;
}

main(){
  while(cin >> n && n){
    stoi.clear();
    for(int i=0;i<n;i++) buttons[i].clear();
    cin >> w >> h;
    for(int i=0;i<n;i++){
      cin >> name[i];
      cin >> b[i];
      stoi[name[i]] = i;
      for(int j=0;j<b[i];j++){
        B in;
        cin >> in.x1 >> in.y1 >> in.x2 >> in.y2 >> in.to;
        buttons[i].push_back(in);
      }
    }
    cin >> m;
    int p = 0;
    vector<int> buf;
    buf.push_back(0);
    for(int i=0;i<m;i++){
      string str;
      cin >> str;
      if(str == "forward"){
        if(p+1 < buf.size()) p++;
      }else if(str == "back"){
        if(p != 0) p--;
      }else if(str == "show"){
        cout << name[buf[p]] << endl;
      }else{
        int x, y;
        cin >> x >> y;
        int next = clicked(x, y, buf[p]);
        if(next == -1) continue;
        if(p+1 != buf.size()) buf.erase(buf.begin() + p+1);
        buf.push_back(next);
        p++;
      }
    }
  }
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
struct pp{
	int t;
	int x1[105],y1[105],x2[105],y2[105];
	string s[105];
	string now;
}p[105];
int main()
{
	int n;
	int h,w;
	string o;
	while(cin>>n)
	{
		if(n==0) break;
		cin>>h>>w;
		for(int i=0;i<n;i++)
		{
			cin>>p[i].now>>p[i].t;
			for(int j=0;j<p[i].t;j++)
			{
				cin>>p[i].x1[j]>>p[i].y1[j]>>p[i].x2[j]
				>>p[i].y2[j]>>p[i].s[j];
			}
		}
		int m,x,y;
		cin>>m;
		int num=0;
		int sum=0;
		string t[10005];
		t[0]=p[0].now;
		for(int i=0;i<m;i++)
		{
			cin>>o;
			if(o=="click") 
			{
				cin>>x>>y;

				for(int j=0;j<p[num].t;j++)
				{
					if(x>=p[num].x1[j] && x<=p[num].x2[j] && y>=p[num].y1[j] && y<=p[num].y2[j]) 
					{
						bool f=false;
						for(int k=0;k<n;k++)
							if(p[k].now==p[num].s[j]) {
								t[num+1]=p[k].now;
								num++;
								sum=num;
								f=true;
								break;
							}
					}
					if(f) break;
				}
			}
			else if(o=="show") cout<<p[num].now<<endl;
			else if(o=="back") {
				if(num>0) num--;
			}
			else if(o=="forward") 
			{
				if(num<sum) num++;
			}
		}
	}
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:56:44: error: 'f' was not declared in this scope
   56 |                                         if(f) break;
      |                                            ^
Language: C++

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

class UnionFind{
  int n;
  vector<int> p;
public:
  UnionFind(int a){ n = a; p.resize(n, -1); }
  int find(int a){
    if(p[a] < 0)return a;
    return p[a] = find(p[a]);
  }
  int unite(int a, int b){
    a = find(a); b = find(b);
    p[a] = b;
  }
};

int main(){
  int n;
  while(cin >> n, n){
    UnionFind uf(n);
    vector<int> a(n),b(n);
    for(int i=0;i<n;i++){
      int u,v;
      cin >> u >> a[i] >> v >> b[i];
      uf.unite(i,u); uf.unite(i,v);
    }

    vector<int> w(n,0), num(n,0);
    for(int i=0;i<n;i++){
      int v = find(i);
      if(w[v] < a[i]){
        w[v] = a[i]; num[v] = 1;
      }else if(w[v] == a[i]) num[v]++;
      if(w[v] < b[i]){
        w[v] = b[i]; num[v] = 1;
      }else if(w[v] == b[i]) num[v]++;
    }
    int ans = 1, mod = 10007;
    for(int i=0;i<n;i++){
      if(num[i]) (ans *= num[i]) %= mod;
    }
    cout << ans << endl;
  }
}

Compiler output:
a.cc: In member function 'int UnionFind::unite(int, int)':
a.cc:16:3: warning: no return statement in function returning non-void [-Wreturn-type]
   16 |   }
      |   ^
a.cc: In function 'int main()':
a.cc:32:19: error: no matching function for call to 'find(int&)'
   32 |       int v = find(i);
      |               ~~~~^~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:3842:5: note: candidate: 'template<class _IIter, class _Tp> _IIter std::find(_IIter, _IIter, const _Tp&)'
 3842 |     find(_InputIterator __first, _InputIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:3842:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:60:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::find(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
   60 | find(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:60:1: note:   candidate expects 4 arguments, 1 provided
In file included from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   candidate expects 3 arguments, 1 provided
Language: C++

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

class UnionFind{
  int n;
  vector<int> p, s;
public:
  UnionFind(int a){ n = a; p.resize(n, -1); s.resize(n,1); }
  int find(int a){
    if(p[a] < 0)return a;
    return p[a] = find(p[a]);
  }
  int unite(int a, int b){
    a = find(a); b = find(b);
    if(s[a] < a[b]){
      p[a] = b; s[b] += s[a];
    }else{
      p[b] = a; s[a] += s[b];
    }
  }
};

int main(){
  int n;
  while(cin >> n, n){
    UnionFind uf(n);
    vector<int> a(n),b(n);
    for(int i=0;i<n;i++){
      int u,v;
      cin >> u >> a[i] >> v >> b[i];
      uf.unite(i,u); uf.unite(i,v);
    }

    vector<int> w(n,0), num(n,0);
    for(int i=0;i<n;i++){
      int v = uf.find(i);
      if(w[v] < a[i]){
        w[v] = a[i]; num[v] = 1;
      }else if(w[v] == a[i]) num[v]++;
      if(w[v] < b[i]){
        w[v] = b[i]; num[v] = 1;
      }else if(w[v] == b[i]) num[v]++;
    }
    int ans = 1, mod = 10007;
    for(int i=0;i<n;i++){
      if(num[i]) (ans *= num[i]/2) %= mod;
    }
    cout << ans << endl;
  }
}

Compiler output:
a.cc: In member function 'int UnionFind::unite(int, int)':
a.cc:15:16: error: invalid types 'int[int]' for array subscript
   15 |     if(s[a] < a[b]){
      |                ^
a.cc:20:3: warning: no return statement in function returning non-void [-Wreturn-type]
   20 |   }
      |   ^
Language: C++

// AOJ1055 Huge Family

#include <iostream>
#include <vector>
#include <queue>

using namespace std;

int main(){
	int n;
	while(cin >> n, n){
		vector< vector< pair<int, int> > > vp(n, vector< pair<int, int> >(2));
		for(int i=0;i<n;i++){
			for(int j=0;j<2;j++){
				int a, b; cin >> a >> b;
				vp[i][j] = make_pair(a,b);
			}
		}
		int ans = 1;
		vector<bool> vb(n, false);
		for(int i=0;i<n;i++){
			if(vb[i]) continue;
			vector<int> vi;
			queue<int> qu; qu.push(i);
			vb[i] = true;
			while(!qu.empty()){
				int t = qu.front(); qu.pop();
				for(int j=0;j<2;j++){
					vi.push_back(vp[t][j].second);
					int nxt = vp[t][j].first;
					if(!vb[nxt]){
						qu.push(nxt);
						vb[nxt] = true;
					}
				}
			}
			int cnt = 0;
			int m = *max_element(vi.begin(), vi.end());
			for(int j=0;j<vi.size();j++)
				if(vi[j]==m) cnt++;
			ans = (ans*(cnt/2))%10007;
		}
		cout << ans << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:34: error: 'max_element' was not declared in this scope
   38 |                         int m = *max_element(vi.begin(), vi.end());
      |                                  ^~~~~~~~~~~
Language: C++

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

typedef vector <int> VI;
typedef vector <VI> VVI;
typedef pair <int, int> PII;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()

typedef int Weight;
struct Edge {
    int src, dst;
    Weight weight;
    Edge(int src, int dst, Weight weight) :
    src(src), dst(dst), weight(weight) { }
};
bool operator < (const Edge &e, const Edge &f) {
    return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
        e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
typedef vector<Weight> Array;
typedef vector<Array> Matrix;

void visit(const Graph &g, int v, vector< vector<int> >& scc,
    stack<int> &S, vector<bool> &inS,
    vector<int> &low, vector<int> &num, int& time) {
        low[v] = num[v] = ++time;
        S.push(v); inS[v] = true;
        FOR(e, g[v]) {
            int w = e->dst;
            if (num[w] == 0) {
                visit(g, w, scc, S, inS, low, num, time);
                low[v] = min(low[v], low[w]);
            } else if (inS[w])
                low[v] = min(low[v], num[w]);
        }
        if (low[v] == num[v]) {
            scc.push_back(vector<int>());
            while (1) {
                int w = S.top(); S.pop(); inS[w] = false;
                scc.back().push_back(w);
                if (v == w) break;
            }
        }
}

void stronglyConnectedComponents(const Graph& g,
    vector< vector<int> >& scc) {
        const int n = g.size();
        vector<int> num(n), low(n);
        stack<int> S;
        vector<bool> inS(n);
        int time = 0;
        REP(u, n) if (num[u] == 0)
            visit(g, u, scc, S, inS, low, num, time);
}

int main() {
    int n;
    while ( cin >> n && n ) {
        Graph G(n);
        map <PII, int> F;
        for ( int i = 0; i < n; ++ i ) {
            for ( int j = 0; j < 2; ++ j ) {
                int b, f;
                cin >> b >> f;
                G[i].push_back( Edge( i, b, f ) );
                F[PII(i, b)] = f;
            }
        }
        VVI scc;
        int res = 1;
        stronglyConnectedComponents( G, scc );
        for ( auto it = scc.begin(); it != scc.end(); ++ it ) {
            VI V = *it;
            int m = V.size();
            int maxf = 0;
            res = ( res * cnt ) % 10007;
        }
        cout << res << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:85:27: error: 'cnt' was not declared in this scope; did you mean 'int'?
   85 |             res = ( res * cnt ) % 10007;
      |                           ^~~
      |                           int
Language: C++

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

int done[100000];
vector< vector<int> > g;
vector< vector<int> > g_c;
int bfs(int x){
	queue<int> Q;
	vector<int> vec;
	Q.push(x);
	while(Q.size()){
		int q = Q.front(); Q.pop();
		if( done[q] ) continue;
		else done[q] = true;
		for(int i = 0 ; i < g[q].size() ; i++){
			Q.push(g[q][i]);
			vec.push_back(g_c[q][i]);
		}
	}
	//cout << x << " " << vec.size() << endl;
	sort(vec.begin(),vec.end());
	int answer = 0;
	for(int i = 0 ; i < vec.size() ; i++){
		if( vec[i] == vec.back() ) answer++;
	}
	return answer/2;
}


int main(){
	int n;
	while(cin >> n && n){
		for(int i = 0 ; i < 100000 ; i++)
			done[i] = 0;
		g.clear();
		g_c.clear();
		g.resize(n);
		g_c.resize(n);
		for(int i = 0 ; i < n ; i++){
			
			for(int j = 0 ; j < 2 ; j++){
				int a,b;
				cin >> a >> b;
				g[i].push_back(a);
				g_c[i].push_back(b);
			}
		}
		long long ans = 1;
		for(int i = 0 ; i < n ; i++){
			if( done[i] == 0 ){
				ans *= bfs(i);
				ans %= 10007;
			}
		}
		cout << ans << endl;
		
		
	}
}

Compiler output:
a.cc: In function 'int bfs(int)':
a.cc:23:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   23 |         sort(vec.begin(),vec.end());
      |         ^~~~
      |         short
Language: C

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

double c[100001][20];

int main()
{
	int n;
	double exp[100001];
	double pro[20];
	pro[0]=1.0;
	for(int i=1;i<20;i++){
		pro[i]=pro[i-1]/2.0;
//		cout<<pro[i]<<" ";
	}
//	cout<<endl<<endl;

	for(int i=0;i<100001;i++){
		for(int j=0;j<20;j++)
			c[i][j]=0.0;
		exp[i]=0.0;
	}
	c[0][0]=1.0;

	for(int day=1;day<5;day++){
		exp[day]=exp[day-1];
		c[day][1]=c[day-1][0];
		for(int k=1;k<20;k++){
			c[day][k+1]=c[day-1][k]*pro[k];
			c[day][0]+=c[day-1][k]*(1-pro[k]);
			exp[day]+=k*c[day-1][k]*(1-pro[k]);
		}
//		for(int k=0;k<20;k++)
//			printf("%.3f ",c[day][k]);
//		cout<<" exp "<<exp[day]<<endl;
	}

	while(cin>>n && n!=0){
		double ans=0.0;
		ans+=exp[n];
		for(int i=0;i<20;i++){
			ans+=c[n][i]*i;
		}
		cout<<ans<<endl;
	}
	return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<iostream>
#include<vector>
using namespace std;
const int MAX=10;

int main()
{
	double e[100001];
	for(int i=0;i<=100000;i++)
		e[i]=0.0;

	e[0]=0.0;
	e[1]=1.0;
	e[2]=1.5;
	double pro[MAX+1],imp[MAX+1];
	pro[0]=1.0;
	for(int i=1;i<=MAX;i++){
		double p=1.0/(1<<(i-1));
		pro[i]=pro[i-1]*p;
		imp[i]=pro[i-1]*(1.0-p);
//		cout<<imp[i]<<endl;
	}

	for(int day=3;day<=100000;day++){
		for(int k=2;k<=min(day,MAX);k++){
			e[day]+=imp[k]*(e[day-k]+k-1);
//			cout<<imp[k]<<" "<<(e[day-k]+k-1)<<endl;
		}
		if(day<MAX)
			e[day]+=pro[day]*day;
//		cout<<e[day]<<endl;
	}
	int n;
	while(cin>>n && n!=0)
		cout<<e[n]<<endl;

	return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<cstdio>

using namespace std;
double dp[100000+1];
main(){

  int n;
  while( cin >> n ) {
    if(n == 0)break;
    double ans = 0;
    fill(dp, dp +n+1, 0);
    for(int i=0; i<=n; i++){
      double rate = 1, prate=1, base=1 - dp[i];
      for(int j=i+1; j<=n; j++){
	double nrate = rate * prate;
	if(nrate < 0.0000000001)break;
	dp[j] += (nrate * base);
	prate = nrate;
	rate *= 0.5;
      }
      ans += dp[i];
    }
    printf("%0.8lf\n",ans);
  }
return 0;
}

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:10: error: 'cin' was not declared in this scope
    8 |   while( cin >> n ) {
      |          ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<cstdio>
  +++ |+#include <iostream>
    2 | 
a.cc:11:5: error: 'fill' was not declared in this scope
   11 |     fill(dp, dp +n+1, 0);
      |     ^~~~
Language: C++

#include<cstdio>
double dp[100000+1];
main(){

  int n;
  while( cin >> n ) {
    if(n == 0)break;
    double ans = 0;
    fill(dp, dp +n+1, 0);
    for(int i=0; i<=n; i++){
      double rate = 1, prate=1, base=1 - dp[i];
      for(int j=i+1; j<=n; j++){
	double nrate = rate * prate;
	if(nrate < 0.0000000001)break;
	dp[j] += (nrate * base);
	prate = nrate;
	rate *= 0.5;
      }
      ans += dp[i];
    }
    printf("%0.8lf\n",ans);
  }
return 0;
}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:6:10: error: 'cin' was not declared in this scope
    6 |   while( cin >> n ) {
      |          ^~~
a.cc:9:5: error: 'fill' was not declared in this scope
    9 |     fill(dp, dp +n+1, 0);
      |     ^~~~
Language: C++

#include<vector>
#include<map>
#include<queue>
#include<stack>
#include<cstdio>

using namespace std;
double dp[100000+1];
main(){

  int n;
  while( cin >> n ) {
    if(n == 0)break;
    double ans = 0;
    fill(dp, dp +n+1, 0);
    for(int i=0; i<=n; i++){
      double rate = 1, prate=1, base=1 - dp[i];
      for(int j=i+1; j<=n; j++){
	double nrate = rate * prate;
	if(nrate < 0.0000000001)break;
	dp[j] += (nrate * base);
	prate = nrate;
	rate *= 0.5;
      }
      ans += dp[i];
    }
    printf("%0.8lf\n",ans);
  }
}

Compiler output:
a.cc:9:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    9 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:12:10: error: 'cin' was not declared in this scope
   12 |   while( cin >> n ) {
      |          ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #include<cstdio>
  +++ |+#include <iostream>
    6 |
Language: C++

#include<vector>
#include<map>
#include<queue>
#include<stack>
#include<cstdio>

using namespace std;
double dp[100000+1];
int main(){

  int n;
  while( cin >> n ) {
    if(n == 0)break;
    double ans = 0;
    fill(dp, dp +n+1, 0);
    for(int i=0; i<=n; i++){
      double rate = 1, prate=1, base=1 - dp[i];
      for(int j=i+1; j<=n; j++){
	double nrate = rate * prate;
	if(nrate < 0.0000000001)break;
	dp[j] += (nrate * base);
	prate = nrate;
	rate *= 0.5;
      }
      ans += dp[i];
    }
    printf("%0.8lf\n",ans);
  }
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 'cin' was not declared in this scope
   12 |   while( cin >> n ) {
      |          ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #include<cstdio>
  +++ |+#include <iostream>
    6 |
Language: C++

#define MAX 11 //無視しない連続数
#define MAX_N 100002

double dp[MAX_N][MAX];
double per[MAX];
double ans[MAX_N];

int main(void){
  int n;
  double sum = 0;

  REP(i,1,MAX) per[i] = pow(0.5,i-1);
  dp[1][1] = 1.0;

  REP(i,1,MAX_N){
    REP(j,1,MAX){
      if(dp[i][j] > 0){
        sum += dp[i][j] * per[j];
        if(j == 1){
          dp[i+1][j+1] += dp[i][j]; //最初は必ず取れる
        }
        else{
          dp[i+1][1] += dp[i][j] * (1 - per[j]); //取れない時の遷移
          dp[i+1][j+1] += dp[i][j] * per[j]; //取れる時の遷移
        }
      }
    }

    ans[i] = sum;
  }

  while(cin>>n,n) printf("%.3lf\n",ans[n]);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   REP(i,1,MAX) per[i] = pow(0.5,i-1);
      |       ^
a.cc:12:3: error: 'REP' was not declared in this scope
   12 |   REP(i,1,MAX) per[i] = pow(0.5,i-1);
      |   ^~~
a.cc:32:9: error: 'cin' was not declared in this scope
   32 |   while(cin>>n,n) printf("%.3lf\n",ans[n]);
      |         ^~~
a.cc:32:19: error: 'printf' was not declared in this scope
   32 |   while(cin>>n,n) printf("%.3lf\n",ans[n]);
      |                   ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #define MAX 11 //無視しない連続数
Language: C++

#include<stdio.h>

int main (){

int n;

scanf("%d",&n);if(n==0)break;

for(int iii=0;iii<n;iii++)
{
int x;double a=0;int g=0.5;
scanf("%d",&x);

a+=1;
for(int i=1;i<x;i++)
{
for(int j=i;j<x;j++)
a+=g;

g=g*0.5;
}

printf("%d",&a);
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:24: error: break statement not within loop or switch
    7 | scanf("%d",&n);if(n==0)break;
      |                        ^~~~~
Language: C++

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

#define MAX_N 1000
#define MAX_M 1000
#define MAX_P 1000

double dp[MAX_N][MAX_M][MAX_P];
double ventoh[MAX_N];

int n;

int main() {
	for (int i = 0; i < MAX_N; i++) {
		for (int j = 0; j < MAX_M; j++) {
			for (int k = 0; k < MAX_P; k++) {
				dp[i][j][k] = 0.0;
			}
		}
	}
	dp[0][0][0] = 1;
	for (int i = 1; i < MAX_N; i++) {
		for (int j = 0; j < MAX_M; j++) {
			for (int k = 0; k < MAX_P - 1; k++) {
				if (dp[i - 1][j][k] >= 0) {
					dp[i][j + 1][k + 1] += dp[i - 1][j][k] * 1.0 / pow(2.0, k);
					dp[i][j][0] += dp[i - 1][j][k] * (1.0 - 1.0 / pow(2.0, k));
				}
			}
		}
	}

	for (int i = 0; i < MAX_N; i++) {
		for (int j = 0; j < MAX_M; j++) {
			for (int k = 0; k < MAX_P; k++) {
				if (dp[i][j][k] >= 0) {
					ventoh[i] += dp[i][j][k] * j;
				}
			}
		}
	}

	while (true) {
		cin >> n;
		if (n == 0) {
			break;
		}
		cout << ventoh[n] << endl;
	}
}

Compiler output:
/tmp/cc5nCCvN.o: in function `main':
a.cc:(.text+0x361): relocation truncated to fit: R_X86_64_PC32 against symbol `ventoh' defined in .bss section in /tmp/cc5nCCvN.o
a.cc:(.text+0x3c4): relocation truncated to fit: R_X86_64_PC32 against symbol `ventoh' defined in .bss section in /tmp/cc5nCCvN.o
a.cc:(.text+0x403): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc5nCCvN.o
a.cc:(.text+0x41b): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc5nCCvN.o
a.cc:(.text+0x425): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc5nCCvN.o
a.cc:(.text+0x436): relocation truncated to fit: R_X86_64_PC32 against symbol `ventoh' defined in .bss section in /tmp/cc5nCCvN.o
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
using namespace std;

double fanc(int a,double p)
{
	if (a == 0)return;

	fanc(a - 1, p / 2);
	fanc(a - 2, 100);
}

int main()
{
	cin.tie(false);
	ios::sync_with_stdio(0);
	
	int n;
	
	while (cin >> n&&n != 0)
	{
		cout << fanc(n, 100) << "\n";
	}
}

Compiler output:
a.cc: In function 'double fanc(int, double)':
a.cc:6:20: error: return-statement with no value, in function returning 'double' [-fpermissive]
    6 |         if (a == 0)return;
      |                    ^~~~~~
a.cc: In function 'int main()':
a.cc:14:16: error: no matching function for call to 'std::basic_istream<char>::tie(bool)'
   14 |         cin.tie(false);
      |         ~~~~~~~^~~~~~~
In file included from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_ios.h:299:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>* std::basic_ios<_CharT, _Traits>::tie() const [with _CharT = char; _Traits = std::char_traits<char>]'
  299 |       tie() const
      |       ^~~
/usr/include/c++/14/bits/basic_ios.h:299:7: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/basic_ios.h:311:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>* std::basic_ios<_CharT, _Traits>::tie(std::basic_ostream<_CharT, _Traits>*) [with _CharT = char; _Traits = std::char_traits<char>]'
  311 |       tie(basic_ostream<_CharT, _Traits>* __tiestr)
      |       ^~~
/usr/include/c++/14/bits/basic_ios.h:311:43: note:   no known conversion for argument 1 from 'bool' to 'std::basic_ostream<char>*'
  311 |       tie(basic_ostream<_CharT, _Traits>* __tiestr)
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc: In function 'double fanc(int, double)':
a.cc:9:13: warning: control reaches end of non-void function [-Wreturn-type]
    9 |         fanc(a - 2, 100);
      |         ~~~~^~~~~~~~~~~~