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

#include<iostream>
#include<algorithm>
#include<math.h>
#include<cstdio>
#include<ctype.h>
#include<stdio.h>
#include<set>
#include<vector>
#include<map>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<numeric>
#include<string>
typedef long long ll;
ll dx[] = { 1,1,0,-1,-1,-1,0,1 };
ll dy[] = { 0,1,1,1,0,-1,-1,-1 };
ll prime(ll x) {
	ll i;
	if (x < 2)return 0;
	else if (x == 2) return 1;
	if (x % 2 == 0) return 0;
	for (i = 3; i*i <= x; i += 2) {
		if (x%i == 0) return 0;
	}
	return 1;
}
ll gcd(ll a, ll b) {
	if (a<b) { return gcd(b, a); }
	else if (a%b) { return gcd(b, a%b); }
	else { return b; }
}

ll MOD = 1000000007;
int main() {
	string X;
  	cin>>X;
  	ll x=0,y=0;
  	for(ll i=0; i<X.size(); i++){
      if(X[i]=='S')x++;
      else x--,y++;
    }
  cout<<X.size()-y*2<<endl;
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:9: error: 'string' was not declared in this scope
   38 |         string X;
      |         ^~~~~~
a.cc:38:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:39:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   39 |         cin>>X;
      |         ^~~
      |         std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:39:14: error: 'X' was not declared in this scope
   39 |         cin>>X;
      |              ^
a.cc:45:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   45 |   cout<<X.size()-y*2<<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:45:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   45 |   cout<<X.size()-y*2<<endl;
      |                       ^~~~
      |                       std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<climits>
#include<set>
#include<utility>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
const ll MOD=1e9+7;

int main(){

	stack<> s;
	string x;
	cin >> x;
	for(int i=0; i<x.size(); i++){
		if(x[i]=='S'){
			s.push(1);
		} else {
			if(s.top()!=1 || s.empty()){
				s.push(0);
			} else if(s.top()=='S'){
				s.pop();
			}
		}
	}
	cout << s.size() << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:15: error: wrong number of template arguments (0, should be at least 1)
   21 |         stack<> s;
      |               ^
In file included from /usr/include/c++/14/stack:63,
                 from a.cc:10:
/usr/include/c++/14/bits/stl_stack.h:99:11: note: provided for 'template<class _Tp, class _Sequence> class std::stack'
   99 |     class stack
      |           ^~~~~
a.cc:26:27: error: request for member 'push' in 's', which is of non-class type 'int'
   26 |                         s.push(1);
      |                           ^~~~
a.cc:28:30: error: request for member 'top' in 's', which is of non-class type 'int'
   28 |                         if(s.top()!=1 || s.empty()){
      |                              ^~~
a.cc:28:44: error: request for member 'empty' in 's', which is of non-class type 'int'
   28 |                         if(s.top()!=1 || s.empty()){
      |                                            ^~~~~
a.cc:29:35: error: request for member 'push' in 's', which is of non-class type 'int'
   29 |                                 s.push(0);
      |                                   ^~~~
a.cc:30:37: error: request for member 'top' in 's', which is of non-class type 'int'
   30 |                         } else if(s.top()=='S'){
      |                                     ^~~
a.cc:31:35: error: request for member 'pop' in 's', which is of non-class type 'int'
   31 |                                 s.pop();
      |                                   ^~~
a.cc:35:19: error: request for member 'size' in 's', which is of non-class type 'int'
   35 |         cout << s.size() << endl;
      |                   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin>>s;
	for(int i=0;i<s.size();i++){
		if(s[i]=='S'&&s[i+1]=='T'){
			s=s.substr(0,i)+s.substr(i+2,s.size()-i-2);
			i=-1;
		}
	}
	else cout<<s.size()<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'else' without a previous 'if'
   12 |         else cout<<s.size()<<endl;
      |         ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
  int s,t,i,length,count;
  string N;
  s = 0;
  t = 0;
  count = 0;
  cin >> N;
  length = N.size();
  for(i=0;i<length;i++){
    if(N[i] == 'S'){
      s++;
      if(s-t=>0)
        count++;
    }
    else{
      t++;
      if(s-t=>0)
        count++;
    }
  }
  cout << length-2*count << "\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: expected primary-expression before '>' token
   14 |       if(s-t=>0)
      |              ^
a.cc:19:14: error: expected primary-expression before '>' token
   19 |       if(s-t=>0)
      |              ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int s,t,i,length,count;
  string N;
  s = 0;
  t = 0;
  count = 0;
  cin >> N;
  length = N.size();
  for(i=0;i<length;i++){
    if(N[i] == 'S'){
      S++;
      if(S-T=>0)
        count++;
    }
    else{
      T++;
      if(S-T=>0)
        count++;
    }
  }
  cout << length-2*count << "\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: 'S' was not declared in this scope
   13 |       S++;
      |       ^
a.cc:14:12: error: 'T' was not declared in this scope
   14 |       if(S-T=>0)
      |            ^
a.cc:14:14: error: expected primary-expression before '>' token
   14 |       if(S-T=>0)
      |              ^
a.cc:18:7: error: 'T' was not declared in this scope
   18 |       T++;
      |       ^
a.cc:19:10: error: 'S' was not declared in this scope
   19 |       if(S-T=>0)
      |          ^
a.cc:19:14: error: expected primary-expression before '>' token
   19 |       if(S-T=>0)
      |              ^
Language: C++

using System;
using System.Linq;
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace Solution
{
    class Solution
    {
        static void Main(string[] args)
        {
            string s = System.Console.ReadLine();
            for(int i = 0; i < 100000; i++)
            {
                s = Regex.Replace(s, "ST", string.Empty);
            }
            System.Console.WriteLine(s.Length);
        }

    }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Linq;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Text.RegularExpressions;
      |       ^~~~~~
a.cc:9:26: error: 'string' has not been declared
    9 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:9:35: error: expected ',' or '...' before 'args'
    9 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:19:6: error: expected ';' after class definition
   19 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void Solution::Solution::Main(int*)':
a.cc:11:13: error: 'string' was not declared in this scope
   11 |             string s = System.Console.ReadLine();
      |             ^~~~~~
a.cc:14:17: error: 's' was not declared in this scope
   14 |                 s = Regex.Replace(s, "ST", string.Empty);
      |                 ^
a.cc:14:21: error: 'Regex' was not declared in this scope
   14 |                 s = Regex.Replace(s, "ST", string.Empty);
      |                     ^~~~~
a.cc:16:13: error: 'System' was not declared in this scope
   16 |             System.Console.WriteLine(s.Length);
      |             ^~~~~~
a.cc:16:38: error: 's' was not declared in this scope
   16 |             System.Console.WriteLine(s.Length);
      |                                      ^
Language: C++

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


int main() {
  string s; cin >> s;
  stack<char> S;
  REP(i,s.size()) {
    if (s[i] == 'S') S.push(s[i]);
    else {
      if (S.back() == 'S') S.pop();
      else S.push(s[i]);
    }
  }
  cout << S.size() << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: 'class std::stack<char>' has no member named 'back'
   13 |       if (S.back() == 'S') S.pop();
      |             ^~~~
Language: C++

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

int main() {
  string s; cin >> s;
  stack<char> S;
  REP(i,s.size()) {
    if (s[i] == 'S') S.push(s[i]);
    else {
      if (S.back() == 'S') S.pop();
      else S.push(s[i]);
    }
  }
  cout << S.size() << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'i' was not declared in this scope
    7 |   REP(i,s.size()) {
      |       ^
a.cc:7:3: error: 'REP' was not declared in this scope
    7 |   REP(i,s.size()) {
      |   ^~~
Language: C++

#include <iostream>
#include<algorithm>
#include<stdio.h>
#include<stdlib.h>
#include <string.h>
#include<cmath>
using namespace std;
int ss[1000008]= {0};
int main()
{
    char s[1000008]= {0};
    int i,j,x,n,r=0;
    scanf("%s",s);
    for(i=0,j=0; s[i]!=0; i++)
    {
        if(s[i]=='S')
        {
            ss[j]=i;
            j++;
        }
    }
    while(777)
    {
        r=0;
        int p=0
              for(i=ss[p]; ss[p]!=0; p++)
        {
            int f=1;
            if(s[i]=='S')
            {
                int k=i;
                for(j=i+1;; j++)
                {
                    if(s[j]==0)
                    {
                        f=0;
                        break;
                    }
                    if(s[j]=='0')continue;
                    if(s[j]=='T')break;
                    if(s[j]=='S')
                    {
                        f=0;
                        break;
                    }
                }
                if(f)
                {
                    s[k]='0';
                    s[j]='0';
                    r++;
                }

            }
        }
        if(!r)break;
    }
    r=0;
    for(i=0; s[i]!=0; i++)if(s[i]!='0')r++;
    printf("%d\n",r);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:15: error: expected ',' or ';' before 'for'
   26 |               for(i=ss[p]; ss[p]!=0; p++)
      |               ^~~
a.cc:26:41: error: expected ';' before ')' token
   26 |               for(i=ss[p]; ss[p]!=0; p++)
      |                                         ^
      |                                         ;
Language: Java

import java.util.*;
public class AGC05a{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        sc.close();
        Deque<Character> deq = new ArrayDeque<Character>();
        int count = 0;

        for(int i = 0; i < str.length(); i++){
            if(str.charAt(i) == 'S'){
                deq.push('e');
            }else{
                Character temp = deq.poll();
                if(temp == null){
                    count++;
                }
            }
        }

        System.out.println(count + deq.size());
    }
}

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

def finalLength(sample):
    foo = len(sample)
    tmp = 0
    for c in sample:
        if c=='S':
            tmp += 1
        elif tmp>0:
            tmp -= 1
            foo -= 2
    return foo

def main():
    sample = raw_input().strip()
    print finalLength(sample)

if __name__ == '__main__':
    main()

Compiler output:
a.cc:16:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   16 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:1:1: error: 'def' does not name a type
    1 | def finalLength(sample):
      | ^~~
Language: C++

#pragma GCC optimize("O3")
#include<bits/stdc++.h>
#define rc(x) return cout<<x<<endl,0
#define pb push_back
#define in insert
#define er erase
#define fr first
#define sc second
using namespace std;
typedef long long ll;
const long long llnrm=LLONG_MAX;
const int nrm=INT_MAX;
const int nrn=INT_MIN;
const int nmax=1e5+5;
const int mod=1e9+7;
const long long llim=1e18;
const int lim=1e8;
int ans,a[101];
string s;
int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0);
    // freopen("solution.in","r",stdin);
	//freopen("solution.out","w",stdout);
	cin>>s;
	len=s.size();
    for(int i=0;i<s.size()-1;i++)
    {
        if(s[i]=='S' && s[i+1]=='T')
        {
            s.erase(i,2);
            i-=2;
            len-=2;
        }
  }
  cout<<len<<endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:26:9: error: 'len' was not declared in this scope
   26 |         len=s.size();
      |         ^~~
Language: C

#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <fstream>
#include <string> 
#include <cmath>  
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <functional>

char x[200005];

int main(void) {
	char input;
	int i = 0;
	while (1) {
		scanf("%c", &input);
		if (input == '\n') {
			x[i] = '\0';
			break;
		}
		x[i] = input;
		if (input == 'T') {
			if (i > 0 && x[i - 1] == 'S') {
				i -= 2;
			}
		}
		i++;
	}
	printf("%d\n", strlen(x));
	return 0;
}

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

#include <iostream>
#include <algorithm>
#include <string>
#include <stack>

using namespace std;

int main()
{
    string s; cin >> s;

    stack<char> st;
    for (auto x : s) {
        if (x == 'S') st.push(x);
        else if (st.top() == x) st.push();
        st.pop();
    }
    cout << st.size();

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:40: error: no matching function for call to 'std::stack<char>::push()'
   15 |         else if (st.top() == x) st.push();
      |                                 ~~~~~~~^~
In file included from /usr/include/c++/14/stack:63,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_stack.h:258:7: note: candidate: 'void std::stack<_Tp, _Sequence>::push(const value_type&) [with _Tp = char; _Sequence = std::deque<char, std::allocator<char> >; value_type = char]'
  258 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_stack.h:258:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_stack.h:263:7: note: candidate: 'void std::stack<_Tp, _Sequence>::push(value_type&&) [with _Tp = char; _Sequence = std::deque<char, std::allocator<char> >; value_type = char]'
  263 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_stack.h:263:7: note:   candidate expects 1 argument, 0 provided
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
  string str;
  cin>>str;
  for(int i=0;i<str.size()-1;i++){
    if(str[i]=='S'&&str[i+1]=='T'){
      flag=0;
      str=str.substr(0,i)+str.substr(i+2,str.size()-i-1);
      i--;
    }
    if(str.size()==0||str.size()==1){
      flag=1;
      break;
    }
  }
  cout<<str.size()<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'flag' was not declared in this scope
    9 |       flag=0;
      |       ^~~~
a.cc:14:7: error: 'flag' was not declared in this scope
   14 |       flag=1;
      |       ^~~~
Language: C++

X = input()

i = 0
while i < len(X):
    # print(i)
    while i + 1 < len(X) and X[i:i+2] != 'ST':
        i += 1

    if i + 1 >= len(X):
        break
    X = X[:i] + X[i+2:]
    i -= 1

print(len(X))


Compiler output:
a.cc:5:7: error: invalid preprocessing directive #print
    5 |     # print(i)
      |       ^~~~~
a.cc:6:42: warning: multi-character character constant [-Wmultichar]
    6 |     while i + 1 < len(X) and X[i:i+2] != 'ST':
      |                                          ^~~~
a.cc:1:1: error: 'X' does not name a type
    1 | X = input()
      | ^
Language: Java

package agc0.agc005;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class MainA {

	public static void main(String[] args) throws IOException {
		BufferedReader input =new BufferedReader (new InputStreamReader (System.in));
		String str = input.readLine( );

		while(str.contains("ST")){
			str = str.replace("ST", "");
		}

		System.out.println(str.length());

	}
}


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

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	string s; cin >> s;
	int minx = INT_MAX, x = 0;
	for (int i = 0; i < s.size(); i++){
		if (s[i] == 'T')x--; else x++;
		minx = min(minx, x);
	}
	cout << minx << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: 'INT_MAX' was not declared in this scope
    7 |         int minx = INT_MAX, x = 0;
      |                    ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include<algorithm>
  +++ |+#include <climits>
    4 | using namespace std;
a.cc:9:33: error: 'x' was not declared in this scope
    9 |                 if (s[i] == 'T')x--; else x++;
      |                                 ^
a.cc:9:43: error: 'x' was not declared in this scope
    9 |                 if (s[i] == 'T')x--; else x++;
      |                                           ^
a.cc:10:34: error: 'x' was not declared in this scope
   10 |                 minx = min(minx, x);
      |                                  ^
Language: C++

#include <stack>
#include <cstdio>
#include <vector>
char x[1<<19];
int solve(void) {
    std::stack<char> st;
    int len = strlen(x);
    for(int i = 0; i < len; i++) {
        if(x[i] == 'S') st.push(x[i]);
        else if(x[i] == 'T' && (st.empty() || st.top() == 'T') st.push(x[i]);
        else st.pop();
    }
    return st.size();
}
int main(void) {
    fgets(x, 1 << 19, stdin);
    printf("%d", solve());
    return 0;
}

Compiler output:
a.cc: In function 'int solve()':
a.cc:7:15: error: 'strlen' was not declared in this scope
    7 |     int len = strlen(x);
      |               ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <vector>
  +++ |+#include <cstring>
    4 | char x[1<<19];
a.cc:10:63: error: expected ';' before 'st'
   10 |         else if(x[i] == 'T' && (st.empty() || st.top() == 'T') st.push(x[i]);
      |                                                               ^~~
      |                                                               ;
a.cc:11:9: error: expected primary-expression before 'else'
   11 |         else st.pop();
      |         ^~~~
a.cc:10:78: error: expected ')' before 'else'
   10 |         else if(x[i] == 'T' && (st.empty() || st.top() == 'T') st.push(x[i]);
      |                ~                                                             ^
      |                                                                              )
   11 |         else st.pop();
      |         ~~~~
Language: C

#include <stack>
#include <cstdio>
#include <vector>
char x[1<<19];
int solve(void) {
    std::stack<char> st;
    int len = strlen(x);
    for(int i = 0; i < len; i++) {
        if(x[i] == 'S') st.push(x[i]);
        else if(x[i] == 'T' && (st.empty() || st.top() == 'T') st.push(x[i]);
        else st.pop();
    }
    return st.size();
}
int main(void) {
    fgets(x, 1 << 19, stdin);
    printf("%d", solve());
    return 0;
}

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

  1 #include<bits/stdc++.h>
  2 
  3 
  4  #define sz(a) int((a).size()) 
  5  #define pb push_back 
  6 
  7  #define tr(c,i) for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++)
  8  #define present(c,x) ((c).find(x) != (c).end()) 
  9  #define cpresent(c,x) (find(all(c),x) != (c).end())
 10 using namespace std;
 11 
 12 typedef long long ll;
 13 
 14 int main()
 15 {
 16  string s;
 17  cin>>s;
 18 
 19  int l=s.length();
 20  int i=0;
 21  while(i!=l-1)
 22  {
 23         if(s[i]=='S'&&s[i+1]=='T')
 24         {
 25         s.erase(i,2);
 26         i--;
 27         }
 28         else
 29                 i++;
 30 
 31  }
 32  cout<<s.length();
 33 }


Compiler output:
a.cc:1:5: error: stray '#' in program
    1 |   1 #include<bits/stdc++.h>
      |     ^
a.cc:4:6: error: stray '#' in program
    4 |   4  #define sz(a) int((a).size())
      |      ^
a.cc:5:6: error: stray '#' in program
    5 |   5  #define pb push_back
      |      ^
a.cc:7:6: error: stray '#' in program
    7 |   7  #define tr(c,i) for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++)
      |      ^
a.cc:8:6: error: stray '#' in program
    8 |   8  #define present(c,x) ((c).find(x) != (c).end())
      |      ^
a.cc:9:6: error: stray '#' in program
    9 |   9  #define cpresent(c,x) (find(all(c),x) != (c).end())
      |      ^
a.cc:1:3: error: expected unqualified-id before numeric constant
    1 |   1 #include<bits/stdc++.h>
      |   ^
a.cc:7:62: error: 'i' does not name a type
    7 |   7  #define tr(c,i) for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++)
      |                                                              ^
a.cc:7:78: error: 'i' does not name a type
    7 |   7  #define tr(c,i) for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++)
      |                                                                              ^
a.cc:11:2: error: expected unqualified-id before numeric constant
   11 |  11
      |  ^~
a.cc:13:2: error: expected unqualified-id before numeric constant
   13 |  13
      |  ^~
Language: C++

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

void PRF(string T, int f[]){
    int m = T.length();
    int k;
    f[0] = -1;
    for(int i = 1; i<m; i++){
        k=f[i-1];
        while(k>=0){
            if(T[k] == T[i-1]){
                break;
            } else{
                k = f[k];
            }
        }
        f[i] = k+1;
    }
}

void KMP(string T, string String){
	bool fnd = false;

    int Tl = T.length();
    int Sl = String.length();
    int tmp[Tl];

    PRF(T, tmp);
    int i=0;
    int k=0;
    while(i<Sl){
        if(k==-1){
            i++;
            k=0;
        } 
        
        else if(String[i]==T[k]){
            i++;
            k++;
            if(k==Tl){
            	fnd=true;
				for(int j=i; i<i-Tl; i--){
 					String.pop();
 				}
            }
        } else{
            k = tmp[k];
        }
    }
    while(fnd){
 		KMP(T, String);
    }
    cout<<String.length();

}
int main()
{
string String, T;

cin>>String;

T="ST";
KMP(T, String);
}

Compiler output:
a.cc: In function 'void KMP(std::string, std::string)':
a.cc:45:48: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop'
   45 |                                         String.pop();
      |                                                ^~~
Language: C++

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

void prefixKMP(string T, int f[]){
    int m = T.length();
    int k;
    f[0] = -1;
    for(int i = 1; i<m; i++){
        k=f[i-1];
        while(k>=0){
            if(T[k] == T[i-1]){
                break;
            } else{
                k = f[k];
            }
        }
        f[i] = k+1;
    }
}

void KMPcheck(string T, string S){
	bool fnd = false;
	string z;
    int m = T.length();
    int n = S.length();
    int tmp[m];
    int z = 0;

    prefixKMP(T, tmp);
    int i=0;
    int k=0;
    while(i<n){
        if(k==-1){
            i++;
            k=0;
        } 
        
        else if(S[i]==T[k]){
            i++;
            k++;
            if(k==m){
            	fnd=true;
				for(int j=i; i<i-m; i--){
 					S.pop();
 				}
            }
        } else{
            k = tmp[k];
        }
    }
    while(fnd){
 		KMPcheck(T, S);
    }
    cout<<S.length();

}
int main()
{
string S, T;

cin>>S;
for(int i=0;i<F.length(), i++){
	S[i]=F[i];
}
T="ST";
KMPcheck(T, S);

}


Compiler output:
a.cc: In function 'void KMPcheck(std::string, std::string)':
a.cc:29:9: error: conflicting declaration 'int z'
   29 |     int z = 0;
      |         ^
a.cc:25:16: note: previous declaration as 'std::string z'
   25 |         string z;
      |                ^
a.cc:46:43: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop'
   46 |                                         S.pop();
      |                                           ^~~
a.cc: In function 'int main()':
a.cc:64:15: error: 'F' was not declared in this scope
   64 | for(int i=0;i<F.length(), i++){
      |               ^
a.cc:64:30: error: expected ';' before ')' token
   64 | for(int i=0;i<F.length(), i++){
      |                              ^
      |                              ;
Language: C++

s = gets.chomp
countS = 0
count = s.length
s.each_char do |e|
    countS += 1 if e == "S"
    if(e == "T" and countS > 0)
        count -= 2
        countS -= 1
    end
end
puts count

Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s = gets.chomp
      | ^
Language: C++

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

string x;

int main(){
  cin >> x;
  ll pos = 0;
  ll ans = 0;
  while(1){
    if(x == "ST"){
      cout << 0 << endl;
      return 0;
    }
    while(pos + 1 < x.length() && x.substr(pos,2) != "ST"){
      pos++;
    }
    if(pos + 1 == x.length()){
      cout << x.length() << endl;
      return 0;
    }else{
      cout << "newstring: " << newstring << endl;
      x = newstring;
      pos--;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:32: error: 'newstring' was not declared in this scope
   23 |       cout << "newstring: " << newstring << endl;
      |                                ^~~~~~~~~
Language: C++

#include <iostream>//cin/cout/wcin/wcout/left/right/internal/dec/hex/oct/fixed/scientific
#include <string>//stoi/stol/stoul/stoll/stoull/stof/stod/stold/to_string/getline
#include <vector>

using namespace std;

int main(void) {
	string x;
	cin >> x;
	ul n = x.size();
	vector<bool> b;
	b.push_back(x[0] == 'S');

	for (int i = 1; i < n; ++i)
	{
		if (x[i] == 'T') {
			if(b.back()) b.erase(b.end() - 1);
			else b.push_back(false);
		} else {
			b.push_back(true);
		}
	}

    cout << b.size() << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'ul' was not declared in this scope
   10 |         ul n = x.size();
      |         ^~
a.cc:14:29: error: 'n' was not declared in this scope
   14 |         for (int i = 1; i < n; ++i)
      |                             ^
Language: C++

#include <iostream>
#include <string>
#include <stack>
#include <stdin.h>

using namespace std;

int main(){
  char* x;
  cin >> x;
  string st = "ST";
  // スタックを準備する
  stack<char> stack;

  for (int i = 0; i < strlen(x); i++){
    if (x[i] == 'T') {
      if(stack.top() == 'S'){
        stack.pop();
      } else {
        stack.push(x[i]);
      }
    } else {
      stack.push(x[i]);
    }
  }
}


Compiler output:
a.cc:4:10: fatal error: stdin.h: No such file or directory
    4 | #include <stdin.h>
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
#include <stack>

using namespace std;

int main(){
  char* x;
  cin >> x;
  string st = "ST";
  // スタックを準備する
  stack<char> stack;

  for (int i = 0; i < strlen(x); i++){
    if (x[i] == 'T') {
      if(stack.top() == 'S'){
        stack.pop();
      } else {
        stack.push(x[i]);
      }
    } else {
      stack.push(x[i]);
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: 'strlen' was not declared in this scope
   14 |   for (int i = 0; i < strlen(x); i++){
      |                       ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <stack>
  +++ |+#include <cstring>
    4 |
Language: C++

// TEMPLATES -----------------------------------------------------------------------------------------------------------

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

// types
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

// utils
#define FOR(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--)

// constants
const int INF = INT_MAX / 3;


// MAIN ----------------------------------------------------------------------------------------------------------------


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

    string str;
    cin >> str;

    // while (cin >> a) {}

    stack<char> s;

    for (auto c : str) {
        if (c == 'S') {
            s.push(c);
        } else {
            if (!s.empty() && s.top() == 'S') {
                s.pop();
            } else {
                s.push(c);
            }
        }
    }

    cout << s.size() << endl;

    return 0;
}


Compiler output:
a.cc:41:17: error: 'INT_MAX' was not declared in this scope
   41 | const int INF = INT_MAX / 3;
      |                 ^~~~~~~
a.cc:24:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   23 | #include <ctime>
  +++ |+#include <climits>
   24 |
Language: C++

    cin.tie(0);
    ios::sync_with_stdio(false);

    string str;
    cin >> str;

    // while (cin >> a) {}

    stack<char> s;

    for (auto c : str) {
        if (c == 'S') {
            s.push(c);
        } else {
            if (!s.empty() && s.top() == 'S') {
                s.pop();
            } else {
                s.push(c);
            }
        }
    }

    cout << s.size() << endl;

Compiler output:
a.cc:1:5: error: 'cin' does not name a type
    1 |     cin.tie(0);
      |     ^~~
a.cc:2:5: error: 'ios' does not name a type
    2 |     ios::sync_with_stdio(false);
      |     ^~~
a.cc:4:5: error: 'string' does not name a type
    4 |     string str;
      |     ^~~~~~
a.cc:5:5: error: 'cin' does not name a type
    5 |     cin >> str;
      |     ^~~
a.cc:9:5: error: 'stack' does not name a type
    9 |     stack<char> s;
      |     ^~~~~
a.cc:11:5: error: expected unqualified-id before 'for'
   11 |     for (auto c : str) {
      |     ^~~
a.cc:23:5: error: 'cout' does not name a type
   23 |     cout << s.size() << endl;
      |     ^~~~
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
string x;
int s,t,i;
main()
{
    cin>>x;
    for(i=0;i;x.size();i++){
       if(x[i]=='T')
          t++;
       else
          s++;
    }
    cout<<max(s,t)*2<<endl;
}

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:9:21: warning: ignoring return value of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
    9 |     for(i=0;i;x.size();i++){
      |               ~~~~~~^~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1076:7: note: declared here
 1076 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
a.cc:9:23: error: expected ')' before ';' token
    9 |     for(i=0;i;x.size();i++){
      |        ~              ^
      |                       )
a.cc:9:27: error: expected ';' before ')' token
    9 |     for(i=0;i;x.size();i++){
      |                           ^
      |                           ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
char s[200005];
int n;
int solve(int i, int j){
	if (j == n)return 0;
	if (s[i] == 'S' && s[j] == 'T'){
		if (i > 0){
			return solve(i - 1, j + 1) + 2;
		}
		return solve(j + 1, j + 2) + 2;
	}
	return solve(i + 1, j + 1);
}

int main(){
	gets(s);
	n = strlen(s);
	cout << (n - solve(0, 1))<<endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   17 |         gets(s);
      |         ^~~~
      |         getw
Language: C

r;main(c){for(;~(c=getchar());)r+=c>83?!!r:-1;printf("%d",~r*2);

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | r;main(c){for(;~(c=getchar());)r+=c>83?!!r:-1;printf("%d",~r*2);
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'r' [-Wimplicit-int]
main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int]
    1 | r;main(c){for(;~(c=getchar());)r+=c>83?!!r:-1;printf("%d",~r*2);
      |   ^~~~
main.c: In function 'main':
main.c:1:3: error: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c:1:20: error: implicit declaration of function 'getchar' [-Wimplicit-function-declaration]
    1 | r;main(c){for(;~(c=getchar());)r+=c>83?!!r:-1;printf("%d",~r*2);
      |                    ^~~~~~~
main.c:1:1: note: 'getchar' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
  +++ |+#include <stdio.h>
    1 | r;main(c){for(;~(c=getchar());)r+=c>83?!!r:-1;printf("%d",~r*2);
main.c:1:47: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | r;main(c){for(;~(c=getchar());)r+=c>83?!!r:-1;printf("%d",~r*2);
      |                                               ^~~~~~
main.c:1:47: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:47: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:47: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:1: error: expected declaration or statement at end of input
    1 | r;main(c){for(;~(c=getchar());)r+=c>83?!!r:-1;printf("%d",~r*2);
      | ^
Language: C++

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

int main()
{
    string x; cin>>x;
    stack<char> s;

    for(e: x) {
        if (e=='T' and s.size() and s.top()=='S')
            s.pop();
        else
            s.push(e);
    }
    cout<<s.size()<<endl;
}
#include <iostream>
#include <string>
#include <stack>
using namespace std;

int main()
{
    string x; cin>>x;
    stack<char> s;

    for(e: x) {
        if (e=='T' and s.size() and s.top()=='S')
            s.pop();
        else
            s.push(e);
    }
    cout<<s.size()<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: found ':' in nested-name-specifier, expected '::'
   11 |     for(e: x) {
      |          ^
      |          ::
a.cc:11:9: error: 'e' has not been declared
   11 |     for(e: x) {
      |         ^
a.cc:18:1: error: expected primary-expression before '}' token
   18 | }
      | ^
a.cc:17:26: error: expected ')' before '}' token
   17 |     cout<<s.size()<<endl;
      |                          ^
      |                          )
   18 | }
      | ~                         
a.cc:11:8: note: to match this '('
   11 |     for(e: x) {
      |        ^
a.cc:18:1: error: expected primary-expression before '}' token
   18 | }
      | ^
a.cc: At global scope:
a.cc:24:5: error: redefinition of 'int main()'
   24 | int main()
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main()
      |     ^~~~
a.cc: In function 'int main()':
a.cc:29:10: error: found ':' in nested-name-specifier, expected '::'
   29 |     for(e: x) {
      |          ^
      |          ::
a.cc:29:9: error: 'e' has not been declared
   29 |     for(e: x) {
      |         ^
a.cc:36:1: error: expected primary-expression before '}' token
   36 | }
      | ^
a.cc:35:26: error: expected ')' before '}' token
   35 |     cout<<s.size()<<endl;
      |                          ^
      |                          )
   36 | }
      | ~                         
a.cc:29:8: note: to match this '('
   29 |     for(e: x) {
      |        ^
a.cc:36:1: error: expected primary-expression before '}' token
   36 | }
      | ^
Language: C++

//
#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <array>
#include <numeric>
#include <functional>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<utility>
#include<complex>

using namespace std;

#define REP(i,m,n) for(int i=m;i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define ALL(x) (x).begin(),(x).end()

typedef long long ll;
typedef pair<int, int> pii;

const ll inf = INT_MAX;
const double eps = 1e-10;
const double pi = acos(-1.0);
const int di[][2] = {{1,0},{0,1},{-1,0},{0,-1},{1,1},{1,-1},{-1,1},{-1,-1}};


string op(const string str){
	string ret = str;
	auto pos = str.find("ST");
	if(pos == -1){return str;}
	ret = str.substr(0, pos) + str.substr(pos+2, str.length());
	return ret;
}


int main(){
	string str, st;
	cin >> str;
	for(;;){
		st = op(str);
		if(st == str) break;
		str = st;
	}
	// cout << st << endl;
	cout << st.length() << endl;

	return 0;
}


Compiler output:
a.cc:29:16: error: 'INT_MAX' was not declared in this scope
   29 | const ll inf = INT_MAX;
      |                ^~~~~~~
a.cc:19:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   18 | #include<complex>
  +++ |+#include <climits>
   19 |
Language: Java

import java.util.Scanner;

public class Mondai1 {

    public static void main(String[] args) {
        Scanner scan = null;
        try {
            scan = new Scanner(System.in);
            System.out.println(replace(scan.nextLine()).length());
        } finally {
            if (scan != null) {
                scan.close();
            }
        }
    }

    private static String replace(String str) {
        if (str.contains("ST")) {
            return replace(str.replace("ST", ""));
        }
        return str;
    }
}

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

    #include <iostream>
    #include<string>
    using namespace std;
    string str;
     
    int main() {
    	cin>>str;
    	for(int n=0;n<str.size();n++){if(str=="ST")str.clear();
    	if(*(str.begin()+n)=='S'&&*(str.begin()+n+1)=='T'){
    	str.erase(str.begin()+n);
    	str.erase(str.begin()+n);
    	n--;}
        cout<<str.size()<<endl;
    return 0;}

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

str = STDIN.gets.chomp
result = str
count = 0
while str.size > count
	result = result.sub("ST" , "")
	count += 1
end
STDOUT.puts result.size

Compiler output:
a.cc:1:1: error: 'str' does not name a type
    1 | str = STDIN.gets.chomp
      | ^~~
Language: Java

public class Solution {
  public static void main(String[] args) {
    try (java.util.Scanner sc = new java.util.Scanner(System.in)) {
      StringBuilder sb = new StringBuilder();
      char[] a = sc.next().toCharArray();
      int i = 0;
      java.util.Deque<Character> stack = new java.util.ArrayDeque<>();
      while (i != a.length) {
        stack.push(a[i]);
        while (++i != a.length && a[i] == 'T' && !stack.isEmpty() && stack.peek() == 'S') {
          stack.pop();
        }
      }
      System.out.println(stack.size());
    } // end try
  } // end main()
} // end Solution


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

#include <iostream>
#include <stdio.h>
using namespace std;

int main()
{
    char x[200000];
    int depth=0;
    int ans=0;
    cin >> x;
    for(int i=0;x[i]!='\0' && i < ;++i){
        if(x[i]=='S'){
            ++depth;
            ++ans;
        }else if(x[i]=='T' && depth>0){
            --depth;
            --ans;
        }else{
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:35: error: expected primary-expression before ';' token
   11 |     for(int i=0;x[i]!='\0' && i < ;++i){
      |                                   ^
Language: C++

#include <iostream>
#include <cstring>

using namespace std;
S
char s[200010];
int l, T;

int main() {
    scanf("%s", s);
    while (s[++l]);
    
    int i = 0;
    while (1) {
        if (s[i++] == 'S') {
            T--;
            l-=2;
        }
        else T++;
        if(T==l/2)
            break;
    }
    printf("%d\n", T*2);
    
    
    return 0;
}

Compiler output:
a.cc:5:1: error: 'S' does not name a type
    5 | S
      | ^
a.cc: In function 'int main()':
a.cc:10:17: error: 's' was not declared in this scope
   10 |     scanf("%s", s);
      |                 ^
Language: C++

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


int main()
{

	string s;
	int a=s.length();
	long i,ans=0;
	for(i=a-1;i>=0;i--)
	{
		if(s[i]=='S')
			{ans++;continue;}
		break;
	}
	printf("%ld\n",n-ans);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:24: error: 'n' was not declared in this scope
   17 |         printf("%ld\n",n-ans);
      |                        ^
Language: Java

public class Solution {
  public static void main(String[] args) {
    try (java.util.Scanner sc = new java.util.Scanner(System.in)) {
      StringBuilder sb = new StringBuilder();
      char[] s = sc.next().toCharArray();
      int len = s.length;
      for (int i = 1, j = 0; i < s.length; i++) {
        if (s[j] == 'S' && s[i] == 'T') {
            len -= 2;
          if (j != 0) {
            j--;
          } else {
            j = i + 1;
            i = j;
          }
        } else j++;
      }
      System.out.println(len);
    }
  }
}


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

public class Atcoder_20161001_A {

    public static void Main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();

        int s_cnt = s.length();
        StringBuilder sb = new StringBuilder();
        for (int l = s_cnt / 2; l >= 1; l--) {
            sb = new StringBuilder();
            for (int m = 1; m <= l; m++) {
                sb.append("S");
            }
            for (int m = 1; m <= l; m++) {
                sb.append("T");
            }
            s = s.replaceAll(sb.toString(), "");
            if (s.indexOf("ST", 0) == -1)
                break;
        }
        System.out.println(s.length());
    }
}

Compiler output:
Main.java:1: error: class Atcoder_20161001_A is public, should be declared in a file named Atcoder_20161001_A.java
public class Atcoder_20161001_A {
       ^
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Atcoder_20161001_A
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Atcoder_20161001_A
3 errors
Language: Java

public class Main{

    public static void main(String[] args) {
        final String check_str = "ST";
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();

        int s_cnt = s.length();
        StringBuilder sb = new StringBuilder();
        for (int l = s_cnt / 2; l >= 1; l--) {
            sb = new StringBuilder();
            for (int m = 1; m <= l; m++) {
                sb.append("S");
            }
            for (int m = 1; m <= l; m++) {
                sb.append("T");
            }
            s = s.replaceAll(sb.toString(), "");
            if (s.indexOf(check_str, 0) == -1)
                break;
        }
        System.out.println(s.length());
    }
}

Compiler output:
Main.java:5: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <map>
#include <regex>


using namespace std;
typedef long long ll;

string s;
string search = "ST";

std::regex reg(R"(\{ST\}+)");


int main() {
    ios::sync_with_stdio(false);
    
    cin >> s;
    s = regex_replace(s, r, "");
    
        size_t found = s.find("ST");
    
    //cout << found << endl;
    
    while (found != string::npos) {
        string temp = s.substr(0,found);
        temp.append(s.substr(found+2, s.length()-found+2));
        s = temp;
        s = regex_replace(s, r, "");
        found = s.find("ST");
    }
    //*/
    
    cout << s.length() << endl;
    
    
    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:26: error: 'r' was not declared in this scope
   23 |     s = regex_replace(s, r, "");
      |                          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int n;
  string X;
  cin>>X;
 
  while(1){
    if(n==X.length())break;
    for(int i=0;i<X.length();i++){
      if(X[i]=='S'&&X[i+1]=='T'){
	X.erase(X.begin()+i,X.begin()+i+2);
	X[i]=X[i+1]=x;
      }
    }
    n=X.length();
  }
  
  cout<<X.length()<<endl;
 
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:21: error: 'x' was not declared in this scope
   14 |         X[i]=X[i+1]=x;
      |                     ^