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

#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#include <unistd.h>
#include <cassert>
#include <cctype>
#include <random>
#define _USE_MATH_DEFINES
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;
typedef complex<double> xy_t;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
int iinf = intmax / 8;
ll inf = llmax / 8;
double eps = 1e-11;

int main() {
    string s;
    cin >> s;
    int len = s.size();
    char fir = s[0];
    char las = s[len - 1];
    if (far == las) {
        if (len % 2 == 0) {
            cout << "First" << endl;
        } else {
            cout << "Second" << endl;
        }
    } else {
        if (len % 2 == 0) {
            cout << "Second" << endl;
        } else {
            cout << "First" << endl;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:9: error: 'far' was not declared in this scope; did you mean 'fir'?
   48 |     if (far == las) {
      |         ^~~
      |         fir
Language: C++

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

int main(){
 	string s;
	cin >> s;
	int n = s.size();

	cout << (  ( (s[0] == s[n-1]) ^ (n%2 == 1))  )? "First" : "Second") << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:75: error: expected ';' before ')' token
    9 |         cout << (  ( (s[0] == s[n-1]) ^ (n%2 == 1))  )? "First" : "Second") << endl;
      |                                                                           ^
      |                                                                           ;
Language: C++

#include <iostream>
#include <climits>
#include <stack>
#include <queue>
#include <string>
#include <random>
#include <utility>
#include <cmath>
#include <string.h>
#include <iomanip>
#include <stdlib.h>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
long long int INF = 1e18;
double Pi = 3.141592653589;
const int mod = 1000000007;
// memset(a,0,sizeof(a)); →全部０にする
 
struct edge{int to,cost;};
vector<int> G[100005];
 
long long int n,m,i,j=1,t;
int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1,};
 
std::vector<P> tree[100010];
long long int dp[100005];
bool used[100005];
char s[100005];





int main(){
	cin>>s;
	m=0
	n=strlen(s);
	if(s[0]==s[n-1])m++;
	if(n%2==0)m++;
	if(m%2==0)cout<<"First";
	else cout<<"Second";
	cout<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:12: error: expected ';' before 'n'
   40 |         m=0
      |            ^
      |            ;
   41 |         n=strlen(s);
      |         ~
Language: C++

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

int main(){
  string s; cin >> s;
  char L=s[0], R=s[s.size()-1];

	if(L == R && s.size()%2 == 0 || L != R && s.size()%2 == 1){
	cout << first << endl;
    }else{
	cout << second << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: 'first' was not declared in this scope
    9 |         cout << first << endl;
      |                 ^~~~~
a.cc:11:17: error: 'second' was not declared in this scope
   11 |         cout << second << endl;
      |                 ^~~~~~
Language: C++

# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
using namespace std;
using LL = long long;
constexpr long long MOD = 1000000000 + 7;
constexpr long long INF = 1000000000;
const double PI = acos(-1);

int main() {
	string s;
	cin >> s;
	cout << (s.size() % 2 == 0 ^ (s[0] == s[s.size() - 1]) ? "Second" : "First") << endl;
}# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
using namespace std;
using LL = long long;
constexpr long long MOD = 1000000000 + 7;
constexpr long long INF = 1000000000;
const double PI = acos(-1);

int main() {
	string s;
	cin >> s;
	cout << (s.size() % 2 == 0 ^ (s[0] == s[s.size() - 1]) ? "Second" : "First") << endl;
}

Compiler output:
a.cc:24:2: error: stray '#' in program
   24 | }# include <iostream>
      |  ^
a.cc:24:4: error: 'include' does not name a type
   24 | }# include <iostream>
      |    ^~~~~~~
a.cc:39:21: error: redefinition of 'constexpr const long long int MOD'
   39 | constexpr long long MOD = 1000000000 + 7;
      |                     ^~~
a.cc:16:21: note: 'constexpr const long long int MOD' previously defined here
   16 | constexpr long long MOD = 1000000000 + 7;
      |                     ^~~
a.cc:40:21: error: redefinition of 'constexpr const long long int INF'
   40 | constexpr long long INF = 1000000000;
      |                     ^~~
a.cc:17:21: note: 'constexpr const long long int INF' previously defined here
   17 | constexpr long long INF = 1000000000;
      |                     ^~~
a.cc:41:14: error: redefinition of 'const double PI'
   41 | const double PI = acos(-1);
      |              ^~
a.cc:18:14: note: 'const double PI' previously defined here
   18 | const double PI = acos(-1);
      |              ^~
a.cc:43:5: error: redefinition of 'int main()'
   43 | int main() {
      |     ^~~~
a.cc:20:5: note: 'int main()' previously defined here
   20 | int main() {
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
#include <math.h>
#define uint unsigned long long
#define ll long long
#define db double
#define ls rt << 1
#define rs rt << 1 | 1
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define X first
#define Y second
#define pcc pair<char, char>
#define vi vector<int>
#define vl vector<ll>
#define rep(i, x, y) for(int i = x; i <= y; i ++)
#define rrep(i, x, y) for(int i = x; i >= y; i --)
#define eps 1e-9

using namespace std;
inline int read()
{
    int x = 0, f = 1; char ch = getchar();
    while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
    while (ch >= '0' && ch <= '9') { x = x * 10 + ch - '0'; ch = getchar(); }
    return x * f;
}
const db pi = acos(-1);
const int N = 1e5 + 10;
string ch;
int main()
{
	cin >> ch;
	int n = ch.size();
	int x = ch.size() - 2;
	rep(i, 1, n - 1)
		if(ch[i - 1] != ch[i + 1]) break;
		else x --;
	rrep(i, n - 2, 1)
		if(ch[i - 1] != ch[i + 1]) break;
		else x --;
	if(x <= 0) puts("Second");
	else uts((ch.size() + (ch[0] == ch[n - 1] ? 1 : 0)) % 2 == 0 ? "Second" : "First");
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:14: error: 'uts' was not declared in this scope; did you mean 'puts'?
   43 |         else uts((ch.size() + (ch[0] == ch[n - 1] ? 1 : 0)) % 2 == 0 ? "Second" : "First");
      |              ^~~
      |              puts
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <stack>
#include <ctime>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cassert>
#include <iomanip>
#include <complex>
using namespace std;
typedef long long ll;
typedef long double ld;
 
const ll inf=1000000000000000LL;
const int maxn=1e5+10;
const int mod=1000000007;
string s;
 
int main(){
    //freopen("output.txt", "r", stdin);
    //freopen("answers.txt", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin>>s;
    if(((s[0]==s.back())+sz(s))%2==0)
        cout<<"Second"<<endl;
    else
        cout<<"First"<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:26: error: 'sz' was not declared in this scope; did you mean 's'?
   35 |     if(((s[0]==s.back())+sz(s))%2==0)
      |                          ^~
      |                          s
Language: C++

#include<string>
#include<iostream>
using namespace std;
int main(void){
	string s; cin >> s;
	cout << ( (s.size()%2 == 0) ^ (s.front() == s.back()) )?"Second":"First" << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:82: error: invalid operands of types 'const char [6]' and '<unresolved overloaded function type>' to binary 'operator<<'
    6 |         cout << ( (s.size()%2 == 0) ^ (s.front() == s.back()) )?"Second":"First" << endl;
      |                                                                          ~~~~~~~~^~~~~~~
Language: C++

#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <numeric>
using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<((x))<<endl
#define fi first
#define se second

#define INF 123456789987654321
#define long long long

int main(){
  long n,h;
  cin>>n>>h;
  long a,b,c,d,e;
  cin>>a>>b>>c>>d>>e;
  b+=e;
  d+=e;

  long need = n*e-h;
  long ans = INF;
  long i=0;
  while(i<=n && i*b<=need){
    long j = max(0, (need-i*b+d)/d);
    if(i+j<=n) ans = min(ans, i*a+j*c);
    i++;
  }

  cout<<ans<<endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:17: error: no matching function for call to 'max(int, long long int)'
   42 |     long j = max(0, (need-i*b+d)/d);
      |              ~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:42:17: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   42 |     long j = max(0, (need-i*b+d)/d);
      |              ~~~^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:7:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:42:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   42 |     long j = max(0, (need-i*b+d)/d);
      |              ~~~^~~~~~~~~~~~~~~~~~~
Language: C++

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

using namespace std;

int const N = 1e5 + 41;
char s[N];
int n, rem;

int main(){
	scanf("%s",&s);
	n = strlen(s);
	if(s[0] == s[n-1]){
		rem = 1;
	}else{
		rem = 0;
	}
	if((n - rem) % 2 == 1){
		printf("First\n");
	}else{
		printf("Second\n");
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: 'strlen' was not declared in this scope
   14 |         n = strlen(s);
      |             ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<vector>
  +++ |+#include <cstring>
    4 | #include<string>
Language: Java

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		// standard input
		String s = sc.next();

		// process
		boolean isStrLenEvenNumber = (s.length() % 2 == 0);
		boolean isSameFirstAndLast = (s.charAt(0) == (s.charAt(s.length() - 1));

		// standard output
		System.out.println((isStrLenEvenNumber && isSameFirstAndLast) || (!isStrLenEvenNumber && !isSameFirstAndLast)? "Second": "First");
	}
}


Compiler output:
Main.java:13: error: ')' expected
		boolean isSameFirstAndLast = (s.charAt(0) == (s.charAt(s.length() - 1));
		                                                                       ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    int moves=0;
    int i=1;
    while(s.size()>2)
    {
       int f=0;
        if((i+1)<s.size())
        {
            if(s[i-1]!=s[i+1])
            {
                r=s;
                r.erase(i,1);
                f=1;
                moves++;
            }
            s=r;
        }
        if(!f)
            i++;
        
    }
    if(move%2)
        printf("First");
    else
        printf("Second");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: 'r' was not declared in this scope
   16 |                 r=s;
      |                 ^
a.cc:21:15: error: 'r' was not declared in this scope
   21 |             s=r;
      |               ^
a.cc:27:12: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator%'
   27 |     if(move%2)
      |        ~~~~^~
Language: C++

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

typedef long long ll;
typedef pair< int, int > pii;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< ll > vl;
typedef vector< vl > vvl;
typedef vector< pii > vp;
typedef vector< vp > vvp;
typedef vector< string > vs;
typedef vector< double > vd;
typedef vector< vd > vvd;

template< class T1, class T2 >
int upmin( T1 &x, T2 v ){
  if( x > v ){
    x = v;
    return 1;
  }
  return 0;
}

template< class T1, class T2 >
int upmax( T1 &x, T2 v ){
  if( x < v ){
    x = v;
    return 1;
  }
  return 0;
}

const int INF = 0x3f3f3f3f;

const string msg[] = { "Second", "First" };
string S;

void solve(){
  cin >> S;
  cout << msg[ ( S.size() % 2 == 0 ) ^ ( S.front == S.back() ) ] << endl;
}

signed main(){
  ios::sync_with_stdio( 0 );
  // init();
  // preprocess();
  solve();
  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:41:50: error: invalid operands of types '<unresolved overloaded function type>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to binary 'operator=='
   41 |   cout << msg[ ( S.size() % 2 == 0 ) ^ ( S.front == S.back() ) ] << endl;
      |                                          ~~~~~~~ ^~ ~~~~~~~~
      |                                            |              |
      |                                            |              __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
      |                                            <unresolved overloaded function type>
Language: C++

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

typedef long long ll;
typedef pair< int, int > pii;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< ll > vl;
typedef vector< vl > vvl;
typedef vector< pii > vp;
typedef vector< vp > vvp;
typedef vector< string > vs;
typedef vector< double > vd;
typedef vector< vd > vvd;

template< class T1, class T2 >
int upmin( T1 &x, T2 v ){
  if( x > v ){
    x = v;
    return 1;
  }
  return 0;
}

template< class T1, class T2 >
int upmax( T1 &x, T2 v ){
  if( x < v ){
    x = v;
    return 1;
  }
  return 0;
}

const int INF = 0x3f3f3f3f;

const string msg[] = { "Second", "First" };
string S;

void solve(){
  cin >> S;
  cout << msg[ ( S.size() % 2 == 0 ) ^ ( S.front == S.back() ) ] << endl;
}

signed main(){
  ios::sync_with_stdio( 0 );
  init();
  preprocess();
  solve();
  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:41:50: error: invalid operands of types '<unresolved overloaded function type>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to binary 'operator=='
   41 |   cout << msg[ ( S.size() % 2 == 0 ) ^ ( S.front == S.back() ) ] << endl;
      |                                          ~~~~~~~ ^~ ~~~~~~~~
      |                                            |              |
      |                                            |              __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
      |                                            <unresolved overloaded function type>
a.cc: In function 'int main()':
a.cc:46:3: error: 'init' was not declared in this scope; did you mean 'int'?
   46 |   init();
      |   ^~~~
      |   int
a.cc:47:3: error: 'preprocess' was not declared in this scope
   47 |   preprocess();
      |   ^~~~~~~~~~
Language: C++

#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <iostream>
#include <queue>
#include <list>
#include <stack>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;

map<string,bool> memo;

bool solve(string& S){
  if(S.length()==3){
    if(S[0] == S[2]) return false;
    return true;
  }
  if(memo.count(S)>0) return memo[S];
  bool flg = true;
  int cnt = 0;
  REP(i,1,S.length()-1){
    if(S[i-1] == S[i+1]) continue;
    cnt++;
    if(solve(S.substr(0,i) + S.substr(i+1))) flg = false;
  }
  if(cnt == 0) flg = false;
  //cerr << S << "\t" << flg << endl;
  return memo[S] = flg;
}

int main(){
  ios::sync_with_stdio(false);
  string S;
  cin >> S;

  if(solve(S)) cout << "First" << endl;
  else cout << "Second" << endl;
  
  return 0;
}



Compiler output:
a.cc: In function 'bool solve(std::string&)':
a.cc:36:28: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::__cxx11::basic_string<char>'
   36 |     if(solve(S.substr(0,i) + S.substr(i+1))) flg = false;
      |              ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
a.cc:25:20: note:   initializing argument 1 of 'bool solve(std::string&)'
   25 | bool solve(string& S){
      |            ~~~~~~~~^
Language: C++

#include <cstdio>
#include <algorithm>
#include <vector>
#include <cstring>
#include <numeric>
#include <cassert>
#include <cmath>
#include <map>
#include <set>

using namespace std;
typedef unsigned int uint;
typedef long long LL;
typedef pair<LL, LL> PLL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int, int> PII;
typedef vector<PII > VPII;
typedef vector<VPII> VVPII;

#define FOR(k,a,b) for(int k(a); k < (b); ++k)
#define REP(k,a) for(int k=0; k < (a); ++k)
#define ABS(a) ((a)>0?(a):-(a))

int main(int argc, char** argv) {
#ifdef HOME
	freopen("in.txt", "rb", stdin);
	freopen("out.txt", "wb", stdout);
#endif
	string s;
	cin >> s;
	int N = s.length();
	vector<int> v(30);
	REP(i, N)
		v[s[i] - 'a']++;
	int mx = 0;
	REP(i, 30)
		if (v[i] > mx)
		{
			mx = v[i];
		}
	string ans;
	if (N & 1)
	{
		ans = (s[0] == s.back() ? "Second" : "First");//(2 * mx == N + 1 ? "first" : "second");
	}
	else
	{
		ans = (s[0]!=s.back()? "Second" : "First");
	}
	
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:32:9: error: 'string' was not declared in this scope
   32 |         string s;
      |         ^~~~~~
a.cc:10:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    9 | #include <set>
  +++ |+#include <string>
   10 | 
a.cc:33:9: error: 'cin' was not declared in this scope
   33 |         cin >> s;
      |         ^~~
a.cc:10:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    9 | #include <set>
  +++ |+#include <iostream>
   10 | 
a.cc:33:16: error: 's' was not declared in this scope
   33 |         cin >> s;
      |                ^
a.cc:44:15: error: expected ';' before 'ans'
   44 |         string ans;
      |               ^~~~
      |               ;
a.cc:47:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   47 |                 ans = (s[0] == s.back() ? "Second" : "First");//(2 * mx == N + 1 ? "first" : "second");
      |                 ^~~
      |                 abs
a.cc:51:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   51 |                 ans = (s[0]!=s.back()? "Second" : "First");
      |                 ^~~
      |                 abs
a.cc:54:9: error: 'cout' was not declared in this scope
   54 |         cout << ans << endl;
      |         ^~~~
a.cc:54:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:54:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   54 |         cout << ans << endl;
      |                 ^~~
      |                 abs
a.cc:54:24: error: 'endl' was not declared in this scope
   54 |         cout << ans << endl;
      |                        ^~~~
a.cc:10:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    9 | #include <set>
  +++ |+#include <ostream>
   10 |
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin>>s;
    int n=s.size();
    int idx;
    if(s[0]==s[n-1]) idx=1;
    else idx=0;
    if(idx){
        if(n%2) cout<<Second;
        else cout<<First;
    }
    else {
        if(n%2) cout<<First;
        else cout<<Second;

    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: 'Second' was not declared in this scope
   11 |         if(n%2) cout<<Second;
      |                       ^~~~~~
a.cc:12:20: error: 'First' was not declared in this scope
   12 |         else cout<<First;
      |                    ^~~~~
a.cc:15:23: error: 'First' was not declared in this scope
   15 |         if(n%2) cout<<First;
      |                       ^~~~~
a.cc:16:20: error: 'Second' was not declared in this scope
   16 |         else cout<<Second;
      |                    ^~~~~~
Language: C++


#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;

char str[123456];

int main(void)
{
	scanf("%s", str);
	int n = strlen(str);
	if (str[0] == str[n - 1])
	{
		if (n % 2 == 0)
		{
			printf("First\n");
		}
		else
		{
			printf("Second\n");
		}
	}
	else
	{
		if (n % 2 == 0)
		{
			printf("Second\n");
		}
		else
		{
			printf("First\n");
		}
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:17: error: 'strlen' was not declared in this scope
   27 |         int n = strlen(str);
      |                 ^~~~~~
a.cc:20:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   19 | #include <queue>
  +++ |+#include <cstring>
   20 | using namespace std;
Language: C++

//In the Name of God
//Ya Ali

#include<bits/stdc++.h>

#define err(A) cout<<#A<<" = "<<(A)<<endl

using namespace std;

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

  string s;
  cin>>s;

  if(s[0]==s[n-1] xor (n&1))
    cout<<"Second"<<endl;
  else
    cout<<"First"<<endl;
    
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: 'n' was not declared in this scope
   17 |   if(s[0]==s[n-1] xor (n&1))
      |              ^
Language: C++

#include <cstdio>
#include <cstring>
#include <cmath>
#include <queue>
#include <cstring>
#include <vector>
#include <string>
#include <stack>
#include <set>
#include <map>
#include <iostream>
#include <algorithm>
using namespace std;
#define MP make_pair
#define PB push_back
typedef long long LL;
typedef pair<int, int> Pii;
const int inf = 0x3f3f3f3f;
const LL INF = (1uLL << 63) - 1;
const LL mod = 1000000007;
const int N = 1e5 + 5;
const double Pi = acos(-1.0);
const int maxn = 1e5 + 5;
char s[100005];
int L[100005],R[100005];
int main() {
#ifdef local
    freopen("in", "r", stdin);
#endif
    scanf("%s",s);
    int n = strlen(s);
    bool win = 0;
    for(int i = 0; i < n ;i++){
        L[i] = i - 1;
        R[i] = i+1;
    }
    L[0] = -1;
    R[n-1] = -1;
    for(int i = 1; i < n ; i++){
        if(s[i]!='&'){
            int l = L[i];
            int r = R[i];
            if(l >= 0 && r < n && r >= l & &l < n&&s[l]!=s[r]){
                s[i] = '&';
                R[i-1] = R[i];
                L[i+1] = L[i-1];
                win^=1;
                i = L[i];
            }
        }
    }
    if(win)cout<<"First"<<endl;
    else cout<<"Second"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:47: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   43 |             if(l >= 0 && r < n && r >= l & &l < n&&s[l]!=s[r]){
      |                                            ~~~^~~
Language: C++

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

int main() {
	string s;
	cin>>s;
	char f,l;
	f=s[0],l=s[s.size()-1];
	int rest;
	if(f==l){
		rest=3;
	}else{
		rest=0;
		char t=l;
		for(int i=0;i<s.size();i++){
			if(t==l){
				if(s[i]==f){
					rest++;
					t=f;
				}
			}else{
				if(s[i]==l){
					rest++;
					t=l;
				}
			}
		}
	}
	if(((int)s.size()-rest)%2==0){
		cout << "Second" << endl;
	}else{
		cout << "First" << endl;
	}
	
	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:36:18: error: expected '}' at end of input
   36 |         return 0;
      |                  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C

#include <algorithm>    //STL ????
#include <bitset>     //STL ????
#include <cctype> //????
#include <cerrno>      //?????
#include <cfloat>     //?????
#include <ciso646> //?????????
#include <climits>     //?????????????
#include <clocale>     //???????
#include <cmath>      //??????
#include <complex>     //???
#include <csignal> //??????
#include <csetjmp> //??????
#include <cstdarg> //????????
#include <cstddef> //????
#include <cstdio>      //????/????
#include <cstdlib>     //?????????????
#include <cstring>     //?????
#include <ctime>      //?????????
#include <cwchar>      //????????/??
#include <cwctype>     //?????
#include <deque>      //STL ??????
#include <exception>    //?????
#include <fstream>     //????/??
#include <functional>   //STL ??????(?????)
#include <limits>      //????????????
#include <list>      //STL ??????
#include <locale> //???????
#include <map>       //STL ????
#include <memory> //STL????????????
#include<new> //??????
#include <numeric> //STL???????
#include <iomanip>     //?????/??
#include <ios>       //????/????
#include <iosfwd>     //??/???????????
#include <iostream>    //?????/??
#include <istream>     //?????
#include <iterator> //STL???
#include <ostream>     //?????
#include <queue>      //STL ????
#include <set>       //STL ????
#include <sstream>     //???????
#include <stack>      //STL ????
#include <stdexcept>    //?????
#include <streambuf>    //????/????
#include <string>     //????
#include <typeinfo> //????????
#include <utility>     //STL ?????
#include <valarray> //??????????
#include <vector>     //STL ??????
using namespace std;
const double INF=1e18;
const int N=1010;
int n;

struct Edge{
	int nxt,to;
	double dis;
}edge[N*N];
int head[N],edge_num;
void add(int f,int t,double d){
	edge[edge_num].nxt=head[f];
	edge[edge_num].dis=d;
	edge[edge_num].to=t;
	head[f]=edge_num++;
	return;
}

struct node{
	int x,y,r;
}a[N],s,t;
double cale_dis(node a,node b){
	return max(0.0,sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y))-a.r-b.r);
}

struct nd{
	int id;
	double d;
	bool friend operator < (nd a,nd b){
		return a.d>b.d;
	}
}nw;
priority_queue <nd> q;

bool vis[N];
double dist[N];
void dij(int x){
	for (int i=1;i<=n+2;i++) dist[i]=INF;
	dist[x]=nw.d=0.0; nw.id=x;
	q.push(nw);
	while(!q.empty()){
		nw=q.top(); q.pop();
		int u=nw.id;
		if (vis[u]) continue;
		vis[u]=1;
		for (int i=head[u];~i;i=edge[i].nxt){
			int v=edge[i].to;
			if (vis[v]||dist[v]<=dist[u]+edge[i].dis) continue;
			dist[v]=dist[u]+edge[i].dis;
			nw.id=v; nw.d=dist[v];
			q.push(nw);
		}
	}
	return;
}

int main(){
	memset(head,-1,sizeof(head));
	scanf("%d%d%d%d",&s.x,&s.y,&t.x,&t.y); s.r=0.0; t.r=0.0;
	scanf("%d",&n);
	for (int i=1;i<=n;i++) scanf("%d%d%d",&a[i].x,&a[i].y,&a[i].r);
	for (int i=1;i<=n;i++){
		add(n+1,i,cale_dis(s,a[i])); add(i,n+1,cale_dis(s,a[i]));
		add(i,n+2,cale_dis(t,a[i])); add(n+2,i,cale_dis(t,a[i])); 
		for (int j=1;j<=n;j++) add(i,j,cale_dis(a[i],a[j]));
	}
	dij(n+1);
	printf("%.10lf",dist[n+2]);
	return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
const double INF=1e18;
const int N=1010;
int n;

struct Edge{
	int nxt,to;
	double dis;
}edge[N*N];
int head[N],edge_num;
void add(int f,int t,double d){
	edge[edge_num].nxt=head[f];
	edge[edge_num].dis=d;
	edge[edge_num].to=t;
	head[f]=edge_num++;
	return;
}

struct node{
	int x,y,r;
}a[N],s,t;
double cale_dis(node a,node b){
	return max(0.0,sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y))-a.r-b.r);
}

struct nd{
	int id;
	double d;
	bool friend operator < (nd a,nd b){
		return a.d>b.d;
	}
}nw;
priority_queue <nd> q;

bool vis[N];
double dist[N];
void dij(int x){
	for (int i=1;i<=n+2;i++) dist[i]=INF;
	dist[x]=nw.d=0.0; nw.id=x;
	q.push(nw);
	while(!q.empty()){
		nw=q.top(); q.pop();
		int u=nw.id;
		if (vis[u]) continue;
		vis[u]=1;
		for (int i=head[u];~i;i=edge[i].nxt){
			int v=edge[i].to;
			if (vis[v]||dist[v]<=dist[u]+edge[i].dis) continue;
			dist[v]=dist[u]+edge[i].dis;
			nw.id=v; nw.d=dist[v];
			q.push(nw);
		}
	}
	return;
}

int main(){
	memset(head,-1,sizeof(head));
	scanf("%d%d%d%d",&s.x,&s.y,&t.x,&t.y); s.r=0.0; t.r=0.0;
	scanf("%d",&n);
	for (int i=1;i<=n;i++) scanf("%d%d%d",&a[i].x,&a[i].y,&a[i].r);
	for (int i=1;i<=n;i++){
		add(n+1,i,cale_dis(s,a[i])); add(i,n+1,cale_dis(s,a[i]));
		add(i,n+2,cale_dis(t,a[i])); add(n+2,i,cale_dis(t,a[i])); 
		for (int j=1;j<=n;j++) add(i,j,cale_dis(a[i],a[j]));
	}
	dij(n+1);
	printf("%.10lf",dist[n+2]);
	return 0;
}

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

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include<math.h>
using namespace std;
#define inf 0x3f3f3f3f
#define N 1005
long double maze[N][N], dis[N];
int n;
int vis[N];
void Dijkstra()
{
	int i, j, minn, indx;
	memset(vis, 0, sizeof(vis));
	vis[0] = 1;
	for (i = 0; i <= n + 1; i++)
		dis[i] = maze[0][i];
	for (i = 1; i <= n + 1; i++)
	{
		minn = inf;
		for (j = 1; j <= n + 1; j++)
		{
			if (dis[j] < minn && !vis[j])
			{
				indx = j;
				minn = dis[j];
			}
		}
		vis[indx] = 1;
		for (j = 1; j <= n + 1; j++)
		{
			if (!vis[j] && dis[indx] + maze[indx][j] < dis[j])
				dis[j] = dis[indx] + maze[indx][j];
		}
	}
}
struct node
{
	int x;
	int y;
	int r;
} s[N];
int main()
{
	int xx, yy;
	scanf_s("%d%d%d%d", &s[0].x, &s[0].y, &xx, &yy);
	s[0].r = 0;
	scanf_s("%d", &n);
	for (int i = 0; i <= n + 1; i++)for (int j = 0; j <= n + 1; j++)maze[i][j] = inf;
	s[n + 1].x = xx;
	s[n + 1].y = yy;
	s[n + 1].r = 0;
	for (int i = 1; i <= n; i++)
		scanf_s("%d%d%d", &s[i].x, &s[i].y, &s[i].r);
	for (int i = 0; i <= n + 1; i++)
	{
		for (int j = i + 1; j <= n + 1; j++)
		{
			maze[i][j] = (long double)sqrt((long double)(s[i].x - s[j].x)*(s[i].x - s[j].x) + (s[i].y - s[j].y)*(s[i].y - s[j].y));
			maze[i][j] -= s[i].r + s[j].r;
			if (maze[i][j] < 0)
				maze[i][j] = 0;
			maze[j][i] = maze[i][j];
		}
	}
	Dijkstra();
	printf("%.9Lf\n", dis[n + 1]);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   46 |         scanf_s("%d%d%d%d", &s[0].x, &s[0].y, &xx, &yy);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include<math.h>
using namespace std;
#define inf 0x3f3f3f3f
#define N 1005
double maze[N][N], dis[N];
int n;
int vis[N];
void Dijkstra()
{
	int i, j, minn, indx;
	memset(vis, 0, sizeof(vis));
	vis[0] = 1;
	for (i = 0; i <= n + 1; i++)
		dis[i] = maze[0][i];
	for (i = 1; i <= n + 1; i++)
	{
		minn = inf;
		for (j = 1; j <= n + 1; j++)
		{
			if (dis[j] < minn && !vis[j])
			{
				indx = j;
				minn = dis[j];
			}
		}
		vis[indx] = 1;
		for (j = 1; j <= n + 1; j++)
		{
			if (!vis[j] && dis[indx] + maze[indx][j] < dis[j])
				dis[j] = dis[indx] + maze[indx][j];
		}
	}
}
struct node
{
	int x;
	int y;
	int r;
} s[N];
int main()
{
	int xx, yy;
	scanf_s("%d%d%d%d", &s[0].x, &s[0].y, &xx, &yy);
	s[0].r = 0;
	scanf_s("%d", &n);
	for (int i = 0; i <= n + 1; i++)for (int j = 0; j <= n + 1; j++)maze[i][j] = inf;
	s[n + 1].x = xx;
	s[n + 1].y = yy;
	s[n + 1].r = 0;
	for (int i = 1; i <= n; i++)
		scanf_s("%d%d%d", &s[i].x, &s[i].y, &s[i].r);
	for (int i = 0; i <= n + 1; i++)
	{
		for (int j = i + 1; j <= n + 1; j++)
		{
			maze[i][j] = (long double)sqrt((long double)(s[i].x - s[j].x)*(s[i].x - s[j].x) + (s[i].y - s[j].y)*(s[i].y - s[j].y));
			maze[i][j] -= s[i].r + s[j].r;
			if (maze[i][j] < 0)
				maze[i][j] = 0;
			maze[j][i] = maze[i][j];
		}
	}
	Dijkstra();
	printf("%.9lf\n", dis[n + 1]);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   46 |         scanf_s("%d%d%d%d", &s[0].x, &s[0].y, &xx, &yy);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <cmath>
#include <iomanip>
#include <functional>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define REP(i, n) for (int i = 1; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) (int)(x).size()
using namespace std;
using ll = long long;
constexpr int inf = 1000000000;
constexpr ll INF = 5000000000000000000;

#define double long double
#define int ll

struct Edge {int to; double cost;};

int main() {
    int xs, ys, xg, yg;
    cin >> xs >> ys >> xg >> yg;
    int N;
    cin >> N;
    vector<int> x(N), y(N), r(N);
    rep(i, N) cin >> x[i] >> y[i] >> r[i];
    
    vector<vector<Edge>> G(N + 2);
    rep(i, N) {
        G[0].push_back(Edge{i + 1, max(sqrt((xs - x[i]) * (xs - x[i]) + (ys - y[i]) * (ys - y[i])) - r[i], 0.0)});
        G[i + 1].push_back(Edge{0, max(sqrt((xs - x[i]) * (xs - x[i]) + (ys - y[i]) * (ys - y[i])) - r[i], 0.0)});
        G[N + 1].push_back(Edge{i + 1, max(sqrt((xg - x[i]) * (xg - x[i]) + (yg - y[i]) * (yg - y[i])) - r[i], 0.0)});
        G[i + 1].push_back(Edge{N + 1, max(sqrt((xg - x[i]) * (xg - x[i]) + (yg - y[i]) * (yg - y[i])) - r[i], 0.0)});
    }
    rep(i, N) rep(j, N) {
        if (i == j) continue;
        G[i + 1].push_back(Edge{j + 1, max(sqrt((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j])) - r[i] - r[j], 0.0)});
    }
    G[0].push_back(Edge{N + 1, sqrt((xs - xg) * (xs - xg) + (ys - yg) * (ys - yg))});
    G[N + 1].push_back(Edge{N, sqrt((xs - xg) * (xs - xg) + (ys - yg) * (ys - yg))});
    
    vector<double> dist(N + 2, 3000000000000000000.0);
    dist[0] = 0;
    vector<int> used(N + 2, 0);
    priority_queue<pair<double, int>> pq;
    pq.push(pair<double, int>{0, 0});
    while (!pq.empty()) {
        int v = pq.top().second;
        pq.pop();
        if (used[v]) continue;
        for (auto e : G[v]) {
            double alt = dist[v] + e.cost;
            if (alt < dist[e.to]) {
                dist[e.to] = alt;
                pq.push(pair<double, int>{-alt, e.to});
            }
        }
        used[v] = 1;
    }
    cout << fixed << setprecision(15) << dist[N + 1] << "\n";
    return 0;
}


Compiler output:
a.cc:24:13: error: '::main' must return 'int'
   24 | #define int ll
      |             ^~
a.cc:28:1: note: in expansion of macro 'int'
   28 | int main() {
      | ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <queue>
#define flush fflush(stdout)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pl;
typedef pair<double, int> Pd;
const int mod = (int)1e9 + 7, INF = (int)1e9;
const int di[4] = { 1,0,-1,0 }, dj[4] = { 0,1,0,-1 };


int main(void) {
    int n, i, pv;
    double xs, ys, xg, yg, x[1007], y[1007], r[1003], d[1007] = {}, ds, nds, dx, dy;
    priority_queue<Pd, vector<Pd>, greater<Pd>> pq;

    scanf("%lf%lf%lf%lf", &xs, &ys, &xg, &yg);
    scanf("%d", &n);
    for (i = 0; i < n; i++) {
        scanf("%lf%lf%lf", &x[i + 1], &y[i + 1], &r[i + 1]);
    }

    for (i = 0; i < n + 2; i++) {
        d[i] = 1000000000.0;
    }

    x[0] = xs;
    y[0] = ys;
    x[n + 1] = xg;
    y[n + 1] = yg;
    r[0] = r[n + 1] = 0.0;
    d[0] = 0.0;
    pq.push(Pd(0.0, 0));
    while (!pq.empty()) {
        Pd p = pq.top();
        pq.pop();
        ds = p.first;
        pv = p.second;
        if (d[pv] < ds) {
            continue;
        }
        for (i = 1; i < n + 2; i++) {
            if (i == pv) {
                continue;
            }
            dx = x[pv] - x[i];
            dy = y[pv] - y[i];
            nds = max(0.0, sqrt(dx * dx + dy * dy) - r[pv] - r[i]);
            if (d[i] > ds + nds) {
                d[i] = ds + nds;
                pq.push(Pd(d[i], i));
            }
        }
    }

    printf("%.12lf\n", d[n + 1]);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:28: error: 'sqrt' was not declared in this scope
   50 |             nds = max(0.0, sqrt(dx * dx + dy * dy) - r[pv] - r[i]);
      |                            ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <queue>
#define flush fflush(stdout)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pl;
typedef pair<double, int> Pd;
const int mod = (int)1e9 + 7, INF = (int)1e9;
const int di[4] = { 1,0,-1,0 }, dj[4] = { 0,1,0,-1 };


int main(void) {
    int n, i, pv;
    double xs, ys, xg, yg, x[1007], y[1007], r[1003], d[1007] = {}, ds, nds, dx, dy;
    priority_queue<Pd, vector<Pd>, greater<Pd>> pq;

    scanf("%lf%lf%lf%lf", &xs, &ys, &xg, &yg);
    scanf("%d", &n);
    for (i = 0; i < n; i++) {
        scanf("%lf%lf%lf", &x[i + 1], &y[i + 1], &r[i + 1]);
    }

    for (i = 0; i < n + 2; i++) {
        d[i] = 1000000000.0;
    }

    x[0] = xs;
    y[0] = ys;
    x[n + 1] = xg;
    y[n + 1] = yg;
    r[0] = r[n + 1] = 0.0;
    d[0] = 0.0;
    pq.push(Pd(0.0, 0));
    while (!pq.empty()) {
        Pd p = pq.top();
        pq.pop();
        ds = p.first;
        pv = p.second;
        if (d[pv] < ds) {
            continue;
        }
        for (i = 1; i < n + 2; i++) {
            if (i == pv) {
                continue;
            }
            dx = abs(x[pv] - x[i]);
            dy = abs(y[pv] - y[i]);
            nds = max(0.0, sqrt(dx * dx + dy * dy) - r[pv] - r[i]);
            if (d[i] > ds + nds) {
                d[i] = ds + nds;
                pq.push(Pd(d[i], i));
            }
        }
    }

    printf("%.12lf\n", d[n + 1]);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:28: error: 'sqrt' was not declared in this scope
   50 |             nds = max(0.0, sqrt(dx * dx + dy * dy) - r[pv] - r[i]);
      |                            ^~~~
Language: C++

#include <iostream>
#include <iomanip>
//#include <string>
#include <vector>
#include <algorithm>
//#include <utility>
//#include <set>
//#include <map>
#include <queue>
//#include <deque>
//#include <bitset>
//#include <math.h>
using namespace std ;
using ll = long long ;
using ld = long double ;
using vll = vector<ll> ;
using vvll = vector<vll> ;
//using vc = vector<char> ;
//using vvc = vector<vc> ;
//using vb = vector<bool> ;
//using vvb = vector<vb> ;
//using pll = pair<ll,ll> ;
//#define all(v) v.begin(),v.end()
//ll mod = 1000000007 ;
//long double pie = acos(-1) ;
//ll INF = 1000000000000 ;

//void yorn(bool a){if(a) cout << "Yes" << endl ; else cout << "No" << endl ;}
//void YorN(bool a){if(a) cout << "YES" << endl ; else cout << "NO" << endl ;}
//ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
//ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
//ll sa(long long a,long long b){if(a>b) return a-b ; return b-a ;}
void fix_cout(){cout << fixed << setprecision(20) ;}

template<class F,class S,class T>
struct triple{
	F first ;
	S second ;
	T third ;
	triple(F f,S s,T t){
		first = f ;
		second = s ;
		third = t ;
	}
	triple(){}

	bool operator<(const triple<F,S,T> &right) const{
		if(first!=right.first) return first<right.first ;
		else if(second!=right.second) return second<right.second ;
		else return third<right.third ;
	}
	bool operator>(const triple<F,S,T> &right) const{
		return right<*this ;
	}
	bool operator<=(const triple<F,S,T> &right) const{
		return !(*this>right) ;
	}
	bool operator>=(const triple<F,S,T> &right) const{
		return !(*this<right) ;
	}
};

int main(){
	auto dis = [](ll a,ll b,ll c,ll d){
		return sqrt((a-c)*(a-c)+(b-d)*(b-d)) ;
	} ;

	fix_cout() ;
	ll sx,sy,gx,gy ;
	cin >> sx >> sy >> gx >> gy ;
	ll n ; cin >> n ;
	vector<triple<ll,ll,ll>> c(n+2) ;
	c.at(0).first = sx ; c.at(0).second = sy ; c.at(0).third = 0 ;
	for(int i=1;i<=n;i++) cin >> c.at(i).first >> c.at(i).second >> c.at(i).third ;
	c.at(n+1).first = gx ; c.at(n+1).second = gy ; c.at(n+1).third = 0 ;
	vector<vector<ld>> d(n+2,vector<ld>(n+2)) ;
	for(int i=0;i<n+2;i++){
		for(int j=0;j<n+2;j++){
			if(i==j) d.at(i).at(j) = 0 ;
			else{
				d.at(i).at(j) = max(0.0,dis(c.at(i).first,c.at(i).second,c.at(j).first,c.at(j).second)-c.at(i).third-c.at(j).third) ;
			}
		}
	}
	vector<ld> cnt(n+2,100000000000000.0) ;
	priority_queue<triple<ld,ll,ll>,vector<triple<ld,ll,ll>>,greater<triple<ld,ll,ll>>> pq ;
	cnt.at(0) = 0 ;
	for(int i=1;i<n+2;i++) pq.emplace(d.at(0).at(i),0,i) ;
	vll use(n+2,0) ;
	while(!pq.empty()){
		triple<ld,ll,ll> e = pq.top() ;
		pq.pop() ;
		if(use.at(e.third)) continue ;
//		cout << e.second << " " << e.third << " " << e.first << endl ;
		use.at(e.third) = 1 ;
		cnt.at(e.third) = cnt.at(e.second)+e.first ;
		for(int i=0;i<n+2;i++) if(i!=e.third) pq.emplace(d.at(e.third).at(i),e.third,i) ;
	}
	cout << cnt.at(n+1) << endl ;
//	for(auto i:cnt) cout << i << endl ;
}


Compiler output:
a.cc: In lambda function:
a.cc:65:24: error: 'sqrt' was not declared in this scope
   65 |                 return sqrt((a-c)*(a-c)+(b-d)*(b-d)) ;
      |                        ^~~~
Language: C++

#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <cmath>
#include <limits>
#define REP(i,n) for(int i=0;i<(n);++i)
using namespace std;
typedef long long LL;

double calc_dist(double Xa, double Ya, double Ra, double Xb, double Yb, double Rb) {
  double dX = Xa - Xb, dY = Ya - Yb;
  return max(sqrt(dX * dX + dY * dY) - Ra - Rb, 0.0);
}

int main() {
  double Xs, Ys, Xt, Yt;
  cin >> Xs >> Ys >> Xt >> Yt;
  int N;
  cin >> N;
  vector<double> X(N), Y(N), R(N), dist(N);
  bool visited(N, false);
  priority_queue<pair<double,int>> q;
  REP(i, N) {
    cin >> X[i] >> Y[i] >> R[i];
    double d = calc_dist(Xs, Ys, 0, X[i], Y[i], R[i]);
    dist[i] = d;
    q.push(make_pair(d, i));
  }
  while(!q.empty()) {
    auto item = q.top();
    q.pop();
    double td = item.first;
    int idx = item.second;
    if(td > dist[idx]) continue;
    visited[idx] = true;
    REP(i, N) {
      if(visited[i]) continue;
      double newdist = td + calc_dist(X[idx], Y[idx], R[idx], X[i], Y[i], R[i]);
      if(newdist < dist[i]) {
        dist[i] = newdist;
        q.push(make_pair(newdist, i));
      }
    }
  }
  
  double ret = calc_dist(Xt, Yt, 0, Xs, Ys, 0);
  REP(i, N) {
    double newdist = dist[i] + calc_dist(Xt, Yt, 0, X[i], Y[i], R[i]);
    ret = min(ret, newdist);
  }
  cout << fixed << setprecision(9) << ret << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:24: error: expression list treated as compound expression in initializer [-fpermissive]
   24 |   bool visited(N, false);
      |                        ^
a.cc:38:12: error: invalid types 'bool[int]' for array subscript
   38 |     visited[idx] = true;
      |            ^
a.cc:40:17: error: invalid types 'bool[int]' for array subscript
   40 |       if(visited[i]) continue;
      |                 ^
Language: C++

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

typedef long long ll;
typedef pair<ll,ll> pi;
typedef vector <ll> vi;
typedef pair<ll,double> pd;
typedef pair<double,ll> pdi;

typedef vector <pd> vpi;
typedef pair<pi,ll> pii;
#define f first
#define s second
#define FOR(i,s,e) for(ll i=s;i<=ll(e);++i)
#define DEC(i,s,e) for(ll i=s;i>=ll(e);--i)
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define lbd(x, y) lower_bound(all(x), y)
#define ubd(x, y) upper_bound(all(x), y)
#define aFOR(i,x) for (auto i: x)
#define mem(x,i) memset(x,i,sizeof x)
#define fast ios_base::sync_with_stdio(false),cin.tie(0)
#define maxn 1010

pi st,e;
int N;

pii points[maxn];

double cirtocir(pii c1,pii c2){
	int dist = (c1.f.f - c2.f.f)*(c1.f.f - c2.f.f) + (c1.f.s - c2.f.s) * (c1.f.s - c2.f.s);
	
	double d = sqrt(dist);
	
	return max((double)0,d - c1.s - c2.s);
}

double ptop(pi p1,pi p2){
	int dist = (p1.f - p2.f)*(p1.f - p2.f) + (p1.s - p2.s) * (p1.s - p2.s);
	
	return sqrt(dist);
}

double ptocir(pi p1,pii c2){
	int dist = (p1.f - c2.f.f)*(p1.f - c2.f.f) + (p1.s - c2.f.s) * (p1.s - c2.f.s);
	
	return max((double)0,sqrt(dist) - c2.s);
}
	
	
vpi adj[maxn];
double dist[maxn];

int main(){
	fast;
  
  	cout<<setprecision(10)
	
	cin>>st.f>>st.s>>e.f>>e.s;
	cin>>N;
	
	FOR(i,1,N){
		cin>>points[i].f.f>>points[i].f.s>>points[i].s;
	}
	
	FOR(i,0,N+1){
		FOR(j,i+1,N+1){
			double dist;
			if (i == 0 && j == N+1) dist = ptop(st,e);
			else if (i == 0) dist = ptocir(st,points[j]);
			else if (j == N+1) dist = ptocir(e,points[i]);
			else dist = cirtocir(points[i],points[j]);
			
			//cout<<i<<' '<<j<<' '<<dist<<'\n';
			adj[i].pb(pd(j,dist));
			adj[j].pb(pd(i,dist));
		}
	}
	
	priority_queue <pdi,vector <pdi>, greater <pdi> > pq;
	
	pq.push(pdi(0,0));
	
	FOR(i,0,N+1) dist[i] = -1;
	dist[0] = 0;
	
	while (!pq.empty()){
		pdi cur = pq.top(); pq.pop();
		//cout<<cur.f<<' ';
		
		if (dist[cur.s] != cur.f) continue;
		
		aFOR(i,adj[cur.s]){
			if (dist[i.f] == -1 || dist[i.f] > cur.f + i.s){
				dist[i.f] = cur.f + i.s;
				pq.push(pdi(dist[i.f],i.f));
			}
		}
	}
	
	cout<<dist[N+1];
	
	
}



Compiler output:
a.cc: In function 'int main()':
a.cc:57:31: error: expected ';' before 'cin'
   57 |         cout<<setprecision(10)
      |                               ^
      |                               ;
   58 | 
   59 |         cin>>st.f>>st.s>>e.f>>e.s;
      |         ~~~