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

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


int main(int argc, const char * argv[]) {
    int a = 0;
    int b = 0;
    bool flag = false;
    cin >> a >> b;

    
    for(int i = 1; i <= 1000; i++){
        int atax = i * 8 / 100;
        int btax = i * 0.1f;

        if(atax == a && btax == b){
            cout << i << endl;
            flag = true;
            break;
        }
    }

    if(!flag)cout << -1 << endl;

    return 0;
}





Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:10:5: error: 'cin' was not declared in this scope
   10 |     cin >> a >> b;
      |     ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <cmath>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:18:13: error: 'cout' was not declared in this scope
   18 |             cout << i << endl;
      |             ^~~~
a.cc:18:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:26: error: 'endl' was not declared in this scope
   18 |             cout << i << endl;
      |                          ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <cmath>
  +++ |+#include <ostream>
    3 | using namespace std;
a.cc:24:14: error: 'cout' was not declared in this scope
   24 |     if(!flag)cout << -1 << endl;
      |              ^~~~
a.cc:24:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:24:28: error: 'endl' was not declared in this scope
   24 |     if(!flag)cout << -1 << endl;
      |                            ^~~~
a.cc:24:28: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C

main(){int a,b;scanf("%d%d",&a,&b);printf("%d\n",a*5<b*4?b*10:(a*25+1)/2;}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(){int a,b;scanf("%d%d",&a,&b);printf("%d\n",a*5<b*4?b*10:(a*25+1)/2;}
      | ^~~~
main.c: In function 'main':
main.c:1:16: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | main(){int a,b;scanf("%d%d",&a,&b);printf("%d\n",a*5<b*4?b*10:(a*25+1)/2;}
      |                ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | main(){int a,b;scanf("%d%d",&a,&b);printf("%d\n",a*5<b*4?b*10:(a*25+1)/2;}
main.c:1:16: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | main(){int a,b;scanf("%d%d",&a,&b);printf("%d\n",a*5<b*4?b*10:(a*25+1)/2;}
      |                ^~~~~
main.c:1:16: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:36: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | main(){int a,b;scanf("%d%d",&a,&b);printf("%d\n",a*5<b*4?b*10:(a*25+1)/2;}
      |                                    ^~~~~~
main.c:1:36: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:36: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:36: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:73: error: expected ')' before ';' token
    1 | main(){int a,b;scanf("%d%d",&a,&b);printf("%d\n",a*5<b*4?b*10:(a*25+1)/2;}
      |                                          ~                              ^
      |                                                                         )
main.c:1:74: error: expected ';' before '}' token
    1 | main(){int a,b;scanf("%d%d",&a,&b);printf("%d\n",a*5<b*4?b*10:(a*25+1)/2;}
      |                                                                          ^
      |                                                                          ;
Language: Java

import java.util.Scanner;

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

    public static void main(String[] args) {
        int a = sc.nextInt();
        int b = sc.nextInt();
        
        double ad = (double)a;
        double bd = (double)b;
        
        if (Math.floor(ad/0.08) == Math.floor(bd /0.1)){
            if (ad/0.08<25){
                System.out.println("25");
            }else {
                System.out.println(ad/0.08);
            }
        }else {
            System.out.println("-1");
        }
    }

Compiler output:
Main.java:22: error: reached end of file while parsing
    }
     ^
1 error
Language: C++

#include<bits/stdc++.h>
#define INF 1073741824
#define ll long long
#define PI (2*acos(0.0))
#define Hare printf("here\n")
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define x first
#define y second
#define on(val,pos) val|(1<<pos)
#define off(val,pos) val&(~(1<<pos))
#define check(val,pos) (val&(1<<pos))

//first four adjacent,second four corner
//int row[8]={0,-1,0,1,1,-1,-1,1};
//int col[8]={-1,0,1,0,-1,-1,1,1};
using namespace std;

int main(){
    int i,j,k,n,m,val,t=0,cnt,test;
    //freopen("000input.txt","r",stdin);
	cin>>k>>m;
  	int ans = min(k/0.08,m/0.1);
  	int p=ans*0.08,q=ans*0.1;
  int cnt=1000;
  while(p!=q and cnt<1000){
  	ans++;
    p=ans*0.08;
    q=ans*0.1;
    cnt++;
  }
  if(cnt<1000)cout<<ans<<endl;
  else cout<<-1<<endl;
    //free();   //if pointer array
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:7: error: redeclaration of 'int cnt'
   27 |   int cnt=1000;
      |       ^~~
a.cc:22:27: note: 'int cnt' previously declared here
   22 |     int i,j,k,n,m,val,t=0,cnt,test;
      |                           ^~~
Language: C++

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

int main(){
    int a,b; cin >> a >> b;
    rep(i,1000){
        int ii=i+1;
        if((int)(ii*0.08)==a && (int)(ii*0.1)==b){
            cout << ii << endl;
            break;
        }
        if(ii==ma) cout << -1 << endl;
    }
    /*bool j=true;
    if(25*0.1==b) j=false;
    cout << (int)(25*0.1) << endl;
    */
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:16: error: 'ma' was not declared in this scope; did you mean 'a'?
   17 |         if(ii==ma) cout << -1 << endl;
      |                ^~
      |                a
Language: C++

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


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

/* vector<int> A(N); 
    vector<pair<int, int> > tasks; ＃ソートした場合、１つ目でソート
　tie(b, a) = p.at(i); #pairを分割
    tasks.emplace_back(b, a)  ＃配列tasksの最後に(b,a)を追加
　xの二乗:  pow(x, 2.0) 
    小さい順: sort(v.begin(), v.end());
    大きい順: reverse(v.begin(), v.end());
    int: -2,147,483,648 ～ 2,147,483,647
    ll: -9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807
    // int型の2次元配列(3×4要素の)の宣言
    vector<vector<int>> data(3, vector<int>(4));
*/
 
int main() {
  
  int A, B, C, count=0, ans=-1;
  cin >> A >> B;
  rep(i,10000){
  	if(i*0.08=A||i*0.10=B) ans=i;
  }
  
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:20: error: lvalue required as left operand of assignment
   26 |         if(i*0.08=A||i*0.10=B) ans=i;
      |                   ~^~~~~~~~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
using namespace std;
int main() {
   int a, b;
	cin >> a >> b;
	for(int i = 0; i < 100; ++i) {
		if(floor(i * 0.08) == a && floor(i * 0.1) == b) {
			cout << i << endl;
			return 0;
		}
	}
	cout << -1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: 'floor' was not declared in this scope
   11 |                 if(floor(i * 0.08) == a && floor(i * 0.1) == b) {
      |                    ^~~~~
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int a=sc.nextInt();
    int b=sc.nextInt();
    int c=-1;
    boolean flg=false;
    for(double i=0.0;i<1000;i++){
      if(i*0.08==a && i*0.1==b){
        c=i;
      }
    }
    System.out.println(c);
  }
}

Compiler output:
Main.java:13: error: incompatible types: possible lossy conversion from double to int
        c=i;
          ^
1 error
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);


int g[15][15];
const int INF = 1001001001;
const int dx[4] = { -1,0,1,0 };
const int dy[4] = { 0,-1,0,1 };

//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

//素因数分解
vector<pair<ll, int>>factorize(ll n) {
	vector<pair<ll, int>>res;
	for (ll i = 2;i * i <= n;++i) {
		if (n % i)continue;
		res.emplace_back(i, 0);
		while (n % i == 0) {
			n /= i;
			res.back().second++;
		}
	}
	if (n != 1)res.emplace_back(n, 1);
	return res;
}

int dp[1010][1010];
int bingo[3][3];
bool flag[3][3];

ll n;
ll ans = 0;

void dfs(ll x, int a, int b, int c) {
	if (x > n)return;
	if (a && b && c)ans++;
	dfs(10 * x + 3, 1, b, c);
	dfs(10 * x + 5, a, 1, c);
	dfs(10 * x + 7, a, b, 1);
}

int main() {
	int a, b;
	cin >> a >> b:
	int loop = 20 * b;
	int ans = -1;
	for (int i = 1;i <= loop;++i) {
		if (i * 0.08 == a && i * 0.1 == b) {
			ans = i;
			break;
		}
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:55:22: error: expected ';' before ':' token
   55 |         cin >> a >> b:
      |                      ^
      |                      ;
a.cc:58:29: error: 'loop' was not declared in this scope
   58 |         for (int i = 1;i <= loop;++i) {
      |                             ^~~~
Language: C++

#include <iostream>
#include <string>
#include <stdint.h>
#include <algorithm>

int main()
{
	int A, B;

	std::cin >> A >> B;

	float la, ma;
	la = A / 0.08f;
	ma = (A + 1) / 0.08f;

	float lb, mb;
	lb = B / 0.10f;
	mb = (B + 1) / 0.10f;

	if (la >= lb && la < mb)
	{
		std::cout << std::ceil(la) << std::endl;
	}
	else if (lb >= la && lb < ma)
	{
		std::cout << std::ceil(lb) << std::endl;
	}
	else
	{
		std::cout << -1 << std::endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:35: error: 'ceil' is not a member of 'std'
   22 |                 std::cout << std::ceil(la) << std::endl;
      |                                   ^~~~
a.cc:26:35: error: 'ceil' is not a member of 'std'
   26 |                 std::cout << std::ceil(lb) << std::endl;
      |                                   ^~~~
Language: C++

//    Unmesh Kumar
//    CSE'22 IIT Roorkee

#include <iostream>
#include <bits/stdc++.h>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <map>
#include <iterator>
#include <iomanip>
#include <queue>
#include <utility>
#include <set>

using namespace std;
#define ll long long int
#define c(x) ll x;cin>>x
#define cc(x,y) ll x,y;cin>>x>>y
#define ccc(x,y,z) ll x,y,z; cin>>x>>y>>z
#define db long double
#define fast cin.tie(NULL); cout.tie(NULL); ios_base::sync_with_stdio(false)
#define inf 200000000000000
#define mod 1000000007
#define eps 1e-7
#define PI 3.1415926535897932385
#define pb push_back
#define bitc  __builtin_popcountll
#define mp make_pair
#define ff first
#define ss second
#define all(ar) ar.begin(), ar.end()
#define len(x) (ll)(x).size()
#define fr(i,a,b) for (ll i = (a), _b = (b); i <= _b; i++)
#define rep(i,n) for (ll i = 0, _n = (n); i < _n; i++)
#define repr(i,n) for (ll i = n - 1; i >= 0; i--)
#define frr(i,a,b) for (ll i = (a), _b = (b); i >= _b; i--)
#define foreach(it,ar) for (auto it = ar.begin(); it != ar.end(); it++)
#define fill(ar,val) memset(ar, val, sizeof(ar))
#define print(arr,n) rep(i,n) cout<<arr[i]<<" "; cout<<endl
#define print2(arr,n,m) rep(i,n){ rep(j,m) cout<<arr[i][j]<<" "; cout<<endl; }
#define dyn1(arr,n) ll* arr=new ll[n]; rep(i,n) arr[i]=0;
#define dyn2(arr,n,m) ll** arr=new ll*[(n)]; rep(i,n) arr[i]=new ll[m]; rep(i,n) rep(j,m) arr[i][j]=0
#define carr(arr,n) rep(i,n) cin>>arr[i]
#define carr2(arr,n,m) rep(i,n) rep(j,m) cin>>arr[i][j]
#define debug(a) cout<<" :: "<<#a<<" == "<<a<<endl
#define debug2(a,b) cout<<" :: "<<#a<<" == "<<a<<" :: "<<#b<<" == "<<b<<endl
typedef pair<int,int> ii;
typedef vector<ii> vii;

inline ll maxim(ll a,ll b) {if(a>b) return a; else return b;}
inline ll minim(ll a,ll b) {if(a<b) return a; else return b;}
inline bool equals(double a, double b){ return fabs(a - b) < 1e-9; }
ll gcd(ll a, ll b){ return b==0 ? a : gcd(b, a%b); }


ll binpow(ll a, ll b)
{
    ll res = 1;
    while (b > 0)
    {
        if (b & 1) res = (res * a)%mod;
        a = (a * a)%mod;
        b >>= 1;
    }
    return res;
}

int modInverse(int a, int m)
{
    int m0 = m;
    int y = 0, x = 1;
    if (m == 1)
      return 0;
    while (a > 1)
    {
        int q = a / m;
        int t = m;
        m = a % m, a = t;
        t = y;
        y = x - q * y;
        x = t;
    }
    if (x < 0)
       x += m0;
    return x;
}

bool comp(ll a,ll b)
{
  return a>b;
}

ll arr[1000005];
ll a[1000005];
ll b[1000005];

int main()
{
  fast;
  //freopen("input.txt", "r", stdin);
  //freopen("output.txt", "w", stdout);
  cout<<setprecision(10)<<fixed;
  cc(a,b);
  bool boo =false;
  fr(o,1,10000)
  {
    if((ll)(floor(o*0.08)==a)&&(ll)(floor(o*0.08)==a))
    {
      boo=true;
      cout<<o<<endl;
      break;8 10
    }
  }
  if(!b) cout<<-1<<endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:112:14: error: expected ';' before numeric constant
  112 |       break;8 10
      |              ^~~
      |              ;
Language: C++

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

signed main() {
  int A,B;
  cin >> A >> B;
  int stop = max()

  for(int i=0; i<=10000; i++) {
    if( (int)(i*0.08) == A && (int)(i*0.10) == B) {
      cout << i << endl;
      return 0;
    }
  }
  puts("-1");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: no matching function for call to 'max()'
    8 |   int stop = max()
      |              ~~~^~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/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:   candidate expects 2 arguments, 0 provided
/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, 0 provided
In file included from /usr/include/c++/14/algorithm:61:
/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, 0 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:   candidate expects 2 arguments, 0 provided
a.cc:10:16: error: 'i' was not declared in this scope
   10 |   for(int i=0; i<=10000; i++) {
      |                ^
Language: C++

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

signed main() {
  int A,B;
  cin >> A >> B;
  int stop = max()

  for(int i=0; i<=10000; i++) {
    if( (int)(i*0.08) == A && (int)(i*0.10) == B) {
      cout << i << endl;
      return 0;
    }
  }
  puts("-1");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: no matching function for call to 'max()'
    8 |   int stop = max()
      |              ~~~^~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/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:   candidate expects 2 arguments, 0 provided
/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, 0 provided
In file included from /usr/include/c++/14/algorithm:61:
/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, 0 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:   candidate expects 2 arguments, 0 provided
a.cc:10:16: error: 'i' was not declared in this scope
   10 |   for(int i=0; i<=10000; i++) {
      |                ^
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);		
		int a = sc.nextInt();
        int b = sc.nextInt();
		Long c = "-1";
        for(int i=1;i<=10000;i++){if((i*108)/100==a && (i*110)/100==b){c=i;break;}}
		System.out.println(c);
	}
}


Compiler output:
Main.java:7: error: incompatible types: String cannot be converted to Long
		Long c = "-1";
		         ^
Main.java:8: error: incompatible types: int cannot be converted to Long
        for(int i=1;i<=10000;i++){if((i*108)/100==a && (i*110)/100==b){c=i;break;}}
                                                                         ^
2 errors
Language: C++

++.h>
#define int long long
using namespace std;
constexpr int mod=1e9+7;
signed main(){
    int a,b;
    cin>>a>>b;
    for(int i=0;i<2000;i++)
        if(floor(i*0.08)==a&&floor(i*0.1)==b)
            cout<<i<<endl,exit(0);
    cout<<-1<<endl;
}

Compiler output:
a.cc:1:1: error: expected unqualified-id before '++' token
    1 | ++.h>
      | ^~
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin>>a>>b;
      |     ^~~
a.cc:9:12: error: 'floor' was not declared in this scope
    9 |         if(floor(i*0.08)==a&&floor(i*0.1)==b)
      |            ^~~~~
a.cc:10:13: error: 'cout' was not declared in this scope
   10 |             cout<<i<<endl,exit(0);
      |             ^~~~
a.cc:10:22: error: 'endl' was not declared in this scope
   10 |             cout<<i<<endl,exit(0);
      |                      ^~~~
a.cc:10:27: error: 'exit' was not declared in this scope
   10 |             cout<<i<<endl,exit(0);
      |                           ^~~~
a.cc:1:1: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
  +++ |+#include <cstdlib>
    1 | ++.h>
a.cc:11:5: error: 'cout' was not declared in this scope
   11 |     cout<<-1<<endl;
      |     ^~~~
a.cc:11:15: error: 'endl' was not declared in this scope
   11 |     cout<<-1<<endl;
      |               ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define re(i,n) for(ll i=0;i<n;++i)
#define ocut cout
#define ouct cout
#define itn int
struct Union{
  vector<int> par;
  Union(int a){
  par=vector<int>(a,-1);
  }
  int find(int a){
    if(par[a]<0){
      return a;
    }
    else{
      return par[a]=find(par[a]);
    }
  }
  bool same(int a,int b){
    return (find(a)==find(b));
  }
  int size(int a){
    return -par[find(a)];
  }
  void unite(int a,int b){
    int c=find(a),d=find(b);
    if(c==d)
      return;
    if(size(c)<size(d)){
      swap(c,d);
    }
    par[c]+=par[d];
    par[d]=c;
  }
};
int main(void){
    int a,b;
    cin >> a >> b;
    for(int i=0;i<200000){
      if(i/10==b&&i*2/25==a){
        cout << i;
        return 0;
      }
    }
    cout << -1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:25: error: expected ';' before ')' token
   42 |     for(int i=0;i<200000){
      |                         ^
      |                         ;
Language: C++

#include "stdafx.h"
#include <bits/stdc++.h>
#define f(i,n) for(int i=0;i<n;i++)
#define P pair<int,int>
#define F first
#define S second
#define int long long
#define mod 1000000007
#define all(v) v.begin(), v.end()
using namespace std;
int mypow(int a, int b, int c) {
	if (b == 0)return 1;
	if (b % 2)return mypow(a, b - 1, c)*a%c;
	int z = mypow(a, b / 2, c);
	return z * z%c;
}
signed main() {
	int a, b;
	cin >> a >> b;
	f(i, 10000) {
		if (i * 8 / 100 == a && i / 10 == b) {
			cout << i << endl;
			return 0;
		}
	}
	cout << "-1" << endl;
}

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define INF 1e9+7
#define rep(i,n) for(ll i=0;i<n;i++)
#define pii pair<int,int>
#define pll pair<ll,ll>
const int maxn = 1000000;
ll mod = INF;

string s;
int Q;
int d=0;

int main(){
    
    cin >> s;
    cin >> Q;
    rep(i,Q){
        int q;
        cin >> q;
        if(q==1){
            d=(d+1)%2;
        }else if(q==2){
            int f;
            string t;
            cin >> f>>t;
            if((d+f)%2==0){
                s=s+t;
            }else{
                s=t+s;
            }
        }
    }

    if(d==0){
        cout << s<<endl;
    }else{
        int n=s.size();
        rep(i,n{
            cout << s[n-1-i];
        }
        cout << endl;
    }
    return 0;
}

Compiler output:
a.cc:46:2: error: unterminated argument list invoking macro "rep"
   46 | }
      |  ^
a.cc: In function 'int main()':
a.cc:40:9: error: 'rep' was not declared in this scope
   40 |         rep(i,n{
      |         ^~~
a.cc:40:12: error: expected '}' at end of input
   40 |         rep(i,n{
      |            ^
a.cc:38:10: note: to match this '{'
   38 |     }else{
      |          ^
a.cc:40:12: error: expected '}' at end of input
   40 |         rep(i,n{
      |            ^
a.cc:15:11: note: to match this '{'
   15 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    string s;
    int q;
    cin>>s>>q;
    bool st=0;
    vector<char> v[2];
    while(q--){
        int qt;
        cin>>qt;
        if(qt==1){
            st=!st;
        }
        else{
            int f;
            char c;
            cin>>f>>c;
            --f;
            v[f^st].push_back(c);
        }
    }
    string t;
    for(int i=v.size()-1;i>=0;--i)t+=v[0][i];
    t+=s;
    for(char c:v[1])t+=c;
    if(st)reverse(t.begin(),t.end());
    cout<<t;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: request for member 'size' in 'v', which is of non-class type 'std::vector<char> [2]'
   24 |     for(int i=v.size()-1;i>=0;--i)t+=v[0][i];
      |                 ^~~~
Language: C++

#include<bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; i++)
#define repo(i, n) for(int i=1; i<=n; i++)
#define INF 1001001001
#define INFll 100100100100100
// debug用
#define PrintVec(x) for (auto elementPrintVec: x) { cout << elementPrintVec << " "; } cout << endl;

using namespace std;
using ull = unsigned long long;
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;

int main(){
  string s;
  cin >> s;
  int q;
  cin >> q;
  int rev=0;
  string pre;
  string next;
  rep(i, q){
    int t;
    cin >> t;
    if(t==1){
      rev++;
    } else {
      int f;
      string c;
      cin >> f >> c;
      if((f==1 && rev%2==0) ||(f==2 && rev%2==1)){
        pre=c+pre
      } else {
        next=next+c;
      }
    }
  }
  s=pre+s+next;
  if(rev%2==1){
    reverse(s.begin(), s.end());
  }
  cout << s << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:18: error: expected ';' before '}' token
   33 |         pre=c+pre
      |                  ^
      |                  ;
   34 |       } else {
      |       ~
Language: C++

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

#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define intll int long long
const int INF = 1e9;
const int MOD = 1e9 + 7;

int main() {
  string s ;
  deque <char>  data ;
  int n ;
  cin >> s >> n ;
  rep(i,s.size()) data.push_back(s.at(i)) ;
  int now = 0 ;
  
  rep(i,n){
    int T ;
    cin >> T ;
    if(T == 1) now ++ ;
    else{
      int F ;
      char c ;
      cin >> F >> c ;
      if(F == 1){ 
        if(now%2 == 0) data.push_back (c) ;
        else           data.push_front(c) ;
      }
      else {
        if(now%2 != 1) data.push_back (c) ;
        else           data.push_front(c) ;
    }
  }
    
}
 
  if(now % 2 = 1)   rep(i,data.size()) cout << data.at(i) ;
  else               rep(i,data.size()) cout << data.at(data.size() - i-1) ;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:10: error: lvalue required as left operand of assignment
   38 |   if(now % 2 = 1)   rep(i,data.size()) cout << data.at(i) ;
      |      ~~~~^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
 
int main() {
    list<char> ans;
    string S;
    long long Q;
    bool aux = false;
    cin >> S >> Q;
    rep(long long i = 0; i < S.length(); i++){ 
        ans.push_back(S[i]); 
    }
    rep(long long i = 0; i < Q; i++){
        long long T;
        cin >> T;
        if (T == 1){
            aux = !aux;
        } else{
            long long F;
            char C;
            cin >> F >> C;
            if (F == 1){
                if (!aux) 
                    ans.push_front(C);
                else 
                    ans.push_back(C);
            } else{
                if (!aux)
                    ans.push_back(C);
                else 
                    ans.push_front(C);
            }
        }
    }
    if (aux){
        ans.reverse();
    }
    for (auto i = ans.begin(); i != ans.end(); i++){
        cout << *i;
    }
    cout << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: expected primary-expression before 'long'
   11 |     rep(long long i = 0; i < S.length(); i++){
      |         ^~~~
a.cc:11:26: error: 'i' was not declared in this scope
   11 |     rep(long long i = 0; i < S.length(); i++){
      |                          ^
a.cc:14:9: error: expected primary-expression before 'long'
   14 |     rep(long long i = 0; i < Q; i++){
      |         ^~~~
Language: C

S = input().rstrip()
Q = int(input().rstrip())
for _ in range(Q):
    stdin = input().rstrip()
    if int(stdin[0]) == 1:
        S = S[::-1]
    else:
        T,F,C = stdin.split()
        if int(F) == 1:
            S = C + S
        else:
            S = S + C
print(S)

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | S = input().rstrip()
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'S' [-Wimplicit-int]
main.c:1:5: error: implicit declaration of function 'input' [-Wimplicit-function-declaration]
    1 | S = input().rstrip()
      |     ^~~~~
main.c:1:12: error: request for member 'rstrip' in something not a structure or union
    1 | S = input().rstrip()
      |            ^
main.c:2:1: error: expected ',' or ';' before 'Q'
    2 | Q = int(input().rstrip())
      | ^
Language: C++

// 問題の URL を書いておく
// https://atcoder.jp/contests/abc158/tasks/abc158_d

#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>

using namespace std;

//#define ENABLE_PRINT

#if defined(ENABLE_PRINT)

#define Print(v) \
do {\
    cout << #v << ": " << v << endl; \
}while(0)

#define PrintVec(v) \
do {\
    for(int __i = 0; __i < v.size(); ++__i) \
    { \
        cout << #v << "[" << __i << "]: " << v[__i] << endl; \
    }\
}while(0)

#else

#define Print(v) ((void)0)
#define PrintVec(v) ((void)0)

#endif

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

using ll = int64_t;

const int MaxSLen = 100000 + 1;
const int MaxQueryLen = 2 * 100000 + 1;

char ans[MaxSLen + MaxQueryLen * 2 + 2] = {};

int main(int, const char**)
{
    string s;
    cin >> s;
    int head = MaxQueryLen;
    int tail = head + s.size();
    memcpy(&ans[head], s.c_str(), s.size());
    int q;
    cin >> q;
    int mode = 0;
    rep(i, q)
    {
        int m;
        cin >> m;
        if(m == 1)
        {
            mode = (mode + 1) % 2;
        }
        else
        {
            int f;
            char c;
            cin >> f >> c;
            if((mode == 0 && f == 1) || (mode == 1 && f == 2))
            {
                head--;
                ans[head] = c;
            }
            else
            {
                ans[tail] = c;
                tail++;
            }
        }
    }
    if(mode == 1)
    {
        reverse(&ans[head], &ans[tail]);
    }
    printf("%s\n", &ans[head]);
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:57:5: error: 'memcpy' was not declared in this scope
   57 |     memcpy(&ans[head], s.c_str(), s.size());
      |     ^~~~~~
a.cc:14:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   13 | #include <set>
  +++ |+#include <cstring>
   14 | #include <vector>
Language: C++

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

#define FOR(i,N) for(int i=0;i<N;i++)

int main(){
    long long H,W,Q,M,,cnt=0,max=0,sum=0;
    string S;
    cin >> S >> Q;
    vector<long>T(Q,0),F(Q,0);
    vector<char>C(Q);
    FOR(i,Q){
        cin >> T[i];
        if(T[i]==2)cin >> F[i] >> C[i];
    }
    FOR(i,Q){
        if(T[i]==1)cnt++;
        else if(T[i]=2){
            if(cnt%2==0){
                if(F[i]==1)S=C[i]+S;
                else if(F[i]==2)S=S+C[i];
            }else{
                if(F[i]==1)S=S+C[i];
                else if(F[i]==2)S=C[i]+S;
            }
        }
    }
    if(cnt%2==1)reverse(S.begin(),S.end());
    cout << S << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: expected unqualified-id before ',' token
   10 |     long long H,W,Q,M,,cnt=0,max=0,sum=0;
      |                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  char S; cin>>S;
  int Q; cin>>Q;
  deque<char>A;
  bool B=false;
  int count=0;
  for(int i=0;i<Q;i++){
    int T; cin>>T;
    if(T==1)B=(B==false? true:false);
    else{
      int F; cin>>F;
      char C; cin>>C;
      if((B==true&&F==1)||(B==false&&F==2))A.push_back(C);
      else A.push_front(C);
      count++;
    }
  }
  if(B==false)for(int i=0;i<=count;i++){cout<<A.front();A.front_pop();}
  else for(int i=count;i>=0;i--){cout<<A.back();A.back_pop();}
  cout<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:59: error: 'class std::deque<char>' has no member named 'front_pop'
   20 |   if(B==false)for(int i=0;i<=count;i++){cout<<A.front();A.front_pop();}
      |                                                           ^~~~~~~~~
a.cc:21:51: error: 'class std::deque<char>' has no member named 'back_pop'
   21 |   else for(int i=count;i>=0;i--){cout<<A.back();A.back_pop();}
      |                                                   ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  char S; cin>>S;
  int Q; cin>>Q;
  deque<char>A;
  bool B=false;
  int count=0;
  for(int i=0;i<Q;i++){
    int T; cin>>T;
    if(T==1)B=(B==false? true:false);
    else{
      int F; cin>>F;
      char C; cin>>C;
      if((B==true&&F==1)||(B==false&&F==2))A.push_back(C);
      else A.push_front(C);
      count++;
    }
  }
  if(B==false)for(int i=0;i<=count;i++){cout<<A.front();A.front.pop();}
  else for(int i=count;i>=0;i--){cout<<A.back();A.back.pop();}
  cout<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:59: error: invalid use of member function 'std::deque<char>::front' (did you forget the '()' ?)
   20 |   if(B==false)for(int i=0;i<=count;i++){cout<<A.front();A.front.pop();}
      |                                                         ~~^~~~~
a.cc:21:51: error: invalid use of member function 'std::deque<char>::back' (did you forget the '()' ?)
   21 |   else for(int i=count;i>=0;i--){cout<<A.back();A.back.pop();}
      |                                                 ~~^~~~
Language: C++

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

int main(){
    string s;cin>>s;
    long long q;cin>>q;
    long long w==0;
    for(long long i=0;i<q;i++){
        int c;cin>>c;
        if(c==1){
            w++;
        }
        if(c==2){
            int d;cin>>d;
            string a;cin>>a;
            if(d==1){
                if(w%2==0)s.insert(0,a);
                else s.append(a);
            }
            else{
                if(w%2==0)s.append(a);
                else s.insert(0,a);
            }
        }
    }
    if(w%2==1)reverse(s.begin(),s.end());
    cout<<s<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: expected initializer before '==' token
    7 |     long long w==0;
      |                ^~
a.cc:11:13: error: 'w' was not declared in this scope
   11 |             w++;
      |             ^
a.cc:17:20: error: 'w' was not declared in this scope
   17 |                 if(w%2==0)s.insert(0,a);
      |                    ^
a.cc:21:20: error: 'w' was not declared in this scope
   21 |                 if(w%2==0)s.append(a);
      |                    ^
a.cc:26:8: error: 'w' was not declared in this scope
   26 |     if(w%2==1)reverse(s.begin(),s.end());
      |        ^
Language: C++

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

int main(){
  string s;
  cin >> s;
  deque<char> ds(s.size());
  for (int i = 0; i < s.size(); ++i) ds[i] = s[i];
  
  int q; cin >> q;
  int rev = 0;
  for (int i = 0; i < q; ++i){
    int type; cin >> type;
    if (type == 2){
      int f; char c;
      cin >> f >> c; --f;
      if (rev) f = 1 - f;
      if (f == 0) ds.push_front(c);
      else ds.push_back(c);
    }
    else rev =1 - rev;
  }
  if (rev) reverse(ds.begin(), ds.end());
  for (auto c:ds) cout << c;
  cout << endl
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:15: error: expected ';' before '}' token
   25 |   cout << endl
      |               ^
      |               ;
   26 | }
      | ~
Language: Java

import java.io.*;
import java.util.*;
class Main
{
  public static void main(String ar[])
  {
    Scanner sc=new Scanner(System.in);
    String ans=sc.readLine();
    int q=sc.nextInt();
    int k=1,t=0;
    for(int i=0;i<q;i++)
    {
      t=sc.nextInt();
      if(t==1)
        k=k*(-1);
      else
      {
        int f=sc.nextInt()-1;
        if(f==0)f=-1;
        String c=sc.next();
        f=f*k;
      	if(f==1)
          ans=ans+c;
        else
          ans=c+ans;
      }
    }
    if(k==-1)
    {
      StringBuffer sb=new StringBuffer(ans);
      sb.reverse();
    }
    System.out.println(sb);
  }
}

Compiler output:
Main.java:8: error: cannot find symbol
    String ans=sc.readLine();
                 ^
  symbol:   method readLine()
  location: variable sc of type Scanner
Main.java:33: error: cannot find symbol
    System.out.println(sb);
                       ^
  symbol:   variable sb
  location: class Main
2 errors
Language: Java

import java.io.*;
import java.util.*;
class Main
{
  public static void main(String ar[])
  {
    Scanner sc=new Scanner(System.in);
    StringBuffer sb=new StringBuffer(sc.next());
    int q=sc.nextInt();
    int k=1;t=0;
    for(int i=0;i<q;i++)
    {
      t=sc.nextInt();
      if(t==1)
        k=k*(-1);
      else
      {
        int f=sc.nextInt()-1;
        if(f==0)f=-1;
        String c=sc.next();
        f=f*k;
      	if(f==1)
          sb.append(c);
        else
          sb=new StringBuffer(c)+sb;
      }
    }
    if(k==-1)
      sb.reverse();
    System.out.println(sb);
  }
}

Compiler output:
Main.java:10: error: cannot find symbol
    int k=1;t=0;
            ^
  symbol:   variable t
  location: class Main
Main.java:13: error: cannot find symbol
      t=sc.nextInt();
      ^
  symbol:   variable t
  location: class Main
Main.java:14: error: cannot find symbol
      if(t==1)
         ^
  symbol:   variable t
  location: class Main
Main.java:25: error: bad operand types for binary operator '+'
          sb=new StringBuffer(c)+sb;
                                ^
  first type:  StringBuffer
  second type: StringBuffer
4 errors
Language: Java

import java.io.*;
import java.util.*;
class Main
{
  public static void main(String ar[])
  {
    Scanner sc=new Scanner(System.in);
    StringBuffer sb=new StringBuffer(sc.next());
    int q=sc.nextInt();
    int k=1;
    for(int i=0;i<q;i++)
    {
      t=sc.nextInt();
      if(t==1)
        k=k*(-1);
      else
      {
        int f=sc.nextInt()-1;
        if(f==0)f=-1;
        String c=sc.next();
        f=f*k;
      	if(f==1)
          sb.append(c);
        else
          sb=c+sb;
      }
    }
    if(k==-1)
      sb.reverse();
    System.out.println(sb);
  }
}

Compiler output:
Main.java:13: error: cannot find symbol
      t=sc.nextInt();
      ^
  symbol:   variable t
  location: class Main
Main.java:14: error: cannot find symbol
      if(t==1)
         ^
  symbol:   variable t
  location: class Main
Main.java:25: error: incompatible types: String cannot be converted to StringBuffer
          sb=c+sb;
              ^
3 errors
Language: C++


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const ll INF = 1LL << 60;

int main(){
    string s;
    int q;
    cin >> s >> q;
    for(int i=0; i<q; i++){
        int temp;
        cin >> temp;
        if(temp==1){
            reverse(all(s));
        }
        if(temp==2){
            int f;
            string c;
            cin >> f >> c;
            if(f==1){
                s.insert(0,c);
            }
            if(f==2){
                s.push_back(c);
            }
        }
    }
    cout << s << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:29: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char'
   27 |                 s.push_back(c);
      |                             ^
      |                             |
      |                             std::string {aka std::__cxx11::basic_string<char>}
In file included 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:2:
/usr/include/c++/14/bits/basic_string.h:1572:24: note:   initializing argument 1 of 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::push_back(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 1572 |       push_back(_CharT __c)
      |                 ~~~~~~~^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  int q;
  cin >> q;
  int rev = 1;
  for (int i = 0; i < q; i++) {
    int t;
    cin >> t;
    if (t == 1)
      rev = -rev;
    else {
      int f;
      cin >> f;
      string c;
      cin >> c;
      if ((f == 1 && rev == 1) || (f == 2 && rev == -1)) {
        s.insert(0, c);
      } else {
        s.push_back(c);
      }
    }
  }
  if (rev == -1) reverse(s.begin(), s.end());
  cout << s << '\n';
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:21: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char'
   26 |         s.push_back(c);
      |                     ^
      |                     |
      |                     std::string {aka std::__cxx11::basic_string<char>}
In file included 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/c++/14/bits/basic_string.h:1572:24: note:   initializing argument 1 of 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::push_back(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 1572 |       push_back(_CharT __c)
      |                 ~~~~~~~^~~
Language: C++

//#pragma GCC optimize "trapv"
//-D_GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define ii pair<int,int>
#define Max 100000+5
#define IO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define f first
#define s second
#define pb push_back
int mod = 1000000007;
int mod1 = 998244353;
vector<int> g[Max];
bool vis[Max];
int d, x, y;
int gcd(int a,int b){
    if(b==0)return a;
    return gcd(b,a%b);
}
void ex(int A, int B) {
    if(B == 0) {
        d = A;
        x = 1;
        y = 0;
    }
    else {
        ex(B, A%B);
        int temp = x;
        x = y;
        y = temp - (A/B)*y;
    }
}


void dfs(int u){

	vis[u]=1;
	for(int i=0;i<g[u].size();i++){
		int v=g[u][i];
		if(vis[v]!=1)
			dfs(v);
	}
}



int power(int a,int b){
    if(b==1)return a;
    if(a>mod)a%=mod;
    int r=1;
    while(b){
        if(b&1)r=r%mod*a%mod;
        a=a%mod*a%mod;
        b/=2;
    }
    return r;
}
class uf{
    vector<int> v;
    vector<int> sz;
    
    
    public :
    uf(int n){
        v.resize(n+1);
        iota(v.begin()+1,v.end(),1);
        sz.resize(n+1,1);
        //1 to sz
    }
    int root(int b){
        while(v[b]!=b){
            b = v[b];
        }   
        return b;
    }
    void u(int a, int b){
        //combine a and b
        
        int ra=root(a);
        int rb=root(b);
        if(ra==rb)return ;
        if(sz[ra]<sz[rb]){
            v[ra] = v[rb];
            sz[rb]+=sz[ra];
        }else{
            v[rb]=v[ra];
            sz[ra]+=sz[rb];
        }
    }
    bool f(int a,int b){
        //same set
        return (root(a)==root(b));
    }
   
    
};
vector<int> matmul(vector<int> a,vector<int> b){
    vector<int> c(4,0);
    c[0] = (a[0]%mod*b[0]%mod + a[1]%mod*b[2]%mod)%mod;
    c[1] = (a[0]%mod*b[1]%mod + a[1]%mod*b[3]%mod)%mod;
    c[2] = (a[2]%mod*b[0]%mod + a[3]%mod*b[2]%mod)%mod;
    c[3] = (a[2]%mod*b[1]%mod + a[3]%mod*b[3]%mod)%mod;
    return c;
}
vector<int> id={1,0,0,1};

int32_t main(){
	IO
	//freopen("input.txt","r",stdin);
    	//freopen("output.txt","w",stdout);
	string s;
  	cin>>s;
  	int q;
  	cin>>q;
  	int pos = 0;
  	for(int i=1;i<=q;i++){
		int a;
      	cin>>a;
      	if(a==1){
         //reverse 
          pos = s.length()-1 - pos;
        }
      	else{
         	int b;
          	cin>>b;
          	string z;
          	cin>>z;
          	if(b==1){
             //add begin 
             if(pos>0){
               s = s+z;
               pos++;
             }else{
               s = z+s;
               
             }
            }
          	else{
              //add end
              if(pos>0){
                s = z+s;
                
              }
              else{
                s = s +z;
                
              }
            }
        }
    }
  	if(pos>0){
      for(;pos>0;pos--)cout<<s[i];
    }
  	else cout<<s;
  	
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:155:32: error: 'i' was not declared in this scope
  155 |       for(;pos>0;pos--)cout<<s[i];
      |                                ^
Language: Java

import java.util.Scanner;

public class Main158D {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int Q = sc.nextInt();
        boolean flag = true;
        for (int i = 0; i < Q; i++) {
            int qn = sc.nextInt();
            if (qn == 1 && flag == true) {
                flag = false;
            } else if (qn == 1 && flag == false) {
                flag = true;
            } else {
                int qn2 = sc.nextInt();
                if (flag == true) {
                    if (qn2 == 1) {
                        S = sc.next() + S;
                    } else {
                        S = S + sc.next();
                    }
                } else {
                    if (qn2 == 1) {
                        S = S + sc.next();
                    } else {
                        S = sc.next() + S;
                    }
                }

            }

        }
        // System.out.println(flag);
        if (flag == true) {
            System.out.println(S);
        } else {
            // System.out.println(flag);
            char[] SC = S.toCharArray();
            for (int i = 0; i < S.length(); i++) {
                System.out.print(SC[S.length() - 1 - i]);

            }
        }
    }
}

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

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int Q = sc.nextInt();
        boolean flag = true;
        for (int i = 0; i < Q; i++) {
            int qn = sc.nextInt();
            if (qn == 1 && flag == true) {
                flag = false;
            } else if (qn == 1 && flag == false) {
                flag = true;
            } else {
                int qn2 = sc.nextInt();
                if (flag == true) {
                    if (qn2 == 1) {
                        S = sc.next() + S;
                    } else {
                        S = S + sc.next();
                    }
                } else {
                    if (qn2 == 1) {
                        S = S + sc.next();
                    } else {
                        S = sc.next() + S;
                    }
                }

            }

        }
        // System.out.println(flag);
        if (flag == true) {
            System.out.println(S);
        } else {
            // System.out.println(flag);
            char[] SC = S.toCharArray();
            for (int i = 0; i < S.length(); i++) {
                System.out.print(SC[S.length() - 1 - i]);

            }
        }
    }
}

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

#include <bits/stdc++.h>
using namespace std;
int main(){
    string s, x, y;
    cin >> s;
    int q; cin >> q;
    int rev = 0;
    for(int i=0; i<q; ++q){
        int e; cin >> e;
        if(e==2){
            int e; char t;
            cin >> e >> t; e--;
            if(rev) e = 1 - e;
            if(e==0){x += c;}
            else{Y += c;}
        }
        else rev = 1 - rev;
    }
    reverse(x.begin(). x.end());
    string res = x + s + y;
    if(rev) reverse(res.begin(), res.end());
    cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:27: error: 'c' was not declared in this scope
   14 |             if(e==0){x += c;}
      |                           ^
a.cc:15:18: error: 'Y' was not declared in this scope
   15 |             else{Y += c;}
      |                  ^
a.cc:15:23: error: 'c' was not declared in this scope
   15 |             else{Y += c;}
      |                       ^
a.cc:19:24: error: 'std::__cxx11::basic_string<char>::iterator' has no member named 'x'
   19 |     reverse(x.begin(). x.end());
      |                        ^