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

#include<stdio.h>
int main()
{
	int x=0,N,i,y;
	char s[105];
	scanf("%d\n",N);
	for(i=0;i<105;i++){
		scanf("%c",&s[i]);
	}
	for(i=0;i<105;i++)
	{
		if(s[i]=I)
			y=x+1;
			else(s[i]=D)
				y=x-1;
				if(x>y)
					;
					else(y>x)
						x=y;}
						return 0;


}


Compiler output:
main.c: In function 'main':
main.c:12:25: error: 'I' undeclared (first use in this function)
   12 |                 if(s[i]=I)
      |                         ^
main.c:12:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:35: error: 'D' undeclared (first use in this function)
   14 |                         else(s[i]=D)
      |                                   ^
main.c:14:37: error: expected ';' before 'y'
   14 |                         else(s[i]=D)
      |                                     ^
      |                                     ;
   15 |                                 y=x-1;
      |                                 ~    
main.c:18:50: error: expected ';' before 'x'
   18 |                                         else(y>x)
      |                                                  ^
      |                                                  ;
   19 |                                                 x=y;}
      |                                                 ~
Language: C

#include<stdio.h>
int main()
{
	int x=0,N,i,y;
	char S[105];
	scanf("%d\n",N);
	for(i=0;i<105;i++){
		scanf("%c",&s[i]);
	}
	for(i=0;i<105;i++)
	{
		if(S[i]=I)
			y=x+1;
			else(S[i]=D)
				y=x-1;
				if(x>y)
					;
					else(y>x)
						x=y;}
						return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:29: error: 's' undeclared (first use in this function)
    8 |                 scanf("%c",&s[i]);
      |                             ^
main.c:8:29: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:25: error: 'I' undeclared (first use in this function)
   12 |                 if(S[i]=I)
      |                         ^
main.c:14:35: error: 'D' undeclared (first use in this function)
   14 |                         else(S[i]=D)
      |                                   ^
main.c:14:37: error: expected ';' before 'y'
   14 |                         else(S[i]=D)
      |                                     ^
      |                                     ;
   15 |                                 y=x-1;
      |                                 ~    
main.c:18:50: error: expected ';' before 'x'
   18 |                                         else(y>x)
      |                                                  ^
      |                                                  ;
   19 |                                                 x=y;}
      |                                                 ~
Language: C

#include<stdio.h>
int main()
{
	int x=0,N,i,y;
	char S[105];
	scanf("%d\n%c\n",N,S[105]);
	for(i=0;i<105;i++){
		if(S[i]=I)
			y=x+1;
			else(S[i]=D)
				y=x-1;
				if(x>y)
					;
					else(y>x)
						x=y;}
						return 0;


}


Compiler output:
main.c: In function 'main':
main.c:8:25: error: 'I' undeclared (first use in this function)
    8 |                 if(S[i]=I)
      |                         ^
main.c:8:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:35: error: 'D' undeclared (first use in this function)
   10 |                         else(S[i]=D)
      |                                   ^
main.c:10:37: error: expected ';' before 'y'
   10 |                         else(S[i]=D)
      |                                     ^
      |                                     ;
   11 |                                 y=x-1;
      |                                 ~    
main.c:14:50: error: expected ';' before 'x'
   14 |                                         else(y>x)
      |                                                  ^
      |                                                  ;
   15 |                                                 x=y;}
      |                                                 ~
Language: C++

#include <cstdio>
#include <iostream>
#include<algorithm>

using namespace std;
char s[110];
int n,pos,maxn;
int main()
{
    scanf("%d%s",&n,s+1);
    for(int i=1;i<=n;++i)
    {
        if(s[i]=='I') ++ans;
        else --ans;
        maxn=max(maxn,ans);
    }
    printf("%d\n",maxn);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |         if(s[i]=='I') ++ans;
      |                         ^~~
      |                         abs
a.cc:14:16: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |         else --ans;
      |                ^~~
      |                abs
a.cc:15:23: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |         maxn=max(maxn,ans);
      |                       ^~~
      |                       abs
Language: C

#include<stdio.h>
int main(){
  int x,i,max;
  int S[N];
  max=S[0]
  for(i=1;i<=N;i++){
  if(S[i]=i)
  printf("x-1");
  if else(S[i]=D)
  printf("x+1");
  if(S[i]>max)
printf("%d",S[i]");}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:9: error: 'N' undeclared (first use in this function)
    4 |   int S[N];
      |         ^
main.c:4:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:11: error: expected ';' before 'for'
    5 |   max=S[0]
      |           ^
      |           ;
    6 |   for(i=1;i<=N;i++){
      |   ~~~      
main.c:12:17: warning: missing terminating " character
   12 | printf("%d",S[i]");}
      |                 ^
main.c:12:17: error: missing terminating " character
   12 | printf("%d",S[i]");}
      |                 ^~~~
main.c:14:1: error: expected declaration or statement at end of input
   14 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int s,a[s+1],d=0;
    cn>>s;
    for(int j=1;j<=s;j++)
    {
    	if(a[j]=i)
    	d++;
    	else
    	d--;
	}
	cout<<d<<endl
	 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cn' was not declared in this scope; did you mean 'yn'?
    6 |     cn>>s;
      |     ^~
      |     yn
a.cc:9:17: error: 'i' was not declared in this scope
    9 |         if(a[j]=i)
      |                 ^
a.cc:14:22: error: expected ';' before 'return'
   14 |         cout<<d<<endl
      |                      ^
      |                      ;
   15 |          return 0;
      |          ~~~~~~
Language: C++

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

int main(){
  int n,i,j,cnt=0,m=0;
  string s;
  cin>>n;
  cin>>s;
  for(i=0;i<s.size();i++){
    if(s[i]=='I'){
      cnt++;
      m=max(m,cnt)
    }else{
      cnt--;
    }
  }
  cout<<m;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: expected ';' before '}' token
   12 |       m=max(m,cnt)
      |                   ^
      |                   ;
   13 |     }else{
      |     ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,h,ans;
int main()
{
	cin>>n;
    for(int i=1;i<=n;++i)
    {
    	char s;cin>>s;
        if(s[i]=='I')h++;
        if(s[i]=='D')h--;
        ans=max(ans,h);
    }
    cout<<ans; 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: invalid types 'char[int]' for array subscript
   10 |         if(s[i]=='I')h++;
      |             ^
a.cc:11:13: error: invalid types 'char[int]' for array subscript
   11 |         if(s[i]=='D')h--;
      |             ^
Language: C++

    int a, ans = 0; cin >> a;
    char c;
    while(cin >> c)
        c == 'I' ? ans++ : ans--;
    cout << ans;
}


Compiler output:
a.cc:1:21: error: 'cin' does not name a type
    1 |     int a, ans = 0; cin >> a;
      |                     ^~~
a.cc:3:5: error: expected unqualified-id before 'while'
    3 |     while(cin >> c)
      |     ^~~~~
a.cc:5:5: error: 'cout' does not name a type
    5 |     cout << ans;
      |     ^~~~
a.cc:6:1: error: expected declaration before '}' token
    6 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
char l[105];
int main()
{
	int a,b=0,i,j;
	cin>>a;
	for(i=1;i<=a;i++)
	{
	cin>>a[i];
	if(a[i]=='I')
	b++;
	else b--;
	}
	cout<<b;
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: invalid types 'int[int]' for array subscript
   10 |         cin>>a[i];
      |               ^
a.cc:11:13: error: invalid types 'int[int]' for array subscript
   11 |         if(a[i]=='I')
      |             ^
Language: C++

x=0
res=0
n=int(input())
s=input()
for i in range(n):
  if s[i]=='I':x+=1
  else:x-=1
  res=max(res,x)
print(x)

Compiler output:
a.cc:1:1: error: 'x' does not name a type
    1 | x=0
      | ^
Language: C++

# include <iostream>
using namespace std;
int main(void){
  int N;
  int num[110];
  int count, ans = 0;
  
  string S;
  cin >> N;
  cin >> S;
  
  for (int i = 0; i <N; i++){
    char *c = S[i];
    if (c == "I") count+= 1;
    if (c == "D") count-=1;
   	ans = max(ans, count);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:18: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'char*' [-fpermissive]
   13 |     char *c = S[i];
      |                  ^
      |                  |
      |                  __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
Language: C++

# include <iostream>
using namespace std;
int main(void){
  int N;
  int num[110];
  int count, ans = 0;
  
  string S;
  cin >> N;
  cin >> S;
  
  for (int i = 0; i <N; i++){
    char c = S[i];
    if (c == "I") count+= 1;
    if (c == "D") count-=1;
   	ans = max(ans, count);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if (c == "I") count+= 1;
      |         ~~^~~~~~
a.cc:15:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     if (c == "D") count-=1;
      |         ~~^~~~~~
Language: C++

# include <iostream>
using namespace std;
int main(void){
  int N;
  int num[110];
  int count, ans = 0;
  
  string S;
  cin >> N;
  cin >> S;
  
  for (int i = 0; i <N; i++){
    if (S[i] == "I") count+= 1;
    if (S[i] == "D") count-=1;
   	ans = max(ans, count);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |     if (S[i] == "I") count+= 1;
a.cc:14:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if (S[i] == "D") count-=1;
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  string s;
  cin>>s;
  int ans,x;
  ans=0;
  for(int i=O;i<s.size();i++){
    if(s.at(i)=='I'){
      x++;
      if(ans<x){
        ans=x;
      }
    }
    if(s.at(i)=='D'){
      x--;
    }
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: 'O' was not declared in this scope
    9 |   for(int i=O;i<s.size();i++){
      |             ^
Language: C++

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

int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int cnt = 0;
  vector<int> a(n);
  if(s.at(i) == 'I'){
      a.at(i) = 1;
    }
    else {
      a.at(i) = -1;
    }
  for(int i=1;i<n;i++){
    if(s.at(i) == 'I'){
      a.at(i) = a.at(i-1) +1;
    }
    else {
      a.at(i) = a.at(i-1) -1;
    }
  }
  sort(a.begin(),a.end());
  cout << a.(n-1) << endl;
  
  return 0;
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: 'i' was not declared in this scope
   11 |   if(s.at(i) == 'I'){
      |           ^
a.cc:26:13: error: expected unqualified-id before '(' token
   26 |   cout << a.(n-1) << endl;
      |             ^
Language: C++

N = int(input())
S = input()
x = 0
ans = x

for s in S:
    if s == "I":
        x += 1
    else:
        x -= 1
    ans = max(ans, x)

print(ans)

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

#include <iostream>
using namespace std;
int main()
{
    int n,height=0,maxHeight=0;
    char c;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>c;
        if(c == 'I')
        {
            height++;
            if(height>maxHeight)
                maxHeight=height;
        }
        else if(c == 'D')
            height--;
    }
    cout<<maxHeight<<endl;
    return 0；
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:12: error: unable to find numeric literal operator 'operator""\U0000ff1b'
   21 |     return 0；
      |            ^~~
a.cc:21:15: error: expected ';' before '}' token
   21 |     return 0；
      |               ^
      |               ;
   22 | }
      | ~
Language: C++

#include <iostream>
using namespace std;
int main()
{
    int n,height=0,maxHeight=0;
    char c;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>c;
        if(c == 'I')
        {
            height++;
            if(height>maxHeight)
                maxHeight=height;
        }
        else if(c == 'D')
            height--;
    }
    cout<<maxHeight<<endl;
    return ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   21 |     return ;
      |     ^~~~~~
Language: C++

#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<iomanip>
using namespace std;
int main()
{
	int n;
	int max=-1;
	int hb=0;
	char a[101];
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		if(a[i]=='I') hb++;
		if(a[i]=='D') hb--;
		if(hb>max) max=hb;
	}
	cout<<max<<endl;
	return 0;
}#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<iomanip>
using namespace std;
int main()
{
	int n;
	int max=-1;
	int hb=0;
	char a[101];
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		if(a[i]=='I') hb++;
		if(a[i]=='D') hb--;
		if(hb>max) max=hb;
	}
	cout<<max<<endl;
	return 0;
}

Compiler output:
a.cc:23:2: error: stray '#' in program
   23 | }#include<iostream>
      |  ^
a.cc:23:3: error: 'include' does not name a type
   23 | }#include<iostream>
      |   ^~~~~~~
a.cc:29:5: error: redefinition of 'int main()'
   29 | int main()
      |     ^~~~
a.cc:7:5: note: 'int main()' previously defined here
    7 | int main()
      |     ^~~~
Language: C++


int main(){
    int N;
    cin >> N;
    string S;
    cin >> S;
    int ans = 0;
    int sum = 0;
    for(int i = 0;i < N;i++){
        if(S.at(i) == 'I'){
            sum++;
        }
        else{
            sum--;
        }
        ans = max(ans,sum);
    }
    cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin >> N;
      |     ^~~
a.cc:5:5: error: 'string' was not declared in this scope
    5 |     string S;
      |     ^~~~~~
a.cc:6:12: error: 'S' was not declared in this scope
    6 |     cin >> S;
      |            ^
a.cc:16:15: error: 'max' was not declared in this scope
   16 |         ans = max(ans,sum);
      |               ^~~
a.cc:18:5: error: 'cout' was not declared in this scope
   18 |     cout << ans;
      |     ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{

string S ;
int N ,m ;
int x=0;
set<int > d;
cin >> N>>S;
for(int i =0 ; i<N; i++)
 {
     if (S[i]=='I')
    x++;
    if (S[i]=='D')
   x--;
   d.insert(x);
 }

if (x<=0)
    cout << 0;
else
    cout << (d.size());

Compiler output:
a.cc: In function 'int main()':
a.cc:25:24: error: expected '}' at end of input
   25 |     cout << (d.size());
      |                        ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<fstream>
#include<cstdlib>
#include<iomanip>
#include<string>
#include<cstring>
#include<cmath>
#include<cfloat>
using namespace std;

int main()
{
    int n;
    cin>>n;
    int hb=0,maxi=0;
    for(int i=0;i<n;i++)
    {
        char t;
        cin>>t;
        if(t=='I')hb++;
        else if(t=='D')hb--;
        maxi=max(maxi,hb);
    }
    cout<<maxi
	exit(0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:15: error: expected ';' before 'exit'
   26 |     cout<<maxi
      |               ^
      |               ;
   27 |         exit(0);
      |         ~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
char h[500];
int main()
{
	int s=0,I,D,n;
	cin>>n;
	for(int i=0;i<n;i++) cin>>h[i];
	
	for(int i=0;i<=n;i++) {if(h[i]=='I') s+=1; if(h[i]=='D') s-=1;} 
	cout<<s<<endl;
	return 0；

	
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: unable to find numeric literal operator 'operator""\U0000ff1b'
   12 |         return 0；
      |                ^~~
a.cc:12:19: error: expected ';' before '}' token
   12 |         return 0；
      |                   ^
      |                   ;
......
   16 | }
      | ~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
using vl = vector<ll>;
using vvl = vector<vl>;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

int main() {
    int N;
    cin >> N;
    string S;
    cin >> S;
    int ma = 0;
    int current = 0;
    REP(i, S.length()) {
        if(S[i] == 'I') {
            current++;
            ma = max(ma, current);
        } else {
            current--;
        }
    }
    cout << ma << emdl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:19: error: 'emdl' was not declared in this scope
   51 |     cout << ma << emdl;
      |                   ^~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
using vl = vector<ll>;
using vvl = vector<vl>;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

int main() {
    int N;
    cin >> N;
    string S;
    cin >> S;
    int ma = 0;
    int current = 0;
    REP(i, S.length()) {
        if(S[i] == 'I') {
            current++;
            ma = max(ma, curret);
        } else {
            curret--;
        }
    }
    cout << ma << emdl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:26: error: 'curret' was not declared in this scope; did you mean 'current'?
   46 |             ma = max(ma, curret);
      |                          ^~~~~~
      |                          current
a.cc:48:13: error: 'curret' was not declared in this scope; did you mean 'current'?
   48 |             curret--;
      |             ^~~~~~
      |             current
a.cc:51:19: error: 'emdl' was not declared in this scope
   51 |     cout << ma << emdl;
      |                   ^~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
using vl = vector<ll>;
using vvl = vector<vl>;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

int main() {
    int N;
    cin >> N;
    string S;
    cin >> S;
    int ma = 0;
    int curret = 0;
    REP(i, S.length()) {
        if(S[i] == 'I') {
            curren++;
            ma = max(ma, curret);
        } else {
            curret--;
        }
    }
    cout << ma << emdl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:13: error: 'curren' was not declared in this scope; did you mean 'curret'?
   45 |             curren++;
      |             ^~~~~~
      |             curret
a.cc:51:19: error: 'emdl' was not declared in this scope
   51 |     cout << ma << emdl;
      |                   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
string s;
int main()
{
	long long n,ans=0;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>s[i];
	}
	int maxn=0;
	for(int i=1;i<=n;i++){
		if(s[i]=='I'){
			ans++;
			maxn=max(maxn,ans);
		}
		else if(s[i]=='D'){
			ans--;
		}
	}
	cout<<maxn<<"\n";
	return 0;
}


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

#include <iostream>
using namespace std;
int main()
{
	int n,ans=-INT_MAX,t=0;
	char c[101];
	cin>>n>>c;
	for(int i=0;i<n;i++)
	{
		if(c[i]=='I') t++;
		else t--;
		ans=max(ans,t);
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:20: error: 'INT_MAX' was not declared in this scope
    5 |         int n,ans=-INT_MAX,t=0;
      |                    ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include <iostream>
  +++ |+#include <climits>
    2 | using namespace std;
a.cc:10:31: error: 't' was not declared in this scope
   10 |                 if(c[i]=='I') t++;
      |                               ^
a.cc:11:22: error: 't' was not declared in this scope
   11 |                 else t--;
      |                      ^
a.cc:12:29: error: 't' was not declared in this scope
   12 |                 ans=max(ans,t);
      |                             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int q=0,a,b,d;
  string c;
  cin>>a>>c;
  for(int i=0;i<a;i++){
	if(a[i]=='D') b++;
  }
  d=a-b;
  if(d-b<=0) cout<<"0";
  else cout<<d-b;
  cout<<"\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: invalid types 'int[int]' for array subscript
    8 |         if(a[i]=='D') b++;
      |             ^
Language: C++

#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <algorithm> // sort

#define REP(i, n) for (long long i = 0; i < (n); i++) 
typedef long long ll;
static const ll MOD = 1000000007;
static const ll INF = 1000000000000000000LL;
using namespace std;

int main(){

//    std::ifstream in("input.txt");
//    std::cin.rdbuf(in.rdbuf());

    int n;
    cin >> n;
    string s;
    cin >> s;

    res = 0;
    int tmp = 0;

    REP(i,n)
    {
        if(s[i] == 'I')
        {
            ++tmp;
        }
        else
        {
            --tmp;
        }

        res = max(res,tmp);
    }



    cout << res << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:5: error: 'res' was not declared in this scope
   23 |     res = 0;
      |     ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,sum=0,max=0;
	char s[105];
	scanf("%d",&n);
	scanf("%s",s);
	for(int i=0;i<n;i++){
		if(s[i] == 'I'){
			sum++
		}
		else{
			sum--;
		}
		if(sum > max){
			max = sum;
		}
	}
	printf("%d",max);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:30: error: expected ';' before '}' token
   10 |                         sum++
      |                              ^
      |                              ;
   11 |                 }
      |                 ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,sum=0,max=0;
	char s[105];
	scanf("%d",&n);
	scanf("%s",s);
	for(int i=0;i<n;i++){
		if(s[i] == 'I'){
			sum++''
		}
		else{
			sum--;
		}
		if(sum > max){
			max = sum;
		}
	}
	printf("%d",max);
}

Compiler output:
a.cc:10:30: error: empty character constant
   10 |                         sum++''
      |                              ^~
a.cc: In function 'int main()':
a.cc:10:30: error: expected ';' before '\x0'
   10 |                         sum++''
      |                              ^~
      |                              ;
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
  int N;
  cin>>N;
  cin>>S;
  int ans=0;
  int tmp=0;
  for (int i=0;i<S.size();++i){
    if (S[i]=='I'){
      tmp+=1;
    }
    else tmp-=1;
    if (ans<tmp){
      ans=tmp;
    }
  }
  cout<<ans<<endl;
}
    

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

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

int main(){
  ios_base::sync_with_stdio(0); cin.tie(0);
  int n; cin >> n; string s; cin >> s;
  int mx = 0; int tmp = 0;
  for(int i=0;i<s.size();i++){
    if(s[i] == I) tmp++;
    else tmp--;
    mx = max(mx, tmp);
  }
  cout << mx << "\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: 'I' was not declared in this scope
    9 |     if(s[i] == I) tmp++;
      |                ^
Language: C++

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

int main(){
  ios_base::sync_with_stdio(0); cin.tie(0);
  int n; cin >>> n; string s; cin >> s;
  int mx = 0; int tmp = 0;
  for(int i=0;i<s.size();i++){
    if(s[i] == 'I') tmp++;
    else tmp--;
    mx = max(mx, tmp);
  }
  cout << mx << "\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: expected primary-expression before '>' token
    6 |   int n; cin >>> n; string s; cin >> s;
      |                ^
Language: C++

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

int main(){
  ios_base::sync_with_stdio(0); cin.tie(0);
  int n; cin >>> n; string s; cin >> s;
  int mx = 0; int tmp = 0;
  for(int i=0;i<s.size();i++){
    if(s[i] == I) tmp++;
    else tmp--;
    mx = max(mx, tmp);
  }
  cout << mx << "\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: expected primary-expression before '>' token
    6 |   int n; cin >>> n; string s; cin >> s;
      |                ^
a.cc:9:16: error: 'I' was not declared in this scope
    9 |     if(s[i] == I) tmp++;
      |                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
char s;
long long int ans=0,ansn=0,n;
int main(){
    cin>>n
    for(int i=1;i<=n;i++)
    {
        cin>>s;
        if(s=='I') ansn++;
        else if(s=='D') ansn--;
        ans=max(ans,ansn);
    }
    cout<<ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: expected ';' before 'for'
    6 |     cin>>n
      |           ^
      |           ;
    7 |     for(int i=1;i<=n;i++)
      |     ~~~    
a.cc:7:17: error: 'i' was not declared in this scope
    7 |     for(int i=1;i<=n;i++)
      |                 ^
Language: C++

#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include<bitset>
#include<math.h>
using namespace std;
#define INF 110000000000
#define MOD 1000000007
typedef long long ll;
typedef pair<int,int> P;


int main(){
  int N,x,ans=0;
  string s;
  cin>>N>>s;

  for(int i=0;i<N;i++){
    if(S[i]=='I') x++;
    else x--;
    ans=max(ans,x);
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:8: error: 'S' was not declared in this scope
   22 |     if(S[i]=='I') x++;
      |        ^
Language: C++

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

int N;
string S;

int main () {
  cin >> N >> S;
  int count = 0, ans = 0;
  
  for (int i = 0; i < N; i++){
    if (S[i] == 'I'){
      count++;
    }else{
      count--;
    }
    
    if (ans < count){
      ans = count;
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incude; did you mean #include?
    1 | #incude<bits/stdc++.h>
      |  ^~~~~~
      |  include
a.cc:5:1: error: 'string' does not name a type
    5 | string S;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin >> N >> S;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #incude<bits/stdc++.h>
a.cc:8:15: error: 'S' was not declared in this scope
    8 |   cin >> N >> S;
      |               ^
a.cc:22:3: error: 'cout' was not declared in this scope
   22 |   cout << ans << endl;
      |   ^~~~
a.cc:22:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:22:18: error: 'endl' was not declared in this scope
   22 |   cout << ans << endl;
      |                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #incude<bits/stdc++.h>
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      String s = sc.next();
      int count = 0;
      int max = 0;
      for(int i = 0;i < s.length;i++){
      	if(s.substring(i,i+1).equals("I")){
        	count++;
          	max = Math.max(max,count);
        }else{
        	count--;
        }
      }
      System.out.println(max);
    }
}

Compiler output:
Main.java:8: error: cannot find symbol
      for(int i = 0;i < s.length;i++){
                         ^
  symbol:   variable length
  location: variable s of type String
1 error
Language: C++

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <cassert>
#include <functional>
#include <string>
#include <sstream>
#include <cctype>
using namespace std;

int main(){
  int N; cin >> N;
  strng S; cin >> S;
  int x = 0;
  int max = x;
  for(int i = 0; i < N; i++){
    if(S[i] == 'I') x++;
    if(S[i] == 'D') x--;
    if(x > max) max = x;
  }
  cout << max << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'strng' was not declared in this scope
   16 |   strng S; cin >> S;
      |   ^~~~~
a.cc:16:19: error: 'S' was not declared in this scope
   16 |   strng S; cin >> S;
      |                   ^
Language: C++

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

int main(){
	int N;
	string S;
	cin >> N >> S;
	int Xa = 0;
	int MaxX = Xa;
	rep(i, N){
		if(S.at(i) == 'I'){
			Xa++;
			MaxX = max(MaxX, Xa);
		} else {
			Xa--;
		}
	}
	cout << maxX << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'maxX' was not declared in this scope; did you mean 'MaxX'?
   19 |         cout << maxX << endl;
      |                 ^~~~
      |                 MaxX
Language: C++

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

int main(){
	int N;
	string S;
	cin >> N >> S;
	int Xa = 0;
	int MaxX = Xa;
	rep(i, N){
		if(S.at(i) == 'I'){
			X++;
			MaxX = max(MaxX, Xa);
		} else {
			X--;
		}
	}
	cout << maxX << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: 'X' was not declared in this scope
   13 |                         X++;
      |                         ^
a.cc:16:25: error: 'X' was not declared in this scope
   16 |                         X--;
      |                         ^
a.cc:19:17: error: 'maxX' was not declared in this scope; did you mean 'MaxX'?
   19 |         cout << maxX << endl;
      |                 ^~~~
      |                 MaxX
Language: C++

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

int main() {
  int n;
  string str;
  cin >> n;
  cin >> str;
  
  int x = 0;
  int ans = 0;

  for(int i=0; i < n; i++){
    if(str.at(i) == "I"){
   x = x + 1;
   ans = max(ans,x);
    } else if(str.at(i) == "D"){
   x = x - 1;
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if(str.at(i) == "I"){
      |        ~~~~~~~~~~^~~~~~
a.cc:17:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |     } else if(str.at(i) == "D"){
      |               ~~~~~~~~~~^~~~~~
Language: C++

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

int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  
  int x = 0;
  int ans = 0;
  vector<str> str;
  for(int i=0; i<n; i++){
  if(str.at(i) == "I"){
   x = x + 1;
   int ans = max(ans,x);
  } else if(str.at(i) == "D"){
   x = x - 1;
  }
  }
  
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 'str' was not declared in this scope; did you mean 'std'?
   12 |   vector<str> str;
      |          ^~~
      |          std
a.cc:12:13: error: template argument 1 is invalid
   12 |   vector<str> str;
      |             ^
a.cc:12:13: error: template argument 2 is invalid
Language: C++

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

int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  
  int x = 0;
  int ans = 0;
  vector<str> str;
  for(int i=0; i<n; i++){
  if(str.at(i) == "I"){
   x = x + 1;
   int ans = max(ans,x);
  } else if(str.at(i) == "D"){
   x = x - 1;
  }
  
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 'str' was not declared in this scope; did you mean 'std'?
   12 |   vector<str> str;
      |          ^~~
      |          std
a.cc:12:13: error: template argument 1 is invalid
   12 |   vector<str> str;
      |             ^
a.cc:12:13: error: template argument 2 is invalid
a.cc:22:2: error: expected '}' at end of input
   22 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>
#include <deque>
#include <iterator>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
template<class T> inline bool chmax(T& a, T b) {if (a<b) {a=b; return true;} return false;}
template<class T> inline bool chmin(T& a, T b) {if (a>b) {a=b; return true;} return false;}

const ll MOD = 1000000007;
const ll HIGHINF = (ll)1e18;

int main() {
  ll n; cin >> n;
  string s; cin >> s;
  ll ans = 0, x = 0;
  REP(i, n) {
    if (s[i] == 'I') x++;
    else (s[i] == 'D') x--;
    chmax(ans, x);
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:23: error: expected ';' before 'x'
   37 |     else (s[i] == 'D') x--;
      |                       ^~
      |                       ;
Language: C++

#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;
    string s;
    cin >> s;
    int x=0 , max=0;
    for (int i=0 ; i<n ; i++){

        if(s[i]=='I'){
            x++;
            if(x>max)
                max=x;
            }else if (s[i]=='D'){
            x--;
            }
    }
    cout << max<< endl;
    return 0;
}
#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;
    string s;
    cin >> s;
    int x=0 , max=0;
    for (int i=0 ; i<n ; i++){

        if(s[i]=='I'){
            x++;
            if(x>max)
                max=x;
            }else if (s[i]=='D'){
            x--;
            }
    }
    cout << max<< endl;
    return 0;
}


Compiler output:
a.cc:29:5: error: redefinition of 'int main()'
   29 | int main()
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main()
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
    int n,m,temp,x=0;
    char a[101];
    int b[100]={0};
    cin>>n;
    if((n>=1)&&(n<=100))
    for(int i=0;i<n;i++){
        cin>>a[i];
        if(a[i]=='I'){
            ++x;
            b[i]=x;}
            else
            if(a[i]=='D'){
            --x;
            b[i]=x;}
            else
            m=x; }
            
           for(int c=0;c<n-1;c++){
               if(b[c]>b[c+1])
               temp=b[c];
               b[c]=b[c+1];
               b[c+1]=temp;
           }}
           if(b[n-1>0])
           cout<<b[n-1];
           else
           cout<<"0";
           
           
    
    return 0;
}

Compiler output:
a.cc:28:12: error: expected unqualified-id before 'if'
   28 |            if(b[n-1>0])
      |            ^~
a.cc:30:12: error: expected unqualified-id before 'else'
   30 |            else
      |            ^~~~
a.cc:35:5: error: expected unqualified-id before 'return'
   35 |     return 0;
      |     ^~~~~~
a.cc:36:1: error: expected declaration before '}' token
   36 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
    int n,m,temp,x=0;
    char[101];
    int b[100]={0};
    cin>>n;
    if((n>=1)&&(n<=100))
    for(int i=0;i<n;i++){
        cin>>a[i];
        if(a[i]=='I'){
            ++x;
            b[i]=x;}
            else
            if(a[i]=='D'){
            --x;
            b[i]=x;}
            else
            m=x; }
            
           for(int c=0;c<n-1;c++){
               if(b[c]>b[c+1])
               temp=b[c];
               b[c]=b[c+1];
               b[c+1]=temp;
           }}
           if(b[n-1>0])
           cout<<b[n-1];
           else
           cout<<"0";
           
           
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: expected identifier before numeric constant
    6 |     char[101];
      |          ^~~
a.cc:6:10: error: expected ']' before numeric constant
    6 |     char[101];
      |          ^~~
      |          ]
a.cc:6:9: error: structured binding declaration cannot have type 'char'
    6 |     char[101];
      |         ^
a.cc:6:9: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:6:9: error: empty structured binding declaration
a.cc:6:14: error: expected initializer before ';' token
    6 |     char[101];
      |              ^
a.cc:11:14: error: 'a' was not declared in this scope
   11 |         cin>>a[i];
      |              ^
a.cc: At global scope:
a.cc:28:12: error: expected unqualified-id before 'if'
   28 |            if(b[n-1>0])
      |            ^~
a.cc:30:12: error: expected unqualified-id before 'else'
   30 |            else
      |            ^~~~
a.cc:35:5: error: expected unqualified-id before 'return'
   35 |     return 0;
      |     ^~~~~~
a.cc:36:1: error: expected declaration before '}' token
   36 | }
      | ^
Language: C++

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

int main() {
  int n,x = 0,maxi = 0;
  string s;
  cin >> n >> s;
 for(int i = 0; i < n; i++){
   if(s.at(i) == 'I'){
     x++;
     maxi = max(maxi,x);
   }else{
     x--;
   }
   cout << maxi << endl;
}


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

#include<iostream>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
int main()
{
 int ans=0;
 int sum=0;
 int N;
 string S;
 cin >> N >>S;
 rep(i,N)
 {
	 if(S[i]=="I")
	 {
		 sum++;
		 if(sum>ans)
		 {
			 ans=sum;
		 }
	 }
	 else
	 {
		 sum--;
	 }
	
 }
 
 cout << ans <<endl;
 return 0;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |          if(S[i]=="I")
Language: Java

public class Main {
	public static void main(String[] args) {

		try (Scanner sc = new Scanner(System.in)) {
		int N = sc.nextInt();
		String S = sc.next();
		
		int res = 0;
		int count = 0; 
		for(int i = 0; i < N; i++) {
			if('I' == S.charAt(i)) count++;
			else count--;
			res = Math.max(res, count);
		}
		
		System.out.println(res);
	} // Scanner Close
    }
}

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

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n, I ,x=0 ,in=0;
	scanf("%d",&n);
	string s;
	cin>>s;


	 	for(int i=0 ;i<n;i++)
	 	if(s[i]=='I')
		 {
		 	x++;
		 	I++;
		 }
		 else
		 {
		 	x--;
		 	I+=0;
		 }
		 for( i=0 ;x<n;x++)


	int f=max(x,I-1);

	cout<<f;

}**/

Compiler output:
a.cc: In function 'int main()':
a.cc:22:23: error: 'i' was not declared in this scope
   22 |                  for( i=0 ;x<n;x++)
      |                       ^
a.cc:27:15: error: 'f' was not declared in this scope
   27 |         cout<<f;
      |               ^
a.cc: At global scope:
a.cc:29:4: error: expected unqualified-id before '/' token
   29 | }**/
      |    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,max; string S;
  cin>>N>>S;
  int x=0; vector<int> a(N);
  for(int i=0;i<N;i++){
    if(S.at(i)='I') x++;
    else x--;
    a.at(i)=x;
  }
  max=0;
  for(int i=0;i<N;i++){
    if(max<a.at(i);) max=a.at(i);
  }
  cout<<max<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: expected primary-expression before ')' token
   14 |     if(max<a.at(i);) max=a.at(i);
      |                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N; string S;
  cin>>N>>S;
  int x=0;
  for(int i=0;i<N;i++){
    if(S.at(i)='I') x++;
    else x--;
  }
  cout<<x<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: expected '}' at end of input
   11 |   cout<<x<<endl;
      |                 ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

(let ((n (read))
      (s (read-line))
      (ans 0)
      (ans-max 0))
     (loop for i across s
           do (if (eq i #\D) (decf ans)
                  (progn (incf ans)
                    (setf ans-max (max ans ans-max)))))
     (princ ans-max))

Compiler output:
a.cc:6:25: error: stray '#' in program
    6 |            do (if (eq i #\D) (decf ans)
      |                         ^
a.cc:6:26: error: stray '\' in program
    6 |            do (if (eq i #\D) (decf ans)
      |                          ^
a.cc:1:5: error: expected ')' before '(' token
    1 | (let ((n (read))
      | ~   ^~
      |     )
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a , b=0 , m=0;
    cin>>a;
    char s[a];
    for(int i=0; i<=n ;i++){
        cin>>s[i];
        if(s[i]=='I'){
            ++b;
            ++i;
        }
        else if (s[i]=='D'){
            --b;
            ++i;
        }
        if (b>m)
        m=b;
    }
    cout<<m;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: 'n' was not declared in this scope
    8 |     for(int i=0; i<=n ;i++){
      |                     ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
    int N,maxm,x=0;
    cin>>N;
 char S[N];


for(int i=0;i<N;i++){
cin>>S[i];

if(S[i]=='I')
   {
      x++;}
    else
    if(S[i]=='D')
    {x--;}
if(x>=maxm)
        maxm=x;
}

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

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a , b=0 , m=0;
    cin>>a;
    char s[a];
    for(int i=0; i<=n ;){
        cin>>s[i];
        if(s[i]=='I'){
            ++b;
            ++i;
        }
        else if (s[i]=='D'){
            --b;
            ++i;
        }
        if (b>m)
        m=b;
    }
    cout<<m;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: 'n' was not declared in this scope
    8 |     for(int i=0; i<=n ;){
      |                     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int x=0,Y=0,n;
	cin>>n;
	char s[n];
	
	for(int i=0;i<n;i++)
	{
		scanf("%c",&s[i]);
		if(s[i]=='I'||s[i]=='D')
		{
			if(s[i]=='D')
			{
				x--;
			}
			if(s[i]=='I')
			{
				x++;	
			}
			
			
		}

	}
	if(x>=0)
	{
		cout<<x;
	}
	else
	{
		cout<<"x=0"
	}
 ;
 	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:28: error: expected ';' before '}' token
   33 |                 cout<<"x=0"
      |                            ^
      |                            ;
   34 |         }
      |         ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a , w=0 , m=0;
    cin>>a;
    char s[a];
    for(int i=0; i<=n ;){
        cin>>s[i];
        if(s[i]=='I'){
            ++w;
            ++i;
        }
        else if (s[i]=='D'){
            --w;
            ++i;
        }
        if (w>m)
        m=w;
    }
    cout<<m;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: 'n' was not declared in this scope
    8 |     for(int i=0; i<=n ;){
      |                     ^