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

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        String arr01[] = mylist.get(0).split(" ");
        int n = Integer.valueOf(arr01[0]);
        String arr02[] = mylist.get(1).split(" ");
        String s = arr02[0];

        String stemp = s.substring(0, 1);
        int cnt = 0;
        for (int i = 1; i <= n; i++) {

            if (i == n) {
                if (!s.substring(i - 2, i - 1).equals(s.substring(i - 1, i))) {
                    cnt += 1;
                }
            } else {
                if (!stemp.equals(s.substring(i, i + 1))) {
                    cnt += 1;
                }

                stemp = s.substring(i, i + 1);
            }
        }

        System.out.println(cnt == 0 ? 1 : cnt);
    }

}
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        String arr01[] = mylist.get(0).split(" ");
        int n = Integer.valueOf(arr01[0]);
        String arr02[] = mylist.get(1).split(" ");
        String s = arr02[0];

        String stemp = s.substring(0, 1);
        int cnt = 0;
        for (int i = 1; i <= n; i++) {

            if (i == n) {
                if (!s.substring(i - 2, i - 1).equals(s.substring(i - 1, i))) {
                    cnt += 1;
                }
            } else {
                if (!stemp.equals(s.substring(i, i + 1))) {
                    cnt += 1;
                }

                stemp = s.substring(i, i + 1);
            }
        }

        System.out.println(cnt == 0 ? 1 : cnt);
    }

}


Compiler output:
Main.java:51: error: class, interface, enum, or record expected
import java.io.BufferedReader;
^
Main.java:52: error: class, interface, enum, or record expected
import java.io.InputStreamReader;
^
Main.java:53: error: class, interface, enum, or record expected
import java.util.ArrayList;
^
Main.java:54: error: class, interface, enum, or record expected
import java.util.List;
^
4 errors
Language: C++

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

int main(){
  int n;
  string s;
  cin>>n>>s;
  int m=n;
  for(int i=0; i<n-1; i++;){
    if(s[i]==s[i+1]) m--;
  }
  cout << m << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:26: error: expected ')' before ';' token
    9 |   for(int i=0; i<n-1; i++;){
      |      ~                   ^
      |                          )
a.cc:9:27: error: expected primary-expression before ')' token
    9 |   for(int i=0; i<n-1; i++;){
      |                           ^
Language: C++

import java.util.*;

public class Main{
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        String S = scanner.next();
        
        int count = 1;
        char current = S.charAt(0);
        for(int i= 1; i<N; i++){
            if(current != S.charAt(i)){
                count++;
            }
            current = S.charAt(i);
        }
        System.out.println(count);
    }
}

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

#include<bits/stdc++.h>
using namespace std;
 
int main(){
    long N;
    string S;
    cin >> N;
    cin >> S;

    map<string,int> str;
    long count = 0;

    for(int i=0;i<N-1;i++){
       if(S[i] == S[i+1]){
           erase(S.begin()+i+1,1);
       }
    }

    cout << S.size();
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: 'erase' was not declared in this scope
   15 |            erase(S.begin()+i+1,1);
      |            ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
    long N;
    string S;
    cin >> N;
    cin >> S;

    map<string,int> str;
    long count = 0;

    for(int i=0;i<N-1;i++){
       if(S[i] == S[i+1]){
           erase(S.begin()+i+1);
       }
    }

    cout << S.size();
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: 'erase' was not declared in this scope
   15 |            erase(S.begin()+i+1);
      |            ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
    long N;
    string S;
    cin >> N;
    cin >> S;

    map<string,int> str;
    long count = 0;

    for(int i=0;i<N;i++){
       if(S[i] == S[i+1]){
           erase(S.begin()+i+1);
       }
    }

    cout << S.size();
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: 'erase' was not declared in this scope
   15 |            erase(S.begin()+i+1);
      |            ^~~~~
Language: C++

#include <iostream>
#include <string>

#define REP(i, n) for (int i = 0; i < (n); ++i)
using namespace std;

typedef long long ll;

int main()
{

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

    vector<int> d(n);

    string last = " ";
    int ans = 0;

    REP(i, n)
    {
        if (last.at(0) != s.at(i))
        {
            last = s[i];
            ans++;
        }
    }

    cout << ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'vector' was not declared in this scope
   17 |     vector<int> d(n);
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | #include <string>
a.cc:17:12: error: expected primary-expression before 'int'
   17 |     vector<int> d(n);
      |            ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
    long N;
    string S;
    cin >> N;
    cin >> S;

    map<string,int> str;
    long count = 0;

    for(int i=0;i<N;i++){
        str[S[i]] += 1; 
    }

    cout << str.size();


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: no match for 'operator[]' (operand types are 'std::map<std::__cxx11::basic_string<char>, int>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'})
   14 |         str[S[i]] += 1;
      |            ^
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::map<std::__cxx11::basic_string<char>, int>::key_type&' {aka 'const std::__cxx11::basic_string<char>&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::map<std::__cxx11::basic_string<char>, int>::key_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
Language: C++

N = int(input())
S = input()
ans = S[0]
count = 1
for i in range(1,N):
    if S[i] != ans[-1]:
        ans += S[i]
        count += 1
print(count)

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

#include <bits/stdc++.h>
using namespace std;
int main (){
int n;
  cin>>n;
  string s;
  cin>>s;
  int i;
  int c=n;
  char a;
  for(i=0;i<n-1;i++){
    a=c[i]
      if(a == c[i+1])
        c--;
  }
  cout<<c;
  return 0;
}

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

#include <bits/stdc++.h>

using namespace std;

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
template<typename T> T gcd(T a, T b){return(b?__gcd(a,b):a);}
template<typename T> T lcm(T a, T b){return(a*(b/gcd(a,b)));}
template<class T> ostream& operator<<(ostream &os, vector<T> V) {os << "[ "; for(auto v : V) os << v << " "; return os << "]";}
template<class T> ostream& operator<<(ostream &os, set<T> S){os << "{ "; for(auto s:S) os<<s<<" "; return os<<"}";}
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) {return os << "(" << P.first << "," << P.second << ")";}
template<class L, class R> ostream& operator<<(ostream &os, map<L,R> M) {os << "{ "; for(auto m:M) os<<"("<<m.first<<":"<<m.second<<") "; return os<<"}";}
#ifdef np
#define trace(...) cout<<"Line:"<<__LINE__<<" "; __f(#__VA_ARGS__, __VA_ARGS__)
template<typename Arg1>void __f(const char *name, Arg1 &&arg1) { cout<<name<<" : "<<arg1<<endl;}
template<typename Arg1, typename ... Args>void __f(const char *names, Arg1 &&arg1, Args &&... args) {
    const char *comma=strchr(names+1,','); cout.write(names,comma-names)<<" : "<<arg1<<" | ";
    __f(comma+1,args...);
}
#else
#define trace(...)
#define endl '\n'
#endif


int main() {
    cin.sync_with_stdio(0); cin.tie(0);
    cin.exceptions(cin.failbit);
	
	int n ; string S ;
	cin>>n>>S;
    string tmp = S.erase(unique(S.begin(), S.end()), S.end());
    cout<<tmp.size();
    

#ifdef np
    cerr <<endl<<endl<< "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif  
 return 0; 
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:39:25: error: conversion from 'std::__cxx11::basic_string<char>::iterator' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   39 |     string tmp = S.erase(unique(S.begin(), S.end()), S.end());
      |                  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin>>n;
  int a=0;
  vector<string> s(n);
  cin>>s[i];
  
  for(int i=0; i<n; i++){
    if(s[i]!=s[i+1])
      a++;
  }
  cout<<a+1<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: 'i' was not declared in this scope
    9 |   cin>>s[i];
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin>>n;
  int a=0;
  vector<int> s(n);
  for(int i=0; i<n; i++)
    cin>>s[i];
  
  for(int j=0; j<n; j++){
    if(s[i]!=s[i+1])
      a++;
  }
  cout<<a+1<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: 'i' was not declared in this scope
   13 |     if(s[i]!=s[i+1])
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin>>n;
  int a=0;
  vector<int> s(n);
  
  for(int i=0; i<n; i++){
    cin>>s[i];
    if(s[i]!=s[i+1])
      a++;
  cout<<a+1<<endl;
}


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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin>>n;
  int a=0;
  vestor<int> s(n);
  for(int i=0; i<n; i++)
    if(s[i]!=s[i+1])
      a++;
  cout<<a+1<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vestor' was not declared in this scope
    8 |   vestor<int> s(n);
      |   ^~~~~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vestor<int> s(n);
      |          ^~~
a.cc:10:8: error: 's' was not declared in this scope
   10 |     if(s[i]!=s[i+1])
      |        ^
Language: Java

import java.util.*;
public class main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String s = sc.next(),b ="";
		b += s.charAt(0);
		for(int i = 0;i<s.length();i++){
			
			if(i==s.length()-1){
				break;
			}
			else if(s.charAt(i)!=s.charAt(i+1))
				b+=s.charAt(i+1);
		}
		System.out.println(b.length());
	}

}


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

import java.util.*;
public class abc {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String s = sc.next(),b ="";
		b += s.charAt(0);
		for(int i = 0;i<s.length();i++){
			
			if(i==s.length()-1){
				break;
			}
			else if(s.charAt(i)!=s.charAt(i+1))
				b+=s.charAt(i+1);
		}
		System.out.println(b.length());
	}

}

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

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

int main(){
    int N; cin >> N;
    string color; cin >> color;
    char before = " ";
    int ans = 0;
    for( int i = 0; i < N; i++ ){
        if( color[i] == before ) continue;
        ans++;
        before = color[i];
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
    7 |     char before = " ";
      |                   ^~~
      |                   |
      |                   const char*
Language: C++

# include<bits/stdc++.h>
using namespace std;
int main(){
	long int n;
  	cin >> n;
  	string s;
  	// storing in string
  	getline(cin, s);
  	// body
  	long int res = 1;
  	for(iterator it=s.begin(); it!=s.end(); it++){
    	if(*it != *(it-1))
          res += 1;
    }
  // printing output
  cout << res <<'\n';
  
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:33: error: class template argument deduction failed:
   11 |         for(iterator it=s.begin(); it!=s.end(); it++){
      |                                 ^
a.cc:11:33: error: no matching function for call to 'iterator(std::__cxx11::basic_string<char>::iterator)'
In file included from /usr/include/c++/14/bits/stl_algobase.h:65,
                 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_iterator_base_types.h:127:34: note: candidate: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> iterator()-> std::iterator<_Category, _Tp, _Distance, _Pointer, _Reference>'
  127 |     struct _GLIBCXX17_DEPRECATED iterator
      |                                  ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:127:34: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/stl_iterator_base_types.h:127:34: note: candidate: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> iterator(std::iterator<_Category, _Tp, _Distance, _Pointer, _Reference>)-> std::iterator<_Category, _Tp, _Distance, _Pointer, _Reference>'
/usr/include/c++/14/bits/stl_iterator_base_types.h:127:34: note:   template argument deduction/substitution failed:
a.cc:11:33: note:   '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' is not derived from 'std::iterator<_Category, _Tp, _Distance, _Pointer, _Reference>'
   11 |         for(iterator it=s.begin(); it!=s.end(); it++){
      |                                 ^
Language: C++

# include<bits/stdc++.h>
using namespace std;
int main(){
	long int n;
  	cin >> n;
  	string s;
  	// storing in string
  	getline(cin, s);
  	// body
  	long int res = 1;
  	for(it=s.begin(); it!=s.end(); it++){
    	if(*it != *(it-1))
          res += 1;
    }
  // printing output
  cout << res <<'\n';
  
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: 'it' was not declared in this scope; did you mean 'int'?
   11 |         for(it=s.begin(); it!=s.end(); it++){
      |             ^~
      |             int
Language: C++

#include <iostream>
using namespace std;
int main() {
  int N; cin >> N;
  string s; cin >> s;
  char prev = '';
  int ans = 0;
  for (char c:s) {
    if (prev != c) {
      prev = c;
      ans++;
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc:6:15: error: empty character constant
    6 |   char prev = '';
      |               ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long n,c=0;
	cin>>n;
	char a[n];
	cin>>a;
	longlong min=int(a[0]),b;
	for(int i=0;i<n;i++)
	{
		b=int(a[i]);
		if(min!=b)
		{++c;
		min=b;
	}
}
cout<<c+1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'longlong' was not declared in this scope
    9 |         longlong min=int(a[0]),b;
      |         ^~~~~~~~
a.cc:12:17: error: 'b' was not declared in this scope
   12 |                 b=int(a[i]);
      |                 ^
Language: C++

include <bits/stdc++.h>
using namespace std;
int main(){
    int N;
    string S;
    cin >> N >> S;

    int sum = 1;
    for(int i = 0; i < N - 1; i++)if(S[i] != S[i + 1]) sum++;
    cout << sum << endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:5: error: 'string' was not declared in this scope
    5 |     string S;
      |     ^~~~~~
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> N >> S;
      |     ^~~
a.cc:6:17: error: 'S' was not declared in this scope
    6 |     cin >> N >> S;
      |                 ^
a.cc:10:5: error: 'cout' was not declared in this scope
   10 |     cout << sum << endl;
      |     ^~~~
a.cc:10:20: error: 'endl' was not declared in this scope
   10 |     cout << sum << endl;
      |                    ^~~~
Language: Java

import java.io.*;
import java.util.*;

public class C {

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null; }
        String next() { while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try { tokenizer = new StringTokenizer(reader.readLine()); } 
                catch (IOException e) { throw new RuntimeException(e);} }
            return tokenizer.nextToken(); }
        public int nextInt() { return Integer.parseInt(next()); }
        public long nextLong() { return Long.parseLong(next()); }
        public double nextDouble() { return Double.parseDouble(next()); }
    }

    static InputReader r = new InputReader(System.in);
    static PrintWriter pw = new PrintWriter(System.out);

    public static void main(String[] args) {
        
        int n = r.nextInt();
        String s = r.next();
        char cur = s.charAt(0);
        int ans = 1;
        for(int i = 1; i < n; i++){
            char c = s.charAt(i);
            if(c != cur){
                cur = c;
                ans++;
            }
        }   
        pw.println(ans);
        pw.close();
    }
}

/**
                _        _                 _                                                
               | |      | |               | |                                               
   ___ ___   __| | ___  | |__  _   _    __| | __ _ _ __ _ __ ___ _ __     _   _  __ _  ___  
  / __/ _ \ / _` |/ _ \ | '_ \| | | |  / _` |/ _` | '__| '__/ _ \ '_ \   | | | |/ _` |/ _ \ 
 | (_| (_) | (_| |  __/ | |_) | |_| | | (_| | (_| | |  | | |  __/ | | |  | |_| | (_| | (_) |
  \___\___/ \__,_|\___| |_.__/ \__, |  \__,_|\__,_|_|  |_|  \___|_| |_|   \__, |\__,_|\___/ 
                                __/ |                               ______ __/ |            
                               |___/                               |______|___/             
 */

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

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

int main() {
  int n;
  string s;

  cin >> n >> s;

  int total = 1;

  for(int i=1;i<n;i++) {
    if(s[i] != s[i-1]) {
      total++;
    }
  }

  cout << total << endl;
  return 0;
}

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

#include <iostream>
using namespace std;

int main() {
 	int n;
  char s1,s2;
  int ans = 0;
  cin >> n;
  for(int i=0; i!=n; i++){
    cin >> s2;
    if(s2 != s1){
      s1 = s2;
      ans += 1
    }else{
      continue;
    }
  }
  cout << ans << '\n';
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: expected ';' before '}' token
   13 |       ans += 1
      |               ^
      |               ;
   14 |     }else{
      |     ~
Language: C++

#include<iosteram>
using namespace std;

int main(){
	int n;
    std::string str;
  	cin>> n >>str;
  	cout<<n<<endl<<str<<endl;
	return 0;
}

Compiler output:
a.cc:1:9: fatal error: iosteram: No such file or directory
    1 | #include<iosteram>
      |         ^~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;

public class A{
	static int n;
	static String s;
	static Scanner sc = new Scanner(System.in);
	
	public static void main(String[] args){
		n = sc.nextInt();
		s = sc.next();
		System.out.println(calcSlimesNum());
	}
	
	static int calcSlimesNum(){
		int sameLength = 0, res = 1;
		char prevChar = 'p';
		
		for(int i = 0; i < n; ++i){
			if(sameLength == 0){
				prevChar = s.charAt(i);
				++sameLength;
			}else if(s.charAt(i) == prevChar){
				++sameLength;
			}else{
				prevChar = s.charAt(i);
				sameLength = 1;
				++res;
			}
		}
		return res;
	}
}

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

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

int main()
{
	int N;
  	string S;
	cin >> N >> S;
	int i,j;

	int ans;
	for(j=0;j<N;j++){
      if(S(j) != S(j+1)) ans++;
    }
        
	cout << ans;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int&)'
   13 |       if(S(j) != S(j+1)) ans++;
      |          ~^~~
a.cc:13:19: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int)'
   13 |       if(S(j) != S(j+1)) ans++;
      |                  ~^~~~~
Language: C++

#include <bits/stdc++.h>

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

	vector<string> S(N);
	for (int i = 0; i > N; i++) cin >> S.at(i);

	int ans;
	int m = 0;
	while (m < N) {
		while (S.at(m) == S.at(m + 1)) {
			m++;
		}
		ans++;
		m++;
	}
	cout << ans;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         cin >> N;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:9: error: 'vector' was not declared in this scope
    8 |         vector<string> S(N);
      |         ^~~~~~
a.cc:8:9: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:8:16: error: 'string' was not declared in this scope
    8 |         vector<string> S(N);
      |                ^~~~~~
a.cc:8:16: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:8:24: error: 'S' was not declared in this scope
    8 |         vector<string> S(N);
      |                        ^
a.cc:20:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |         cout << ans;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <bits/stdc++>

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

	vector<string> S(N);
	for (int i = 0; i > N; i++) cin >> S.at(i);

	int ans;
	int m = 0;
	while (m < N) {
		while (S.at(m) == S.at(m + 1)) {
			m++;
		}
		ans++;
		m++;
	}
	cout << ans;
	return 0;
}

}

Compiler output:
a.cc:1:10: fatal error: bits/stdc++: No such file or directory
    1 | #include <bits/stdc++>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main(){
  int n;
  cin>> n;
  string s;
  cin>> s;
  int ans=0;
  rep(i,n-1){
    if(s[i]!=s[1+!])++ans;
  }
       ans++;
       cout<< ans<< endl;
       return 0;
       }
       

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: expected primary-expression before ']' token
   12 |     if(s[i]!=s[1+!])++ans;
      |                   ^
Language: C++

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

int main(){
  int n;
  cin>> n;
  string s;
  cin>> s;
  int ans=0;
  rep(i,n-1){
    if(s[i]!=s[1+!] ++ans;
  }
       ans++;
       cout<< ans<< endl;
       return 0;
       }
       

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: expected primary-expression before ']' token
   12 |     if(s[i]!=s[1+!] ++ans;
      |                   ^
a.cc:13:3: error: expected primary-expression before '}' token
   13 |   }
      |   ^
a.cc:12:27: error: expected ')' before '}' token
   12 |     if(s[i]!=s[1+!] ++ans;
      |       ~                   ^
      |                           )
   13 |   }
      |   ~                        
a.cc:13:3: error: expected primary-expression before '}' token
   13 |   }
      |   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl 	"\n"
 
typedef vector< ll > 	vi;
typedef vector< vi > 	vvi;
typedef pair< ll,ll > 	ii;
#define pb 		push_back
#define all(c) 		(c).begin(),(c).end()
#define tr(c,i) 	for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x) 	((c).find(x) != (c).end())
 
#define MOD 	1000000007
#define INF 	(int)1e9
#define MEM(a, b) memset(a, (b), sizeof(a))
 
int main()
{	 ios_base::sync_with_stdio(false);
	 cin.tie(NULL);
	
	ll n;
	cin>>n;
	string s;
	cin>>s;
    stack<char>st;
    st.push(st[0]);
 for(ll i =0;i<n;i++)
 {
   if(s[i]!=st.top())
   {
     st.push(s[i]);
   }
 }
 cout<<st.size();
 return 0;
}
 
 
 
 

Compiler output:
a.cc: In function 'int main()':
a.cc:27:15: error: no match for 'operator[]' (operand types are 'std::stack<char>' and 'int')
   27 |     st.push(st[0]);
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl 	"\n"
 
typedef vector< ll > 	vi;
typedef vector< vi > 	vvi;
typedef pair< ll,ll > 	ii;
#define pb 		push_back
#define all(c) 		(c).begin(),(c).end()
#define tr(c,i) 	for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x) 	((c).find(x) != (c).end())
 
#define MOD 	1000000007
#define INF 	(int)1e9
#define MEM(a, b) memset(a, (b), sizeof(a))
 
int main()
{	 ios_base::sync_with_stdio(false);
	 cin.tie(NULL);
	
	ll n;
	cin>>n;
	string s;
	cin>>s;
    stack<char>st;
    st.push(st[0]);
 for(ll i =0;i<n;i++)
 {
   if(s[i]!=st.top())
   {
     st.pop();
   }
 }
 cout<<st.size();
 return 0;
}
 
 
 
 

Compiler output:
a.cc: In function 'int main()':
a.cc:27:15: error: no match for 'operator[]' (operand types are 'std::stack<char>' and 'int')
   27 |     st.push(st[0]);
      |               ^
Language: C++

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

int main(){
  int n;
  cin >> n;
  vector<int> vec(n);
  for(int i=0; i<n; i++){
    cin >> vec.at(i);
  }
  sort(vec.begin(),vec.end(),greater<int>());
  int ans = 0;
  int a,b,c;
  for(int i=0; i<n-2; i++){
    for(int j=i+1; j<n-1; j++){
      for(int k=j+1; k<n; k++){
        a = vec.at(i);
        b = vec.at(j);
        c = vec.at(k);
        if(a=>b+c)goto NEXT;
        if((c<a+b)&&(b<a+c))ans++;
      }
    }
    NEXT :
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: expected primary-expression before '>' token
   20 |         if(a=>b+c)goto NEXT;
      |              ^
a.cc:25:3: warning: label at end of compound statement only available with '-std=c++2b' or '-std=gnu++2b' [-Wc++23-extensions]
   25 |   }
      |   ^
Language: C++

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

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

  cout << str << endl;;

  for (int i = 0;i<s.size();i++) {
    if(s[i] != s[i+1]) ans++;
  }

  cout << ans << endl;
  
  return 0;
 }


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

#include <iostream>
using namespace std;
int min(void){
    // Your code here!
    int N;
    int slime=0;
    char S[100000];
    cin>> N;
    for(int i=0;i<N;i++)
    {
        cin >> S[i];
        slime++;
        if(i==0)
        {
            slime--;
            continue;
        }
        if(S[i-1]==S[i])
        {
            slime--;
        }
    }
    cout <<slime;
}


Compiler output:
a.cc: In function 'int min()':
a.cc:24:1: warning: no return statement in function returning non-void [-Wreturn-type]
   24 | }
      | ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <math.h>

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define repP(i, a, b) for(int i = a; i < b; i++)
#define repM(i, a, b) for(int i = a - 1; i >= b; i--)

using namespace std;

int main()
{
  int a = 0 , b = 0, c = 0, d = 0, e = 0, f = 0, i = 0, j = 0;
  int num = 0, count = 0, ans = 0;
  double d1 = 0, d2 = 0, d3 = 0, d4 = 0, d5 = 0, d6 = 0;
  int a1[256], a2[512], a3[1024];
  //char s1[200000], s2[200000], s3[200000];
  string s1, s2, s3;
  
  cin >> a >> s1;
  
  for(i = 0; i < a - 1; i++){
    if(s1[i] != s1[i]){
      count++;
    }
    cout << count << endl;
}


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

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

int main()
{
	int n=0, e=1;/*スライムの最初と最後の数*/
	char c[100000];/*スライムの色*/
	
	scanf("%d", &n);
	scanf("%s", c);
  
	for(int i=1, i<n, i++)
    {
    	if(c[i-1] == c[i])
        {
        	/*nothing*/
        }else{
        	e++;
        }
    }
  
    printf("%d", e);
 	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   12 |         for(int i=1, i<n, i++)
      |                       ^
main.c:23:9: error: expected expression before 'return'
   23 |         return 0;
      |         ^~~~~~
main.c:24:1: error: expected expression before '}' token
   24 | }
      | ^
Language: C

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

int main()
{
	int n=0, e=1;/*スライムの最初と最後の数*/
  　char c[100000];/*スライムの色*/
  
  　scanf("%d", &n);
    scanf("%s", c);
  
	for(int i=1, i<n, i++)
    {
    	if(c[i-1] == c[i])
        {
        	/*nothing*/
        }else{
        	e++;
        }
    }
  
    printf("%d", e);
 	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:3: error: stray '\343' in program
    7 |   <U+3000>char c[100000];/*<U+30B9><U+30E9><U+30A4><U+30E0><U+306E><U+8272>*/
      |   ^~~~~~~~
main.c:9:3: error: stray '\343' in program
    9 |   <U+3000>scanf("%d", &n);
      |   ^~~~~~~~
main.c:12:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   12 |         for(int i=1, i<n, i++)
      |                       ^
main.c:23:9: error: expected expression before 'return'
   23 |         return 0;
      |         ^~~~~~
main.c:24:1: error: expected expression before '}' token
   24 | }
      | ^
Language: C

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

int main()
{
	int n=0, e=1;/*スライムの最初と最後の数*/
  　char c[10*10*10*10*10];/*スライムの色*/
  
  　scanf("%d", &n);
    scanf("%s", c);
  
	for(int i=1, i<n, i++)
    {
    	if(c[i-1] == c[i])
        {
        	/*nothing*/
        }else{
        	e++;
        }
    }
  
    printf("%d", e);
 	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:3: error: stray '\343' in program
    7 |   <U+3000>char c[10*10*10*10*10];/*<U+30B9><U+30E9><U+30A4><U+30E0><U+306E><U+8272>*/
      |   ^~~~~~~~
main.c:9:3: error: stray '\343' in program
    9 |   <U+3000>scanf("%d", &n);
      |   ^~~~~~~~
main.c:12:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   12 |         for(int i=1, i<n, i++)
      |                       ^
main.c:23:9: error: expected expression before 'return'
   23 |         return 0;
      |         ^~~~~~
main.c:24:1: error: expected expression before '}' token
   24 | }
      | ^
Language: C

#include<stdio.h>

int main()
{
	int n=0, e=1;/*スライムの最初と最後の数*/
  　char c[10**5];/*スライムの色*/
  
  　scanf("%d", &n);
    scanf("%s", c);
  
	for(int i=1, i<n, i++)
    {
    	if(c[i-1] == c[i])
        {
        	/*nothing*/
        }else{
        	e++;
        }
    }
  
    printf("%d", e);
 	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:3: error: stray '\343' in program
    6 |   <U+3000>char c[10**5];/*<U+30B9><U+30E9><U+30A4><U+30E0><U+306E><U+8272>*/
      |   ^~~~~~~~
main.c:6:15: error: invalid type argument of unary '*' (have 'int')
    6 |   　char c[10**5];/*スライムの色*/
      |               ^~
main.c:8:3: error: stray '\343' in program
    8 |   <U+3000>scanf("%d", &n);
      |   ^~~~~~~~
main.c:11:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   11 |         for(int i=1, i<n, i++)
      |                       ^
main.c:22:9: error: expected expression before 'return'
   22 |         return 0;
      |         ^~~~~~
main.c:23:1: error: expected expression before '}' token
   23 | }
      | ^
Language: C++

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

#define ll long long
#define db double
#define ld long double
#define rep(i,n) for(int i=0;i<n;i++)
#define rev(i,n) for(int i=n;i>=0;i--)
#define rep_a(i,a,n) for(int i=a;i<n;i++)
#define tr(ds, it) for(auto it=ds.begin(); it!=ds.end(); it++)
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
typedef priority_queue <int> pq;
typedef vector< long long > vi;
typedef pair<long long, long long> ii;

const ll mod = 1000000007;
ll po(ll k, ll n ){ 
      if(n==1) return k%mod;
      else{
        ll a=po(k,n/2)%mod;
        if(n%2==0) return (a*a)%mod;
        else return (((a*a)%mod)*k)%mod;
      }
}


int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  // #ifndef ONLINE_JUDGE
  // freopen("input.txt", "r" , stdin);
  // freopen("output.txt", "w" , stdout);
  #endif
  int t=1;
  //cin >> t;
  while(t--){
    int n;
    cin >> n;
    string s;
    cin >> s;
    char x;
    int i=0, c=0;
    while(i<n){
      x=s[i];
      c++;
      while(s[i]==x && i<n) i++;
    }
    cout << c << endl;

  }

  return 0;
}


Compiler output:
a.cc:37:4: error: #endif without #if
   37 |   #endif
      |    ^~~~~
Language: C++

#include <iostream>
#include <string>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;

int main() {
	int n;
	int ans=1;
	string s;
	cin >> n >> s;

	for (int i = 0; i+1 < s.size(); i++) {
		if (s[i] != s[i + 1]) ans++;
	}
	cout << ans << endl;
	retu

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'retu' was not declared in this scope
   18 |         retu
      |         ^~~~
a.cc:18:13: error: expected '}' at end of input
   18 |         retu
      |             ^
a.cc:8:12: note: to match this '{'
    8 | int main() {
      |            ^
Language: C++

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String s = scanner.nextLine();
		int n = Integer.parseInt(s);
		s = scanner.nextLine();
		int count = 0;
		char last_char = '\0';
		for(int i = 0; i < n; i++){
			char c = s.charAt(i);
			if(last_char != c) {
				count++;
				last_char = c;
			}
		}
		System.out.println(count);
	}

}


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

import java.util.Scanner;

public class Slims {
	
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		
		String ns = s.nextLine();	
		
		String str = s.nextLine();
		
		int n = Integer.parseInt(ns);
		
		char arr[] = str.toCharArray();

		int count = 1;
		for(int i = 0; i < arr.length; i++) {
			if(i == 0) {
				continue;
			}
			if(arr[i] != arr[i-1]) {
				count++;
			}
		}
		System.out.println(count);
	}

}

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

#include <iostream>
using namespace std;

int main(){
	int N;
	cin>>N;
	char *moji1=new char[N+1];
	cin>>moji1;
	int a=0;
	for(int i=0;i<N-1;i++){
		if(*(moji1+i)==*(moji1+i+1))continue;
		a++;
	}
	cout<<++a;
}

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

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

int main() {
    int N;
    string S;
    cin >> N >> S;
    
    int res;
    for（int i=0; i<N; i++) {
            int j = i;
            while(j<N && S[i]==S[j]) j++;
            i = j; res++;
            }
            cout << res << endl;
        }


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'for\U0000ff08int' was not declared in this scope
   11 |     for（int i=0; i<N; i++) {
      |     ^~~~~~~~
a.cc:11:19: error: 'i' was not declared in this scope
   11 |     for（int i=0; i<N; i++) {
      |                   ^
Language: C++

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

int main() {
    int N;
    string S;
    cin >> N >> S;
    
    int res;
    for（int i=0; i<N; i++) {
            int j = i;
            while(j<N && S[i]==S[j]) j++;
            i = j; res++;
            }
            cout << res << endl;
        }

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'for\U0000ff08int' was not declared in this scope
   11 |     for（int i=0; i<N; i++) {
      |     ^~~~~~~~
a.cc:11:19: error: 'i' was not declared in this scope
   11 |     for（int i=0; i<N; i++) {
      |                   ^
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define maxn 100010
char ss[maxn];
int main()
{
	int n;
	cin>>n;
	gets(ss);
	int siz=sizeof(ss);
	char pre;
	pre=ss[0];
	int cnt=0;
	for(int i=1;i<siz;i++)
	{
		if(pre!=ss[i])
		{
			cnt++;
			pre=ss[i];
		 } 
	}
	cout<<cnt;
	return 0;
 } 

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

#include<stdio.h>
int main(void)
{
int n,i,j,count=1;
char s[100005];
scanf("%d",&n);
scanf("%s",&s);
 
  for(i=0;i<n-1;i++)
  {
   if(s[i+1]!=s[i])
    count++;
  }
  printf("%d",count);
count = 0;
return 0;
}
#include<stdio.h>
int main(void)
{
int n,i,j,count=1;
char s[100005];
scanf("%d",&n);
scanf("%s",&s);

  for(i=0;i<n-1;i++)
  {
   if(s[i+1]!=s[i])
    count++;
  }
  printf("%d",count);
count = 0;
return 0;
}

Compiler output:
main.c:19:5: error: redefinition of 'main'
   19 | int main(void)
      |     ^~~~
main.c:2:5: note: previous definition of 'main' with type 'int(void)'
    2 | int main(void)
      |     ^~~~
Language: C++

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

int main(){
  int n;
  cin >> n;
  string s;
  cin >> s;
  s.push_back("#");
  int ans = 0;
  rep(i,n){
    if(s[i]!=s[i+1]) ans++;
  }
  
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   11 |   s.push_back("#");
      |               ^~~
      |               |
      |               const char*
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1572:24: note:   initializing argument 1 of 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::push_back(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 1572 |       push_back(_CharT __c)
      |                 ~~~~~~~^~~
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int n,sum;
char prev = 'A';
char a[100001];
int main(){
	cin>>n;
	cin>>a;
	for(int i=0;i<n;i++)
	{
		if(a[i]==prev)continue;
		else{
			sum++;
			prev = a[i];
		}
	}
	cout<<sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: error: reference to 'prev' is ambiguous
   12 |                 if(a[i]==prev)continue;
      |                          ^~~~
In file included from /usr/include/c++/14/string:47,
                 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/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
  244 |     prev(_BidirectionalIterator __x, typename
      |     ^~~~
a.cc:5:6: note:                 'char prev'
    5 | char prev = 'A';
      |      ^~~~
a.cc:15:25: error: reference to 'prev' is ambiguous
   15 |                         prev = a[i];
      |                         ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
  244 |     prev(_BidirectionalIterator __x, typename
      |     ^~~~
a.cc:5:6: note:                 'char prev'
    5 | char prev = 'A';
      |      ^~~~
Language: C++

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

string erased(str, num){
  if(num < (str.size()-1) && str[num]==str[num+1]){
    str.erase(str.begin()+num+1);
    erased(str, num);
  }
  else return str;
}

int main() {
  int n;
  string s;
  cin >> n >> s;
  for(int i=0; i<(n-1); ++i){
    s = erased(s, i);
  }
  cout << s.size() << endl;
  return 0;
}

Compiler output:
a.cc:4:15: error: 'str' was not declared in this scope; did you mean 'std'?
    4 | string erased(str, num){
      |               ^~~
      |               std
a.cc:4:20: error: 'num' was not declared in this scope; did you mean 'enum'?
    4 | string erased(str, num){
      |                    ^~~
      |                    enum
a.cc:4:24: error: expected ',' or ';' before '{' token
    4 | string erased(str, num){
      |                        ^
a.cc: In function 'int main()':
a.cc:17:15: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (std::string&, int&)'
   17 |     s = erased(s, i);
      |         ~~~~~~^~~~~~
Language: Java

import java.util.*;

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

        Scanner sc = new Scanner(System.in);

        int idk = sc.nextInt();

        sc.nextLine();

        String S = sc.nextLine();

        for(int i = 0; i < idk; i+=0) {
            if(S.length()==1)
              break;
            char currentChar = S.charAt(i);
            char nextChar = S.charAt(i+1);
            boolean same = (currentChar == nextChar);
            if(same) {
              S = S.substring(0, i) + S.substring(i+1);
            } else {
                i++;
            }
        }

        System.out.println(S.length());
    }
}

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

#include <stdio.h>

int main(void) {
	int n a;
	scanf("%d",&n);
  a=n;
	char s[n];
	for(int i=0;i<n;i++){
      scanf("%s",s[i]);
    }
  for(int i=0;i<n-1;i++){
    if("s[i]"=="s[i+1]"){
      a--;
    }
    printf("%d",a);
    
  
  
	// your code goes here
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:4:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a'
    4 |         int n a;
      |               ^
main.c:4:15: error: 'a' undeclared (first use in this function)
main.c:4:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:21: error: 'n' undeclared (first use in this function)
    5 |         scanf("%d",&n);
      |                     ^
main.c:21:1: error: expected declaration or statement at end of input
   21 | }
      | ^