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

	#pragma GCC optimize("Ofast")
	//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
	#include <bits/stdc++.h>
	using namespace std;
	//#include <ext/pb_ds/assoc_container.hpp>
	//#include <ext/pb_ds/tree_policy.hpp>
	//using namespace __gnu_pbds;
	//#ifndef rd
	#define endl '\n'
	//#endif
	#ifdef rd
	#define trace(...) cout<<"Line:"<<__LINE__<<" "; __f(#__VA_ARGS__, __VA_ARGS__)
	template<typename Arg1>
	void __f(const char* name, Arg1&& arg1) {
		cout<<name<<" : "<<arg1<<endl;
	}
	template<typename Arg1, typename ... Args>
	void __f(const char* names, Arg1&& arg1, Args&&... args) {
		const char* comma=strchr(names+1,',');
		cout.write(names,comma-names)<<" : "<<arg1<<" | ";
		__f(comma+1,args...);
	}
	#else
	#define trace(...)
	#endif
	#define pb push_back
	#define fi first
	#define se second
	#define mkp make_pair
	//#define int long long
	typedef long long ll;
	typedef long double f80;
	//#define double long double
	#define pii pair<int,int>
	#define pll pair<ll,ll>
	#define sz(x) ((long long)x.size())
	#define fr(a,b,c) for(int a=b; a<=c; a++)
	#define frdec(a,b,c) for(int a=b; a>=c; a--)
	#define rep(a,b,c) for(int a=b; a<c; a++)
	#define trav(a,x) for(auto &a:x)
	#define all(con) con.begin(),con.end()
	const ll infl=2e18;
	const int infi=2e9;
	const int mod=1e9+7;
	typedef vector<int> vi;
	//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> oset;
	mt19937 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
	auto clk=clock();
	int rng(int lim) {
		uniform_int_distribution<int> uid(0,lim-1);
		return uid(rang);
	}
	template<class t1, class t2, class t3>
	t1 fast_expo(t2 x, t3 p) {
		if(p == 0) return 1;
		t1 r = fast_expo(x,p/2);
		if(p%2 != 0) return r * r * x;
		return r * r;
	}
	// Code from here...

	void solve() {
		ll n ,x;
        cin >> n >> x;
        
        cout << ((n-2x) * (n-x) + (n + 2x));
	}

	signed main() {
		ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
		srand(chrono::high_resolution_clock::now().time_since_epoch().count());
		cout<<fixed<<setprecision(10);
		int t=1;
		// cin>>t;
		while(t--)
			solve();
	#ifdef rd
		cout<<endl<<endl<<"Time elapsed: "<<(double)(clock()-clk)/CLOCKS_PER_SEC<<endl;
	#endif
		return 0;
	}

Compiler output:
a.cc: In function 'void solve()':
a.cc:66:21: error: unable to find numeric literal operator 'operator""x'
   66 |         cout << ((n-2x) * (n-x) + (n + 2x));
      |                     ^~
a.cc:66:40: error: unable to find numeric literal operator 'operator""x'
   66 |         cout << ((n-2x) * (n-x) + (n + 2x));
      |                                        ^~
Language: C++

	#pragma GCC optimize("Ofast")
	//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
	#include <bits/stdc++.h>
	using namespace std;
	//#include <ext/pb_ds/assoc_container.hpp>
	//#include <ext/pb_ds/tree_policy.hpp>
	//using namespace __gnu_pbds;
	//#ifndef rd
	#define endl '\n'
	//#endif
	#ifdef rd
	#define trace(...) cout<<"Line:"<<__LINE__<<" "; __f(#__VA_ARGS__, __VA_ARGS__)
	template<typename Arg1>
	void __f(const char* name, Arg1&& arg1) {
		cout<<name<<" : "<<arg1<<endl;
	}
	template<typename Arg1, typename ... Args>
	void __f(const char* names, Arg1&& arg1, Args&&... args) {
		const char* comma=strchr(names+1,',');
		cout.write(names,comma-names)<<" : "<<arg1<<" | ";
		__f(comma+1,args...);
	}
	#else
	#define trace(...)
	#endif
	#define pb push_back
	#define fi first
	#define se second
	#define mkp make_pair
	//#define int long long
	typedef long long ll;
	typedef long double f80;
	//#define double long double
	#define pii pair<int,int>
	#define pll pair<ll,ll>
	#define sz(x) ((long long)x.size())
	#define fr(a,b,c) for(int a=b; a<=c; a++)
	#define frdec(a,b,c) for(int a=b; a>=c; a--)
	#define rep(a,b,c) for(int a=b; a<c; a++)
	#define trav(a,x) for(auto &a:x)
	#define all(con) con.begin(),con.end()
	const ll infl=2e18;
	const int infi=2e9;
	const int mod=1e9+7;
	typedef vector<int> vi;
	//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> oset;
	mt19937 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
	auto clk=clock();
	int rng(int lim) {
		uniform_int_distribution<int> uid(0,lim-1);
		return uid(rang);
	}
	template<class t1, class t2, class t3>
	t1 fast_expo(t2 x, t3 p) {
		if(p == 0) return 1;
		t1 r = fast_expo(x,p/2);
		if(p%2 != 0) return r * r * x;
		return r * r;
	}
	// Code from here...

	void solve() {
		ll n ,x;
        cin >> n >> x;
        
        cout << (n-2x) * (n-x) + (n + 2x);
	}

	signed main() {
		ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
		srand(chrono::high_resolution_clock::now().time_since_epoch().count());
		cout<<fixed<<setprecision(10);
		int t=1;
		// cin>>t;
		while(t--)
			solve();
	#ifdef rd
		cout<<endl<<endl<<"Time elapsed: "<<(double)(clock()-clk)/CLOCKS_PER_SEC<<endl;
	#endif
		return 0;
	}

Compiler output:
a.cc: In function 'void solve()':
a.cc:66:20: error: unable to find numeric literal operator 'operator""x'
   66 |         cout << (n-2x) * (n-x) + (n + 2x);
      |                    ^~
a.cc:66:39: error: unable to find numeric literal operator 'operator""x'
   66 |         cout << (n-2x) * (n-x) + (n + 2x);
      |                                       ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){
  int d=a,e=b;
  if(a<b)
    swap(a,b);
  int c,d=1;
  while(d){
    c=a%b;
    if(c==0){
      int f=a;
      d--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
signed main(){
  int a,b;
  cin>>a>>b;
  cout<<3*a<<endl;
}

Compiler output:
a.cc: In function 'long long int lcm(long long int, long long int)':
a.cc:24:9: error: redeclaration of 'long long int d'
   24 |   int c,d=1;
      |         ^
a.cc:21:7: note: 'long long int d' previously declared here
   21 |   int d=a,e=b;
      |       ^
a.cc:36:14: error: 'f' was not declared in this scope
   36 |   return d*e/f;
      |              ^
Language: Java

import java.util.*;

public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        long n = scanner.nextLong();
        long x = scanner.nextLong();
        long y = n - x;
        long ans = n;
        while (x != 0 && y != 0) {
            Utils.println(x, y, ans);
            if (x > y) {
                ans += x / y * y * 2;
                x %= y;
            } else {
                ans += y / x * x * 2;
                y %= x;
            }
        }
        System.out.println(ans - x - y);
    }
}

Compiler output:
Main.java:12: error: cannot find symbol
            Utils.println(x, y, ans);
            ^
  symbol:   variable Utils
  location: class Main
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<(n);i++)

int para(int a,int b){
	else if(a%b==0)return b*(a/b*2-1);
	else return 2*b+para(b,a%b);
}



signed main(){
	int n,x;cin>>n>>x;
	int ret=0;
	ret=n+para(max(x,n-x),min(x,n-x));
	cout<<ret<<endl;
}


Compiler output:
a.cc: In function 'long long int para(long long int, long long int)':
a.cc:7:9: error: 'else' without a previous 'if'
    7 |         else if(a%b==0)return b*(a/b*2-1);
      |         ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<(n);i++)

int para(int a,int b){
	int ret=0;
	if(a%b==0)return 2*a-b;
	else return para(a/b*b,b)+para(b,a%b);
}


signed main(){
	int n,x;cin>>n>>x;
	int ret=0
	ret=n+para(max(x,n-x),min(x,n-x));
	cout<<ret<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: expected ',' or ';' before 'ret'
   16 |         ret=n+para(max(x,n-x),min(x,n-x));
      |         ^~~
Language: C

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

long long getgcd(long long N,long long X);

int main(void){
    long long N,X;
    long long buf;
    long long buf2
    long long cur;
    scanf("%lld %lld",&N,&X);
    buf=getgcd(N,X);
    buf2=N-buf;
    printf("%lld\n",3*buf2);
}

long long getgcd(long long N,long long X) {
    
    long long i;
    long long num;
    for (i=1;i<(long long)(sqrt(N)+1);i++){
        if((fmodl(N,i)==0)&&(fmodl(X,i)==0)){
            num=i;
        }
    }
    return num;
}

Compiler output:
main.c: In function 'main':
main.c:11:19: error: expected ';' before 'long'
   11 |     long long buf2
      |                   ^
      |                   ;
   12 |     long long cur;
      |     ~~~~           
main.c:15:5: error: 'buf2' undeclared (first use in this function); did you mean 'buf'?
   15 |     buf2=N-buf;
      |     ^~~~
      |     buf
main.c:15:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

#define reps(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   reps(i,0,n)
#define all(x) (x).begin(),(x).end()
#define INF (1000000010)
#define MOD (1000000007)
#define PI (acos(-1))
#define int ll

int ans;
void rec(int x,int y){
  if(y%x==0){
    ans += 2*y-x;
  }else{
    ans += 2*x*(y/x);
    rec(y%x,x);
  }
}

int main(){
  int n,x;
  cin >> n >> x;
  ans = n;
  rec(min(x,n-x),max(x,n-x));
  cout << ans << endl;
}

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

#include<iostream>
using namespace std;

int main(){
  int gcd(int a,int b){
    if(a%b==0) return(b);
    else return(gcd(b,a%b));
  }
  
  int N,K;
  cin>>N>>K;
  cout<<((N%gcd(N,K))*3-3)*gcd(N,K)<<endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:23: error: a function-definition is not allowed here before '{' token
    5 |   int gcd(int a,int b){
      |                       ^
a.cc:12:13: error: 'gcd' was not declared in this scope
   12 |   cout<<((N%gcd(N,K))*3-3)*gcd(N,K)<<endl;
      |             ^~~
Language: C++

#include <bits/stdc++.h>
using namespace syd;
typedef long long ll;
int main(){
  ll n,x;
  cin >> n >> x;
  ll ans = 0;
  ans = 3*(n-1);
  cout << ans << endl;
}
    
    
    
    

Compiler output:
a.cc:2:17: error: 'syd' is not a namespace-name
    2 | using namespace syd;
      |                 ^~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> n >> x;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |   cout << ans << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:9:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |   cout << ans << endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int main(void)
{
	int N, X;
	cin >> N >> X;
	int ans = N;
	int a = max(N - X, X);
	int b = min(N - X, X);
	int q;
	while(b)
	{
		q = a % b;
		ans += (a - q) * 2;
		a = b;
		b = q;
	}
	ans -= a;
	cout << ans << endl;
	return 0;


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

#include<stdio.h>
long gcd2(long a, long b){
	long t;
	if(a<b){
		t = a;
		a = b;
		b = t;
	}
	r = a % b;
	while(r!=0){
		a = b;
		b = r;
		r = a % b;
	}
	return b;
}
int n, x;
int main(void){
  scanf("%ld%ld");
  printf("%ld\n", (n-*gcd2(n,x))*3);
}


Compiler output:
main.c: In function 'gcd2':
main.c:9:9: error: 'r' undeclared (first use in this function)
    9 |         r = a % b;
      |         ^
main.c:9:9: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:20:22: error: invalid type argument of unary '*' (have 'long int')
   20 |   printf("%ld\n", (n-*gcd2(n,x))*3);
      |                      ^~~~~~~~~~
Language: C++

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

long long int gcm(long long a,long long b){
	long long r,tmp;
	if(a<b){
		tmp=a;
		a=b;
		b=tmp;
	}
	
	r=a%b;
	while(r!=0){
		a=b;
		b=r;
		r=a%b;
	}
	return b;
}

int main(){
	long long N,X,ans;
	cin >> N >> X;
	
	if(X>N/2)X=N-X;
	long long g=gcm(N,X);
	N/=g;X/=g;
	
	ans=((N-X)/X)*3*X;
	if(N-X)%X>0)ans+=3*X;
	ans*=g;
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:16: error: expected primary-expression before '%' token
   30 |         if(N-X)%X>0)ans+=3*X;
      |                ^
Language: C++

#include<algorithm>
#include<iostream>
using namespace std;
long test(long nokori, long now, long sum){
        long count_node,tmp = 0;
        if(nokori % now != 0){
                count_node  = nokori / now;
                count_node = count_node * 2;
                sum = sum + now * count_node;
                tmp = nokori;
                nokori = now;
                now = tmp % now;
        }else if(nokori % now == 0){
                count_node = nokori / now;
                count_node = count_node * 2 - 1;
                count_node = count_node * now;
                sum = sum + count_node;
                now = 0;
        }
        if(now != 0){
                test(nokori, now, sum);
        }
        return sum;
}

int main(){
        long x,n;
        cin >> n >> x;
        long sum,now,nokori = 0;
        nokori = n - x;
        sum = n;
        now = x;
        sum = test(nokori, now ,sum);
        cout << sum << "\n";
        return 0;
}
~   

Compiler output:
a.cc:37:2: error: expected class-name at end of input
   37 | ~
      |  ^
Language: C++

/*
          ,     \    /      ,
         / \    )\__/(     / \
        /   \  (_\  /_)   /   \
   ____/_____\__\@  @/___/_____\____
  |             |\../|              |
  |              \VV/               |
  |        ------hoi-------         |
  |_________________________________|
   |    /\ /      \\       \ /\    |
   |  /   V        ))       V   \  |
   |/     `       //        '     \|
   `              V                '
*/

#include <bits/stdc++.h>

#define ull unsigned long long
#define ll long long
#define pb push_back
#define f first
#define se second
#define mp make_pair
#define Speedforce boost();

using namespace std;

void boost(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}

const int N = 1e6;
const int inf = 1e9 + 7;

ll n, x, ans;

ll rec(ll a, ll b){
    if(b % a == 0){
        return 2 * b - a;
    }
    return rec(b % a, a) + b / a * a * 2
}

int main() {
    Speedforce
    cin >> n >> x;
    cout << rec(x, n);
}

Compiler output:
a.cc: In function 'long long int rec(long long int, long long int)':
a.cc:43:41: error: expected ';' before '}' token
   43 |     return rec(b % a, a) + b / a * a * 2
      |                                         ^
      |                                         ;
   44 | }
      | ~
Language: C++

#include <bits/stdc++.h>

#define mp make_pair
#define pb push_back 
#define pf push_front 
#define pbp pop_back
#define pfp pop_front 
#define sz(x) x.size()
#define all(x) x.begin(),x.end() 
#define ios_base ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define open(x) freopen(x".in","r",stdin),freopen(x".out","w",stdout)
#define F first
#define S second

using namespace std;

typedef unsigned long long ul;
typedef long long ll;
typedef long double ld;

const int mod = 1e9+7;
const int N = 1e5+123;
const int inf = 1e9+123;
const long long INF = 1e18;
const double eps = 1e-5;
ll n, x, ans;

void rec(ll a, ll b){
 if(b % a == 0){
  ans += b/a * (2*a) - a;
  return ;
 }else{
  ans += b/a * (2*a);
  rec(b % a, a);
 }
}

int main (){
 cin >> n >> x;
 rec(x, n-x);
 cout << ans + n;

Compiler output:
a.cc: In function 'int main()':
a.cc:41:18: error: expected '}' at end of input
   41 |  cout << ans + n;
      |                  ^
a.cc:38:12: note: to match this '{'
   38 | int main (){
      |            ^
Language: C++

value = input()
values = value.split()
     
N = int( values[0] )
X = int( values[1] )
     
shorter = min([X,N-X])
longer = max([X,N-X])
     
length = 0

while shorter>0 and longer >0 :
 
    length = int(longer/shorter)*3*shorter
     
    sho = longer/shorter
    amari = longer%shorter

    longer = shorter
    shorter = amari
    
     
print(length)

Compiler output:
a.cc:1:1: error: 'value' does not name a type
    1 | value = input()
      | ^~~~~
Language: C++

value = input()
values = value.split()
     
value = input()
values = value.split()
     
N = int( values[0] )
X = int( values[1] )
     
shorter = min([X,N-X])
longer = max([X,N-X])
     
length = 0

while shorter>0 and longer >0 :
 
    length = int(longer/shorter)*3*shorter
     
    sho = longer/shorter
    amari = longer%shorter

    longer = shorter
    shorter = amari
    
     
print(length)

Compiler output:
a.cc:1:1: error: 'value' does not name a type
    1 | value = input()
      | ^~~~~
Language: C++

#include <bits/stdc++.h>
#include <unordered_set>
using namespace std;
#define ll long long
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repeat(i,s,n) for(int (i)=s; (i)<(n); (i)++)
#define revrep(i,n) for(int (i)=(n)-1;i>=0; i--)

ll f(ll a, ll b) {
  a=min(a,b);
  b = max(a,b);
  if(a==b)
    return a;
//  return 2*aa+f(aa,bb-aa);
  if(bb%aa!=0)
    return 2*(bb/aa)*aa+f(aa,bb%aa);
  return 2*aa+f(aa,bb-aa);
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<setprecision(std::numeric_limits<float>::max_digits10);
  ll n,x;
  cin>>n>>x;
  cout << n + f(n-x,x) << endl;
  return 0;
}


Compiler output:
a.cc: In function 'long long int f(long long int, long long int)':
a.cc:15:6: error: 'bb' was not declared in this scope; did you mean 'b'?
   15 |   if(bb%aa!=0)
      |      ^~
      |      b
a.cc:15:9: error: 'aa' was not declared in this scope; did you mean 'a'?
   15 |   if(bb%aa!=0)
      |         ^~
      |         a
a.cc:17:12: error: 'aa' was not declared in this scope; did you mean 'a'?
   17 |   return 2*aa+f(aa,bb-aa);
      |            ^~
      |            a
a.cc:17:20: error: 'bb' was not declared in this scope; did you mean 'b'?
   17 |   return 2*aa+f(aa,bb-aa);
      |                    ^~
      |                    b
Language: C++

/****Author: Barish Namazov****/
#include <bits/stdc++.h>

using namespace std;

/***TEMPLATE***/
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()

#define F first
#define S second
#define pb push_back

#define endl '\n'

const int max4 = 10004;
const int maxx = 100005;
const int max6 = 1000006;
const int lg5 = 17;

const int INF = 2 * 1000000007;
const long long INFLL = 4LL * 1000000000 * 1000000000;

/***************/

int powmod (int a, int b, int mod) {
    int res = 1; a %= mod;
    for (; b; b >>= 1) {
        if (b & 1) {
            res = 1LL * res * a % mod;
        }
        a = 1LL * a * a % mod;
    }
    return res;
}

int gcd (int a, int b) {
    while (b > 0) {
        int t = a % b;
        a = b, b = t;
    }
    return a;
}

int lcm (int a, int b) {
    return (a / gcd (a, b)) * b;
}

int is_prime (int n) {
    if (n <= 1 || n > 3 && (n % 2 == 0 || n % 3 == 0))
        return 0;
    for (int i = 5, t = 2; i * i <= n; i += t, t = 6 - t)
        if (n % i == 0)
            return 0;
    return 1;
}

/******Don't forget to use long long when needed!!******/

int main() {
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    ios_base :: sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    long long n, k;
    cin >> n >> k;
    cout << 2 * (n - 1) + 2 * x << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:67:31: error: 'x' was not declared in this scope
   67 |     cout << 2 * (n - 1) + 2 * x << endl;
      |                               ^
Language: C++

#include <bits/stdc++.h>

using namespace std ;

int main()
{
    long long n , x ;
    cin>>n>>x ;
    return cout<<3ll * (n - __gcd(n , x) , 0 ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:45: error: expected ')' before ';' token
    9 |     return cout<<3ll * (n - __gcd(n , x) , 0 ;
      |                        ~                    ^~
      |                                             )
a.cc:9:16: error: cannot convert 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'int' in return
    9 |     return cout<<3ll * (n - __gcd(n , x) , 0 ;
      |            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                |
      |                std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define LINE 8
#define st 1
#define YOKO 17
int main(){
    long long N,X;
    cin>>N>>x;
        if(X==N/2){
            cout<<3*X;
        }else if(X>=N/2){
            cout<<3/2*X+N;
        }else{
            cout<<(X+N)*X/(N-X)+N;
        }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'x' was not declared in this scope
    8 |     cin>>N>>x;
      |             ^
Language: C++

#include <iostream>

using namespace std;
using llong = long long;

llong length(llong K,llong X,llong L){
  return (K==X)?(K:((K<X)?length(K,X-K,L+2*K):length(K-X,X,L+2*X)));
  // if( K == X ){
  //   return K;
  // }else if( K < X ){
  //   return 2*K + length( K , X - K );
  // }else{
  //   return 2*X + length( K - X , X );
  // }
}

int main(){
  llong N , X;
  cin >> N >> X;
  cout << N + length( N - X , X ) << endl;
}

Compiler output:
a.cc: In function 'llong length(llong, llong, llong)':
a.cc:7:19: error: expected ')' before ':' token
    7 |   return (K==X)?(K:((K<X)?length(K,X-K,L+2*K):length(K-X,X,L+2*X)));
      |                 ~ ^
      |                   )
a.cc:7:68: error: expected ':' before ';' token
    7 |   return (K==X)?(K:((K<X)?length(K,X-K,L+2*K):length(K-X,X,L+2*X)));
      |                                                                    ^
      |                                                                    :
a.cc:7:68: error: expected primary-expression before ';' token
a.cc: In function 'int main()':
a.cc:20:21: error: too few arguments to function 'llong length(llong, llong, llong)'
   20 |   cout << N + length( N - X , X ) << endl;
      |               ~~~~~~^~~~~~~~~~~~~
a.cc:6:7: note: declared here
    6 | llong length(llong K,llong X,llong L){
      |       ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n,x;
    cin>>n>>x;
    
        long long t=x,sum=n;
        x=min(t,n-t);
        long long y=max(t,n-t);
        while(x>=1)
        {
            if(y%x==0)
            {
                sum+=(y/x)*2*x;
                sum-=x;
                break;
            }
            else{             
               sum+=(y/x)*2*x;
               LL te=x;
               x=y%x;
               y=te;
            }
        }
        cout<<sum<<endl;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:16: error: 'LL' was not declared in this scope
   21 |                LL te=x;
      |                ^~
a.cc:23:18: error: 'te' was not declared in this scope; did you mean 't'?
   23 |                y=te;
      |                  ^~
      |                  t
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
long long n, x;
cin>>x>>y;
long long ans=4*x+4*(n-2*x);
cout<<-1*ans<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'y' was not declared in this scope
    5 | cin>>x>>y;
      |         ^
Language: C++

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

lint N, X;

int main()
{
    cin >> N >> X;
    lint gcd = __gcd(N, X);
    cout << gcd * (N / gcd - 1) * 3 << endl;
}


Compiler output:
a.cc:4:1: error: 'lint' does not name a type; did you mean 'uint'?
    4 | lint N, X;
      | ^~~~
      | uint
a.cc: In function 'int main()':
a.cc:8:12: error: 'N' was not declared in this scope
    8 |     cin >> N >> X;
      |            ^
a.cc:8:17: error: 'X' was not declared in this scope
    8 |     cin >> N >> X;
      |                 ^
a.cc:9:5: error: 'lint' was not declared in this scope; did you mean 'uint'?
    9 |     lint gcd = __gcd(N, X);
      |     ^~~~
      |     uint
Language: C++


#include <stdio.h>

int main()
{
    int N, X;
    scanf("%d", &N);
    scanf("%d", &X);
    
    if(N % 2 == 0) {
        //even
        int n = N / 2;
        printf("%d", 3 * n + abs(X - n) * 3);
    } else {
        //odd;
        int n = N / 2;
        printf("%d", n * 6);
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:30: error: 'abs' was not declared in this scope
   13 |         printf("%d", 3 * n + abs(X - n) * 3);
      |                              ^~~
Language: C

#include<stdio.h>

int gcd(int n, int x){
    int z=1;
    for(int i=1;i<x+1;i++){
        if(((n%i)==0)&&((x%i)==0)) z=i;
        return z;
}
int main(void){
    int n, x;
    scanf("%d%d", &n, &x);                   //三角形の辺の長さと始点の入力
    int leng;
    leng = 3*(n-gcd(n, x));
    printf("%d\n", leng);
    return 0;
}


Compiler output:
main.c: In function 'gcd':
main.c:16:1: error: expected declaration or statement at end of input
   16 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
int n, x, t;
int32_t main(){
    scanf("%lld %lld", &n, &x);
    t = 3*(n-1);
    if(t&1) return !printf(t);
    printf("%lld", t-3*(min(x, n-x)-1));
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:8:28: error: invalid conversion from 'long long int' to 'const char*' [-fpermissive]
    8 |     if(t&1) return !printf(t);
      |                            ^
      |                            |
      |                            long long int
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int a[100],b=0;
    cin>>a[0]>>a[1];
    int i=1
    for(;;i++){
        a[i+1]=a[i-1]%a[i];
        if(a[i]<a[i+1])swap(a[i],a[i+1]);
        if(a[i+1]==0) break;
    }
    for(int j=1;j<i;j+=2) b+=a[j];
    cout<<b<<endl;
    return 0;
}
        

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: expected ',' or ';' before 'for'
    7 |     for(;;i++){
      |     ^~~
a.cc:7:14: error: expected ';' before ')' token
    7 |     for(;;i++){
      |              ^
      |              ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,x;
inline ll gcd(ll a,ll b)
{
    return b==0?a:gcd(b,a%b);
}
int main()
{
    cin>>n>>x;
    cout<<3*(n-gcd(n,x));
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,x;
inline ll gcd(ll a,ll b)
{
    return b==0?a:gcd(b,a%b);
}
int main()
{
    cin>>n>>x;
    cout<<3*(n-gcd(n,x));
    return 0;
}

Compiler output:
a.cc:18:4: error: redefinition of 'll n'
   18 | ll n,x;
      |    ^
a.cc:4:4: note: 'll n' previously declared here
    4 | ll n,x;
      |    ^
a.cc:18:6: error: redefinition of 'll x'
   18 | ll n,x;
      |      ^
a.cc:4:6: note: 'll x' previously declared here
    4 | ll n,x;
      |      ^
a.cc:19:11: error: redefinition of 'll gcd(ll, ll)'
   19 | inline ll gcd(ll a,ll b)
      |           ^~~
a.cc:5:11: note: 'll gcd(ll, ll)' previously defined here
    5 | inline ll gcd(ll a,ll b)
      |           ^~~
a.cc:23:5: error: redefinition of 'int main()'
   23 | int main()
      |     ^~~~
a.cc:9:5: note: 'int main()' previously defined here
    9 | int main()
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,x;
inline ll gcd(ll a,ll b)
{
    return b==0?a:gcd(b,a%b);
}
int main()
{
    cin>>n>>x;
    cout<<3*(n-gcd(n,x));
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,x;
inline ll gcd(ll a,ll b)
{
    return b==0?a:gcd(b,a%b);
}
int main()
{
    cin>>n>>x;
    cout<<3*(n-gcd(n,x));
    return 0;
}
Submission

Compiler output:
a.cc:18:4: error: redefinition of 'll n'
   18 | ll n,x;
      |    ^
a.cc:4:4: note: 'll n' previously declared here
    4 | ll n,x;
      |    ^
a.cc:18:6: error: redefinition of 'll x'
   18 | ll n,x;
      |      ^
a.cc:4:6: note: 'll x' previously declared here
    4 | ll n,x;
      |      ^
a.cc:19:11: error: redefinition of 'll gcd(ll, ll)'
   19 | inline ll gcd(ll a,ll b)
      |           ^~~
a.cc:5:11: note: 'll gcd(ll, ll)' previously defined here
    5 | inline ll gcd(ll a,ll b)
      |           ^~~
a.cc:23:5: error: redefinition of 'int main()'
   23 | int main()
      |     ^~~~
a.cc:9:5: note: 'int main()' previously defined here
    9 | int main()
      |     ^~~~
a.cc:29:1: error: 'Submission' does not name a type
   29 | Submission
      | ^~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;
int gcd(LLI a,LLI b){
    if(a==0||b==0) return a+b;
    else if(a>=b) return gcd(a%b,b);
    else return gcd(a,b%a);
}
int main(){
    LLI n,x; cin>>n>>x;
    cout<<3*(n-gcd(n,x));
}


Compiler output:
a.cc:3:9: error: 'LLI' was not declared in this scope
    3 | int gcd(LLI a,LLI b){
      |         ^~~
a.cc:3:15: error: 'LLI' was not declared in this scope
    3 | int gcd(LLI a,LLI b){
      |               ^~~
a.cc:3:20: error: expression list treated as compound expression in initializer [-fpermissive]
    3 | int gcd(LLI a,LLI b){
      |                    ^
a.cc: In function 'int main()':
a.cc:9:5: error: 'LLI' was not declared in this scope
    9 |     LLI n,x; cin>>n>>x;
      |     ^~~
a.cc:9:19: error: 'n' was not declared in this scope
    9 |     LLI n,x; cin>>n>>x;
      |                   ^
a.cc:9:22: error: 'x' was not declared in this scope
    9 |     LLI n,x; cin>>n>>x;
      |                      ^
a.cc:10:19: error: 'gcd' cannot be used as a function
   10 |     cout<<3*(n-gcd(n,x));
      |                ~~~^~~~~
Language: C++

#include<stdio.h>
#include<algorithm>

long n,m,a;

main(){
    scanf("%ld%ld",&n,&m);
    a=3*(n-std::__gcd(n,m);
    printf("%ld",a);
}


Compiler output:
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:27: error: expected ')' before ';' token
    8 |     a=3*(n-std::__gcd(n,m);
      |         ~                 ^
      |                           )
Language: C++

#include<bits/stdc++.h>
long n,m;main(){std::cin>>n>>m;std::cout<<3*(n-__gcd(n,m));}

Compiler output:
a.cc:2:10: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | long n,m;main(){std::cin>>n>>m;std::cout<<3*(n-__gcd(n,m));}
      |          ^~~~
a.cc: In function 'int main()':
a.cc:2:48: error: '__gcd' was not declared in this scope
    2 | long n,m;main(){std::cin>>n>>m;std::cout<<3*(n-__gcd(n,m));}
      |                                                ^~~~~
a.cc:2:48: note: suggested alternatives:
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:1137:5: note:   'std::__gcd'
 1137 |     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
      |     ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58:
/usr/include/c++/14/numeric:134:5: note:   'std::__detail::__gcd'
  134 |     __gcd(_Tp __m, _Tp __n)
      |     ^~~~~
Language: C++

#include <iostream>
#include <bits/stdc++.h>

using namespace std;

long long n = 0, length = 0;

void Go_Ray(long long rayActual, long long rayPasado)
{
    if (rayActual == rayPasado)
    {
      length += rayActual;
      return;
    }
    if (rayPasado < rayActual)
    {
        length += (2 * rayPasado);
        Go_Ray(rayPasado, rayActual - rayPasado);
    }
    else
    {
        length += (2 * rayActual);
        Go_Ray(rayActual, rayPasado - rayActual);
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    long long x;
    cin >> n >> x;
    length = n;
    Go_Ray(n - x,x);
    cout << length << endl;
    return 0;


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

#include<bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = (a), i##_end_ = (b); i <= i##_end_; ++i)
#define clear(a, b) memset((a), (b), sizeof(a))
typedef long long LL;
LL n, x;
LL f(LL a, LL b) {
	if(a > b) swap(a, b);
	if(a == 1) return b * 2 - 1;
	return 1ll * f(b - a, a) + 2 * a;
}
LL ans;
int main(){
	scanf("%lld %lld", &n, &x);
	ans = n + f(x, n - x)
	printf("%lld\n", ans);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:30: error: expected ';' before 'printf'
   15 |         ans = n + f(x, n - x)
      |                              ^
      |                              ;
   16 |         printf("%lld\n", ans);
      |         ~~~~~~
Language: C++

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

using i64 = long long;

int main() {
#ifdef HOME
	freopen("agc1b.in", "r", stdin);
	freopen("agc1b.out", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	i64 sum(0);
	int a, b;

	cin >> a >> b;
	a = a - b;

	sum = a + b;
	while (a && b) {
		if (a > b)
			sum+= a / b * b * 2, a%= b;
		else
			sum+= b / a * a * l, b%= a; }

	cout << sum - a - b << endl;

	return 0; }


Compiler output:
a.cc: In function 'int main()':
a.cc:24:43: error: 'l' was not declared in this scope
   24 |                         sum+= b / a * a * l, b%= a; }
      |                                           ^
Language: C++

#include "bits/stdc++.h"
#define int long long
#define range(i, a, b) for(int i = a; i < b; i++)
#define rep(i, a) range(i, 0, a)
#define all(a) (a).begin(),(a).end()
using namespace std;
const int MOD = 1e9 + 7, INF = 1e9;
using vi = vector <int>;
using vvi = vector <vi>;
//g++ -std==c++14

signed main(){
	int n, x;
	cin >> n >> x;


	if(n == 2 * x)
		cout << 3 * x << endl;
	else if(n % x != 0 && (n % 2 == 1 || x % 2 == 1))
		cout << n + n - 1 + n - 2 << endl;
	else{
		int amari = n % x;
		int va = n - amari;
		cout << 3 * va - 3 * amari << endl;


}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:2: error: expected '}' at end of input
   27 | }
      |  ^
a.cc:12:14: note: to match this '{'
   12 | signed main(){
      |              ^
Language: C++

#include "bits/stdc++.h"
#define int long long
#define range(i, a, b) for(int i = a; i < b; i++)
#define rep(i, a) range(i, 0, a)
#define all(a) (a).begin(),(a).end()
using namespace std;
const int MOD = 1e9 + 7, INF = 1e9;
using vi = vector <int>;
using vvi = vector <vi>;
//g++ -std==c++14

signed main(){
	int n, x;
	cin >> n >> x;


	if(n == 2 * x)
		cout << 3 * x << endl;
	else if(n % 3 != 0 && (n % 2 == 1 || x % 2 == 1))
		cout << n + n - 1 + n - 2 << endl;
	else{
		int amari = n % x;
		int va = n - amari;
		cout << 3 * va - 3 * amari << endl;


}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:2: error: expected '}' at end of input
   27 | }
      |  ^
a.cc:12:14: note: to match this '{'
   12 | signed main(){
      |              ^
Language: C++

#include <iostream>
using namespace std;
int main(){
	int n,x,s=0;
	cin >>n;
	cin >>x;

	while(x!=0){
		s+=x;
		if( x>n-x)
		{
			int a=x;
			x=t-x;
			t=a;
		}
		else
		{
			x=t-x;
		}
		cout <<s;

	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:27: error: 't' was not declared in this scope
   13 |                         x=t-x;
      |                           ^
a.cc:18:27: error: 't' was not declared in this scope
   18 |                         x=t-x;
      |                           ^
Language: C++

#include <iostream>
using namesspace std;
int main(){
	int n,x,s=0;
	cin >>n;
	cin >>x;

	while(x!=0){
		s+=x;
		if( x>n-x)
		{
			int a=x;
			x=t-x;
			t=a;
		}
		else
		{
			x=t-x;
		}
		cout <<s;
		
	}
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namesspace'
    2 | using namesspace std;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |         cin >>n;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:13:27: error: 't' was not declared in this scope
   13 |                         x=t-x;
      |                           ^
a.cc:18:27: error: 't' was not declared in this scope
   18 |                         x=t-x;
      |                           ^
a.cc:20:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |                 cout <<s;
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <bits/stdc++.h>

long long n, x;

int main() {
  scanf("%lld%lld", &n, &x);
  printf("%lld\n", 3 * (n - __gcd(n, x)));
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:29: error: '__gcd' was not declared in this scope
    7 |   printf("%lld\n", 3 * (n - __gcd(n, x)));
      |                             ^~~~~
a.cc:7:29: note: suggested alternatives:
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:1137:5: note:   'std::__gcd'
 1137 |     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
      |     ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58:
/usr/include/c++/14/numeric:134:5: note:   'std::__detail::__gcd'
  134 |     __gcd(_Tp __m, _Tp __n)
      |     ^~~~~
Language: C++

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

signed main(){
int a,b;cin>>a>>b;
cout<<3*(a-_gcd(a,b))<<endl;	
	}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: '_gcd' was not declared in this scope
    7 | cout<<3*(a-_gcd(a,b))<<endl;
      |            ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define int long long

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

int calc(int a, int b)
{
    if (a < b) swap(a, b);

    if (a == b) return a;

    return 2 * b + calc(b, a - b);
}

int main()
{
    int N, X; cin >> N >> X;

    cout << N + calc(X, N - X) << endl;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <queue>
#include "math.h"
#include <complex>
#include <iomanip>
#define ifor(i,a,b) for (int i=(a);i<(b);i++)
#define rfor(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define rep(i,n) for (int i=0;i<(n);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
using namespace std;
typedef long double ld;
typedef long long int  lli;
typedef complex <double> P;
const double eps = 1e-11;
int vex[4]={1,0,-1,0};
int vey[4]={0,1,0,-1};
int gcd(int a,int b){
	if(a%b == 0)return b;
	return gcd(b,a%b);
}
int main(){
	int N ,X;
	cin >> N >> X;
	cout << 3(N-gcd(N,X))<<endl;
return 0 ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:18: error: expression cannot be used as a function
   28 |         cout << 3(N-gcd(N,X))<<endl;
      |                 ~^~~~~~~~~~~~
Language: C++

#include<stdio.h>
int main(){
 long long n, k;
 scanf("%lld %lld", &n, &k);
long long r=n%k;
long long res=n;
while(r>0){
 res+=(n/k-1)*k
n=k;k=r;r=n%k;
} 
 res+=(k-1)*2+1;
printf("%lld", res);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: expected ';' before 'n'
    8 |  res+=(n/k-1)*k
      |                ^
      |                ;
    9 | n=k;k=r;r=n%k;
      | ~
Language: C++

#define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996)
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <sstream>
#include <cmath>
using namespace std; 

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()

typedef pair<int, int> Pii;
typedef vector<int> V;
typedef long long ll;
const int inf = 1e9;
const int mod = 1e9 + 7;

ll gcd(ll a, ll b) {
	if(a%b==0) return b;
	return gcd(b,a%b);
}

int main()
{
	ll N, X;
	cin >> N >> X;

	cout << 3*(N - gcd(N,X)) << endl;

	retur

Compiler output:
a.cc: In function 'int main()':
a.cc:34:9: error: 'retur' was not declared in this scope
   34 |         retur
      |         ^~~~~
a.cc:34:14: error: expected '}' at end of input
   34 |         retur
      |              ^
a.cc:28:1: note: to match this '{'
   28 | {
      | ^
Language: C

#include<stdio.h>
int main()
{
    long N, X;
    scanf("%ld %ld", &N, &X);
    long L = X > N - X ? X : N - X;
    long S = N - L;
    printf("%ld\n",(N + f(L, S)));
    return 0;
}
long f(long L, long S) {
    if (S == 0) return -L;
    return 2 * S * (L / S) + f(S, L % S);
}

Compiler output:
main.c: In function 'main':
main.c:8:25: error: implicit declaration of function 'f' [-Wimplicit-function-declaration]
    8 |     printf("%ld\n",(N + f(L, S)));
      |                         ^
main.c: At top level:
main.c:11:6: error: conflicting types for 'f'; have 'long int(long int,  long int)'
   11 | long f(long L, long S) {
      |      ^
main.c:8:25: note: previous implicit declaration of 'f' with type 'int()'
    8 |     printf("%ld\n",(N + f(L, S)));
      |                         ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <numeric>
#include <functional>
#include <set>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include <climits>
#include <fstream>
#include <bitset>
#include <time.h>

#define ll long long
#define VL vector<ll>
#define VI vector<int>
#define FOR(i,b) for(int i= 0; i<((int)b); ++i)
#define FOR_(i,a,b) for(int i= a; i<((int)b); ++i)
#define RFOR(i,a) for(int i=(a); i >= 0; --i)
#define FOE(i,a) for(auto i : a)
#define ALL(c) (c).begin(), (c).end()
#define RALL(c) (c).rbegin(), (c).rend()
#define COUT(x) cout << x << endl;
#define DUMP(x)  cerr << #x << " = " << (x) << endl;
#define SUM(x) std::accumulate(ALL(x), 0LL)
#define EPS 1e-14
#define DIM2(R,C,arr) vector<vector<int>> arr(R);FOR(i,R) (arr)[i].resize(C);
#define DIM2INIT(R,C,arr) FOR(i,R)FOR(j,C)arr[i][j]=0;
#define MAPGEN(R,C,visited,map) char map[R][C]; FOR(i,R){string s;cin>>s;FOR(j,C){visited[i][j]=0;map[i][j]=s[j];}}
#define Point pair<int,int>
#define POINT(x,y,arr) arr[y][x]
#define SORT(a)  sort(a.begin(),a.end());
using namespace std;

ll gcd(ll a, ll b){
    if ( a==0 ) return b;
    return gcd ( b%a, a );
}


int main() {
    //*** ---------------------------------------------------------------------------*//
    //
    //                            Variables and Initialize
    //
    //*----------------------------------------------------------------------------- *//
    
    ll N,X;
    cin >> N >> X; 
    ll ans = 3*(N-gcd(N,X));
    COUT(ans);

    return 0;
}

Compiler output:
a.cc:57:19: error: extended character   is not valid in an identifier
   57 |     cin >> N >> X; 
      |                   ^
a.cc: In function 'int main()':
a.cc:57:19: error: '\U00002028' was not declared in this scope
   57 |     cin >> N >> X; 
      |                   ^
a.cc:59:10: error: 'ans' was not declared in this scope; did you mean 'abs'?
   59 |     COUT(ans);
      |          ^~~
a.cc:31:25: note: in definition of macro 'COUT'
   31 | #define COUT(x) cout << x << endl;
      |                         ^
Language: Java

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.HashMap;

public class New4 {
    public static void main(String[] args) throws Exception {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
        long[] a = la(in.readLine(), 2);
        long N=a[0], X=a[1];
        long sum=N;
        int flag=0;
        while (flag==0) {
            long k=(N-X)/X;
            if ((N-X)%X==0) {
                sum+=((2*k+1)*X);
                flag=1;
            }
            else {
                sum+=(2*k*X);
                long temp=X;
                X = (N-X)%X;
                N=temp;
            }
        }
        out.write(sum+"\n");
        out.flush();
    }
    
    private static int ip (String s) {
        int n = Integer.parseInt(s);
        return n;
    }
    
    private static long lp (String s) {
        long n = Long.parseLong(s);
        return n;
    }
    
    private static double dp (String s) {
        double n = Double.parseDouble(s);
        return n;
    }
    
    private static int[] ia (String s, int n) {
        String[] s1 = s.split(" ");
        int[] A = new int[n];
        for (int i=0; i<n; i++) {
            A[i] = Integer.parseInt(s1[i]);
        }
        return A;
    }
    
    private static long[] la (String s, int n) {
        String[] s1 = s.split(" ");
        long[] A = new long[n];
        for (int i=0; i<n; i++) {
            A[i] = Long.parseLong(s1[i]);
        }
        return A;
    }
    
    private static double[] da (String s, int n) {
        String[] s1 = s.split(" ");
        double[] A = new double[n];
        for (int i=0; i<n; i++) {
            A[i] = Double.parseDouble(s1[i]);
        }
        return A;
    }

}

Compiler output:
Main.java:7: error: class New4 is public, should be declared in a file named New4.java
public class New4 {
       ^
1 error