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

#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;


int main() {
	int n;
	string s;
	cin >> n >> s;
	bool flag;
	int last;
	int search,index;
	int cnt = 0;
	vector<int> v[10];
	for (int i = 0;i < s.length();i++) {
		v[atoi(s.substr(i, 1).c_str())].push_back(i);
	}
	for (int i = 0;i < 1000;i++) {
		last = -1;
		flag = true;
		for (int j = 0;j < 3;j++) {
			search = (i / (int)pow(10, j)) % 10;
			index = upper_bound(v[search].begin(), v[search].end(), last) - v[search].begin();
			if (index >= v[search].size()) {
				flag = false;
				break;
			}
			else {
				last = v[search][index];
			}
		}
		if (flag)cnt++;
	}
	cout << cnt << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:44: error: 'pow' was not declared in this scope
   24 |                         search = (i / (int)pow(10, j)) % 10;
      |                                            ^~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;


int main() {
	int n;
	string s;
	cin >> n >> s;
	bool flag;
	int keta;
	int cnt = 0;
	for (int i = 0;i < 1000;i++) {
		keta = 0;
		flag = false;
		for (int j = 0;j < s.length();j++) {
			if (atoi(s.substr(j,1).c_str()) == (i/(int)pow(10,keta))%10){
				keta++;
			}
			if (keta == 3) {
				flag = true;
				break;
			}
		}
		if (flag)cnt++;
	}
	cout << cnt << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:68: error: 'pow' was not declared in this scope
   19 |                         if (atoi(s.substr(j,1).c_str()) == (i/(int)pow(10,keta))%10){
      |                                                                    ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
#define _GLIBCXX_DEBUG
     
int main() {
  int n;
  string s;
  cin >> n >> s;

  set<int> set;
  for (int i=0; i<n-2; ++i) {
    for (int j=i+1; j<n-1; ++j){
      set<int> checkset;
      for (int k=j+1; k<n; ++k) {
        if (!checkset.count(s.at(i) * 100 + s.at(j) * 10 + s.at(k))) {
          checkset.insert(s.at(i) * 100 + s.at(j) * 10 + s.at(k));
        }
        else break;
        if (!set.count(s.at(i) * 100 + s.at(j) * 10 + s.at(k))) {
          set.insert(s.at(i) * 100 + s.at(j) * 10 + s.at(k));
        }
      }
    }
  }
  cout << set.size() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:11: error: expected primary-expression before 'int'
   15 |       set<int> checkset;
      |           ^~~
a.cc:17:14: error: 'checkset' was not declared in this scope
   17 |         if (!checkset.count(s.at(i) * 100 + s.at(j) * 10 + s.at(k))) {
      |              ^~~~~~~~
Language: C++

'''
暗証番号3桁はたかだか10**3の候補。これを全探索で調べるだけ
pythonのindex関数を使用するとオブジェクト内に要素が存在しない場合エラーになる
'''
n = int(input())
s = [int(i) for i in input()]

def my_index(l,x,ind):
    '''
    l: イテラブル(for inで取り出せる)オブジェクト
    x: 探し出す大賞
    ind: イテラブルで探し始める位置（インデックス）
    返り値: 存在する場合はそのインデックス、存在しない場合は-1
    '''
    global n #入力のnと同一のものであるという意味
    if ind == n: #探索するものがない場合
        return -1
    for i in range(ind, n):
        if l[i] == x:
            return i
    else:
        return -1
c = 0
for i in range(10):
    x1 = my_index(s,i,0)
    if x1 != -1:
        for j in range(10):
            x2 = my_index(s,j,x1+1)
            if x2 != -1:
                for k in range(10):
                    x3 = my_index(s,k,x2+1)
                    if x3 != -1:
                        c += 1
print(c)

Compiler output:
a.cc:1:1: error: empty character constant
    1 | '''
      | ^~
a.cc:1:3: warning: missing terminating ' character
    1 | '''
      |   ^
a.cc:1:3: error: missing terminating ' character
a.cc:2:26: error: extended character 。 is not valid in an identifier
    2 | 暗証番号3桁はたかだか10**3の候補。これを全探索で調べるだけ
      |                          ^
a.cc:4:1: error: empty character constant
    4 | '''
      | ^~
a.cc:4:3: warning: missing terminating ' character
    4 | '''
      |   ^
a.cc:4:3: error: missing terminating ' character
a.cc:9:5: error: empty character constant
    9 |     '''
      |     ^~
a.cc:9:7: warning: missing terminating ' character
    9 |     '''
      |       ^
a.cc:9:7: error: missing terminating ' character
a.cc:13:13: error: extended character 、 is not valid in an identifier
   13 |     返り値: 存在する場合はそのインデックス、存在しない場合は-1
      |             ^
a.cc:14:5: error: empty character constant
   14 |     '''
      |     ^~
a.cc:14:7: warning: missing terminating ' character
   14 |     '''
      |       ^
a.cc:14:7: error: missing terminating ' character
a.cc:15:14: error: stray '#' in program
   15 |     global n #入力のnと同一のものであるという意味
      |              ^
a.cc:16:18: error: stray '#' in program
   16 |     if ind == n: #探索するものがない場合
      |                  ^
a.cc:1:1: error: expected unqualified-id before '\x0'
    1 | '''
      | ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N;
    string S;
    cin >> N >> S;
    int res=0;
    for(int i=0;i<1000;i++){
        char one='0'+(i/100);
        char two='0'+(i%100/10);
        char three='0'+(i%100%10);
        int ptr=0;
        bool  a,b,c=false;
        for(int j=ptr;j<S.size()-2;j++){
            if(S.at(j)==one){
                ptr=j+1;
                a=true;
                break;
            }
        }
        for(int j=ptr;j<S.size()-1;j++){
            if(S.at(j)==two){
                ptr=j+1;
                b=true;
                break;
            }
        }
        for(int j=ptr;j<S.size();j++){
            if(S.at(j==three){
                c=true;
                break;
            }
        }
        if(a&&b&&c) res++;
    }
    cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:30: error: expected ')' before '{' token
   30 |             if(S.at(j==three){
      |               ~              ^
      |                              )
a.cc:34:9: error: expected primary-expression before '}' token
   34 |         }
      |         ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  
  
  int ans = 0;
  for (int i = 0; i < 10; i++)  {
    for (int j = 0; j < 10; j++) {
      for (int k = 0; k < 10; k++) {
        bool cond1 = false;
        bool cond2 = false;
        for (l = 0; l < S.size(); l++) {
          if (S.at(l) == char(l)) {
            cond1 = true;
          } 
          if (cond1 && S.at(l) == char(j)) {
            cond2 = true;
          }
          if (cond1 && cond2 && S.at(l) == char(k)) {
            ans++;
            break;
          }
        }
      }
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: 'l' was not declared in this scope
   17 |         for (l = 0; l < S.size(); l++) {
      |              ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
  int n;
  string s;
  cin >> n >> s;
  int ans = 0;
  rep(i,1000){
    int a = i%10;
    int b = (i%100 - a)/10;
    int c = i/100;
    bool ok1 = false, ok2 = false, ok3 = false;
    rep(j,n){
      if(s[j] == c && !ok1){ ok1 = true; continue; }
      if(s[j] == b && ok1 && !ok2){ ok2 = true; continue;}
      if(s[j] == a && ok1 && ok2){ ok3 = ture; }
    }
    if(ok3) ans++;
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:42: error: 'ture' was not declared in this scope
   17 |       if(s[j] == a && ok1 && ok2){ ok3 = ture; }
      |                                          ^~~~
Language: C++

#include <iostream>
using namespace std;


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

	int res = 0;

	char pin_s[4] = "000";
	for (int pin = 0; pin < 1000; ++pin) {
		vsprintf(pin_s, "%03d", pin);
		int state = 0;
		for (int i = 0; i < n; ++i) {
			if (s[i] == pin_s[state]) {
				state++;
				if (state == 3) {
					res++;
					break;
				}
			}
		}
	}

	cout << res << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:41: error: invalid conversion from 'int' to '__va_list_tag*' [-fpermissive]
   15 |                 vsprintf(pin_s, "%03d", pin);
      |                                         ^~~
      |                                         |
      |                                         int
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/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/stdio.h:381:37: note:   initializing argument 3 of 'int vsprintf(char*, const char*, __va_list_tag*)'
  381 |                      __gnuc_va_list __arg) __THROWNL;
      |                      ~~~~~~~~~~~~~~~^~~~~
Language: C++

# include <bits/stdc++.h>
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>0; --i)
# define range_for(i, b, e) for(int i=(b), i##_len=(e); i<=i##_len; ++i)
# define ALL(x) (x).begin(), (x).end()
# define RALL(x) (x).rbegin(), (x).rend()
# define pb push_back
# define len(x) ((int)(x).size())
# define optimize_cin() cin.tie(0); ios::sync_with_stdio(false)
# define debug(x) std::cerr<<#x<<": "<<(x)<<endl;
# define LINT_MAX (LONG_LONG_MAX)
# define cauto const auto
using namespace std;
using lint = long long;
template <class Type> inline constexpr bool InRange(const Type& x, const Type& i, const Type& a) { return (i <= x) && (x <= a); }
template<class Integer>bool chmax(Integer &a, const Integer &b) { if (a<b) { a=b; return 1; } return 0; }
template<class Integer>bool chmin(Integer &a, const Integer &b) { if (b<a) { a=b; return 1; } return 0; }
template<class Integer>bool IsOdd(Integer &n) { return n & 1; }
template<class Integer>bool IsEven(Integer &n) { return !(n & 1); }
int ctoi(const char c) { return ('0' <= c && c <= '9') ? (c - '0') : -1; }
string YesNo(bool b) { return b ? "Yes" : "No"; }
string YESNO(bool b) { return b ? "YES" : "NO"; }
string yesno(bool b) { return b ? "yes" : "no"; }
int dy[4] = {0, 1, 0, -1};
int dx[4] = {1, 0, -1, 0};

// 整数の桁数を返す ( log(N) )
template <class Integer> Integer GetDigit(Integer n) {
    if (n == 0) return 1;
    Integer d = 0;
    while (n) {
        n /= 10;
        d++;
    }
    return d;
}

// 素数かどうかを返す ( O(sqrt(N)) )
template <class Integer>
constexpr bool IsPrime(const Integer n) noexcept {
    if (n < 4) return n == 2 || n == 3;
    if (n % 2 == 0 || n % 3 == 0 || (n % 6 != 1 && n % 6 != 5)) return false;
    for (Integer i = 5; i * i <= n; i += 6) if (n % i == 0 || n % (i + 2) == 0) return false;
    return true;
}

// 1e4
int main()
{
    int N; cin >> N;
    string S; cin >> S;

    int ans = 0;
    range_for (i, 0, 999)
    {
        string sub(3-GetDigit(i), '0') + to_string(i);

        int cur = 0;
        rep (i, N)
        {
            if (S[i] == sub[cur]) cur++;
            if (cur == 3) break;
        }
        if (cur == 3)
        {
            ans++;
        }
    }

    cout << ans << endl;

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:58:40: error: expected ',' or ';' before '+' token
   58 |         string sub(3-GetDigit(i), '0') + to_string(i);
      |                                        ^
Language: C++

# include <bits/stdc++.h>
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>0; --i)
# define range_for(i, b, e) for(int i=(b), i##_len=(e); i<=i##_len; ++i)
# define ALL(x) (x).begin(), (x).end()
# define RALL(x) (x).rbegin(), (x).rend()
# define pb push_back
# define len(x) ((int)(x).size())
# define optimize_cin() cin.tie(0); ios::sync_with_stdio(false)
# define debug(x) std::cerr<<#x<<": "<<(x)<<endl;
# define LINT_MAX (LONG_LONG_MAX)
# define cauto const auto
using namespace std;
using lint = long long;
template <class Type> inline constexpr bool InRange(const Type& x, const Type& i, const Type& a) { return (i <= x) && (x <= a); }
template<class Integer>bool chmax(Integer &a, const Integer &b) { if (a<b) { a=b; return 1; } return 0; }
template<class Integer>bool chmin(Integer &a, const Integer &b) { if (b<a) { a=b; return 1; } return 0; }
template<class Integer>bool IsOdd(Integer &n) { return n & 1; }
template<class Integer>bool IsEven(Integer &n) { return !(n & 1); }
int ctoi(const char c) { return ('0' <= c && c <= '9') ? (c - '0') : -1; }
string YesNo(bool b) { return b ? "Yes" : "No"; }
string YESNO(bool b) { return b ? "YES" : "NO"; }
string yesno(bool b) { return b ? "yes" : "no"; }
int dy[4] = {0, 1, 0, -1};
int dx[4] = {1, 0, -1, 0};

// 整数の桁数を返す ( log(N) )
template <class Integer> Integer GetDigit(Integer n) {
    Integer d = 0;
    while (n) {
        n /= 10;
        d++;
    }
    return d;
}


// 1e4
int main()
{
    int N; cin >> N;
    string S; cin >> S;

    int ans = 0;
    range_for (i, 0, 999)
    {
        string sub(3-GetDigit(i), '0') + to_string(i);

        int cur = 0;
        rep (i, N)
        {
            if (S[i] == sub[cur]) cur++;
            if (cur == 3) break;
        }
        if (cur == 3)
        {
            ans++;
        }
    }

    cout << ans << endl;

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:49:40: error: expected ',' or ';' before '+' token
   49 |         string sub(3-GetDigit(i), '0') + to_string(i);
      |                                        ^
Language: C++

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

int main() {
	int n;
	string s;
	vector<int> p(1000);
	
	cin>>n>>s;
	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++){
				string b = s[i]+s[j]+s[k];
				int a=stoi(b);
				if(p[a]==0)p[a]=1;
			}
		}
	}
	
	int sum=0;
	for(int i=0;i<1000;i++){
		sum+=p[i];
	}
	
	cout<<sum<<endl;
}

/*
配列の重複の処理について
stringでエラーがでるなぞ
*/


Compiler output:
a.cc: In function 'int main()':
a.cc:13:53: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   13 |                                 string b = s[i]+s[j]+s[k];
Language: C++

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

int main() {
	int n;
	string s;
	vector<int> p(1000);
	
	cin>>n>>s;
	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++){
				string b = s[i]+s[j]+s[k];
				int a=std::stoi(b);
				if(p[a]==0)p[a]=1;
			}
		}
	}
	
	int sum=0;
	for(int i=0;i<1000;i++){
		sum+=p[i];
	}
	
	cout<<sum<<endl;
}

/*
配列の重複の処理について
*/


Compiler output:
a.cc: In function 'int main()':
a.cc:13:53: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   13 |                                 string b = s[i]+s[j]+s[k];
Language: C++

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

int main() {
	int n;
	string s;
	vector<int> p(1000);
	
	cin>>n>>s;
	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++){
				std::string b = s[i]+s[j]+s[k]
				int a=std::stoi(b);
				if(p[a]==0)p[a]=1;
			}
		}
	}
	
	int sum=0;
	for(int i=0;i<1000;i++){
		sum+=p[i];
	}
	
	cout<<sum<<endl;
}

/*
配列の重複の処理について
*/


Compiler output:
a.cc: In function 'int main()':
a.cc:13:58: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   13 |                                 std::string b = s[i]+s[j]+s[k]
a.cc:14:33: error: expected ',' or ';' before 'int'
   14 |                                 int a=std::stoi(b);
      |                                 ^~~
a.cc:15:38: error: 'a' was not declared in this scope
   15 |                                 if(p[a]==0)p[a]=1;
      |                                      ^
Language: C++

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

int main() {
	int n;
	string s;
	vector<int> p(1000);
	
	cin>>n>>s;
	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++){
				int a=std::stoi(s[i]+s[j]+s[k]);
				if(p[a]==0)p[a]=1;
			}
		}
	}
	
	int sum=0;
	for(int i=0;i<1000;i++){
		sum+=p[i];
	}
	
	cout<<sum<<endl;
}

/*
配列の重複の処理について
*/


Compiler output:
a.cc: In function 'int main()':
a.cc:13:48: error: no matching function for call to 'stoi(int)'
   13 |                                 int a=std::stoi(s[i]+s[j]+s[k]);
      |                                       ~~~~~~~~~^~~~~~~~~~~~~~~~
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:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from 'int' to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from 'int' to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C++

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

int main() {
	int n;
	string s;
	vector<int> p(1000);
	
	cin>>n>>s;
	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++){
				int a=stoi(s[i]+s[j]+s[k]);
				if(p[a]==0)p[a]=1;
			}
		}
	}
	
	int sum=0;
	for(int i=0;i<1000;i++){
		sum+=p[i];
	}
	
	cout<<sum<<endl;
}

/*
配列の重複の処理について
*/


Compiler output:
a.cc: In function 'int main()':
a.cc:13:43: error: no matching function for call to 'stoi(int)'
   13 |                                 int a=stoi(s[i]+s[j]+s[k]);
      |                                       ~~~~^~~~~~~~~~~~~~~~
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:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from 'int' to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from 'int' to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C++

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

int main() {
	int n;
	string s;
	vector<int> p(1000);
	
	cin>>n>>s;
	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++){
				int a=stoi(string[i]+string[j]+string[k]);
				if(p[a]==0)p[a]=1;
			}
		}
	}
	
	int sum=0;
	for(int i=0;i<1000;i++){
		sum+=p[i];
	}
	
	cout<<sum<<endl;
}

/*
配列の重複の処理について
*/


Compiler output:
a.cc: In function 'int main()':
a.cc:13:50: error: expected primary-expression before '[' token
   13 |                                 int a=stoi(string[i]+string[j]+string[k]);
      |                                                  ^
a.cc:13:60: error: expected primary-expression before '[' token
   13 |                                 int a=stoi(string[i]+string[j]+string[k]);
      |                                                            ^
a.cc:13:70: error: expected primary-expression before '[' token
   13 |                                 int a=stoi(string[i]+string[j]+string[k]);
      |                                                                      ^
Language: C++

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

int main() {
	int n;
	string s;
	vector<int> p(1000);
	
	cin>>n>>s;
	for(int i=0;i<n-2;i++){
		for(int j=i+1;j<n-1){
			for(int k=j+1;j<n;j++){
				int a=stoi(string[i]+string[j]+string[k]);
				if(p[a]==0)p[a]=1;
			}
		}
	}
	
	int sum=0;
	for(int i=0;i<1000;i++){
		sum+=p[i];
	}
	
	cout<<sum<<endl;
}

/*
配列の重複の処理について
*/


Compiler output:
a.cc: In function 'int main()':
a.cc:11:36: error: expected ';' before ')' token
   11 |                 for(int j=i+1;j<n-1){
      |                                    ^
      |                                    ;
a.cc:13:50: error: expected primary-expression before '[' token
   13 |                                 int a=stoi(string[i]+string[j]+string[k]);
      |                                                  ^
a.cc:13:60: error: expected primary-expression before '[' token
   13 |                                 int a=stoi(string[i]+string[j]+string[k]);
      |                                                            ^
a.cc:13:70: error: expected primary-expression before '[' token
   13 |                                 int a=stoi(string[i]+string[j]+string[k]);
      |                                                                      ^
Language: C++

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

string S; int N, cnt;

int main() {
	cin >> N >> S;
	for (int i = 0; i < 1000; i++) {
		int c[3] = {i / 100, (i / 10) % 10, i % 10};
		int f = 0;
		for (int j = 0; j < N; j++) {
			// if (S[j] == ('0' + c[f])) f++;
			if (c[f] == (S[j] - '0') f++;
			if (f == 3) break;
		}
		if (f == 3) cnt++;
	}
	cout << cnt << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:49: error: expected ';' before 'f'
   13 |                         if (c[f] == (S[j] - '0') f++;
      |                                                 ^~
      |                                                 ;
a.cc:14:25: error: expected primary-expression before 'if'
   14 |                         if (f == 3) break;
      |                         ^~
a.cc:13:54: error: expected ')' before 'if'
   13 |                         if (c[f] == (S[j] - '0') f++;
      |                            ~                         ^
      |                                                      )
   14 |                         if (f == 3) break;
      |                         ~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    string s;
    cin >> n >> s;
    int cnt=0;
    for(int i=0;i<1000;i++){
        int c[3]={i/100,(i/10)%10,i%10};
        int f=0;
        for(j=0;j<n;j++){
            if(s[j]==('0'+c[f]))f++;//c[f]を文字コードにしてる
            if(f==3)break;
        }
        if(f==3)cnt++;
    }
}

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

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

int main ()
{
	int n;
  	cin >> n, cnt;
  	string lucky;
  	cin >> lucky;
  	cnt == 0;
  	for (int i = 0; i < 1000; i++)
    {
    	vector<int> f(3);
      	f = {i / 100,(i / 10) % 10, i % 10};
      	int c = 0;
      	for (int j = 0; j < n; j++)
        {
        	if (lucky.at(j) == f.at(c))
            {
            	c;;+
            }
          	if (c == 3)
            {
            	break;
            }
        }
      	if (c == 3)
        {
        	cnt++;
        } 
    }
  	cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: 'cnt' was not declared in this scope; did you mean 'int'?
    7 |         cin >> n, cnt;
      |                   ^~~
      |                   int
a.cc:21:13: error: expected primary-expression before '}' token
   21 |             }
      |             ^
Language: C++

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

int main ()
{
	int n;
  	cin >> n;
  	string lucky;
  	cin >> lucky;
  	vector<string> pass(n-2);
  	for (int i = 0; i < n-2; i++)
    {
    	pass.push_back(lucky.at(i)+lucky.at(i+1)+lucky.at(i+2));
    }
  	auto itr = uniq(pass.begin(), pass.end());
  	pass.erase(itr, pass.end());
  	cout << pass.size() << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:23: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::push_back(int)'
   13 |         pass.push_back(lucky.at(i)+lucky.at(i+1)+lucky.at(i+2));
      |         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'int' to 'const std::vector<std::__cxx11::basic_string<char> >::value_type&' {aka 'const std::__cxx11::basic_string<char>&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'int' to 'std::vector<std::__cxx11::basic_string<char> >::value_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:15:20: error: 'uniq' was not declared in this scope; did you mean 'unix'?
   15 |         auto itr = uniq(pass.begin(), pass.end());
      |                    ^~~~
      |                    unix
Language: C++

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

int main ()
{
	int n;
  	cin >> n;
  	string lucky;
  	cin >> lucky;
  	vector<string> pass(n-2);
  	for (int i = 0; i < n-2; i++)
    {
    	pash.push_back(lucky.at(i)+lucky.at(i+1)+lucky.at(i+2));
    }
  	auto itr = uniq(pass.begin(), pass.end());
  	pass.erase(itr, pass.end());
  	cout << pass.size() << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'pash' was not declared in this scope; did you mean 'pass'?
   13 |         pash.push_back(lucky.at(i)+lucky.at(i+1)+lucky.at(i+2));
      |         ^~~~
      |         pass
a.cc:15:20: error: 'uniq' was not declared in this scope; did you mean 'unix'?
   15 |         auto itr = uniq(pass.begin(), pass.end());
      |                    ^~~~
      |                    unix
Language: C++

#include<iostream>
#include <cstdio>
#include<cstring>
#include<string>
#include <cstdlib>  
#include<cmath>   
#include <cctype>
#include<string>
#include<set>
#include <iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include<list>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility>
#define LEN 100005
using namespace std;
using ll = long long;
double pi() { return 3.14; }
int sum(int a, int b) { return a + b; }
int mul(int a, int b) { return a * b; }
ll LGCD(ll x, ll y) { if (x % y == 0) return y;else return LGCD(y, x % y); }
ll LLCM(ll x, ll y) { return x * y / LGCD(x, y); }

int GCD(int x, int y) { if (x % y == 0) return y;else return GCD(y, x % y); }
int LCM(int x, int y) { return x * y / GCD(x, y); }
ll dpc[10000][10000];

//void nCr(ll n, ll r) {
//	ll ans = 1;
//	for (int i = n; i > n - r; --i) {
//		ans = ans * i;
//	}
//	for (int i = 1; i < r + 1; ++i) {
//		ans = ans / i;
//	}
//	printf("%d",ans);
//}

ll combination(ll n, ll r) {
	if (n == r) { return dpc[n][n] = 1; }
	else if (r == 0) { return dpc[n][0] = 1; }
	else if (r == 1) { return dpc[n][1] = n; }
	else if (dpc[n][r]) { return dpc[n][r]; }
	else { return dpc[n][r] = combination(n - 1, r - 1) + combination(n - 1, r); }
}

//cout << fixed << setprecision(10);

int main() {
	int n;
	string s;
	cin >> n >> s;
	int  ans = 0;
	for (int i = 0;i < 10;i++) {
		for (int j = 0;j < 10;j++) {
			for (int k = 0;k < 10;k++) {
				int count = 0;
				for (int l = 0;l < s.size();l++) {
					if (s[l] - '0' == i&&count==0) count++;
					else if (s[l] - '0' == j && count == 1)count++;
					else if (s[l] - '0' == k && count == 2) {
						count++;break;
				}if (count == 3)ans++;

			}
		}
	}

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


Compiler output:
a.cc: In function 'int main()':
a.cc:79:2: error: expected '}' at end of input
   79 | }
      |  ^
a.cc:57:12: note: to match this '{'
   57 | int main() {
      |            ^
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();
		String buf = " ";
		int ans = 0;
		int a,b,c;
		boolean[] list = new boolean[1000];
		Arrays.fill(list,false);
		for(char i = '0';i < '10';i++){
			if(S.indexOf(i) != -1){
				buf = S.substring(S.indexOf(i));
			}else{
				break;
			}
			for(char j = '0';j < '10';j++){
				if(buf.indexOf(j) != -1){
					buf = buf.substring(buf.indexOf(j));
				}else{
					break;
				}
				for(char k = '0';k < '10';k++){
					if(buf.indexOf(k) != -1){
						a = i - '0';
						b = j - '0';
						c = k - '0';
						list[a * 100 + b * 10 + c] = true;
					}
				}
			}
		}
		for(int i = 0;i < 1000;i++){
			if(list[i]){
				ans++;
			}
		}
		System.out.println(ans);
	}
}

Compiler output:
Main.java:12: error: unclosed character literal
		for(char i = '0';i < '10';i++){
		                     ^
Main.java:12: error: unclosed character literal
		for(char i = '0';i < '10';i++){
		                        ^
Main.java:12: error: ';' expected
		for(char i = '0';i < '10';i++){
		                             ^
Main.java:18: error: unclosed character literal
			for(char j = '0';j < '10';j++){
			                     ^
Main.java:18: error: unclosed character literal
			for(char j = '0';j < '10';j++){
			                        ^
Main.java:18: error: ';' expected
			for(char j = '0';j < '10';j++){
			                             ^
Main.java:24: error: unclosed character literal
				for(char k = '0';k < '10';k++){
				                     ^
Main.java:24: error: unclosed character literal
				for(char k = '0';k < '10';k++){
				                        ^
Main.java:24: error: ';' expected
				for(char k = '0';k < '10';k++){
				                             ^
9 errors
Language: C++

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

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
constexpr int mod = 1e9 + 7;

struct mint {
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint &operator-=(const mint a) {
    if ((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint &operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1) a *= *this;
    return a;
  }
  mint inv() const { return pow(mod - 2); }
  mint &operator/=(const mint a) { return (*this) *= a.inv(); }
  mint operator/(const mint a) const {
    mint res(*this);
    return res /= a;
  }
  friend ostream &operator<<(ostream &os, const mint &a) { return (os << a.x); }
};
struct combination {
  vector<mint> fact, ifact;
  combination(int n) : fact(n + 1), ifact(n + 1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i - 1] = ifact[i] * i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n] * ifact[k] * ifact[n - k];
  }
};

int n;
int k;
vector<vector<bitset<7>>> t;

int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  // bitset<30000> bs;
  // // set<string> c;
  // set<int> v;
  // for (int i = 0; i < pow(2, n); ++i) {
  //   bs = bitset<30000>(i);
  //   if (bs.count() != 3) continue;
  //   int a = 0;
  //   // string t = "";
  //   for (int j = 0; j < bs.size(); ++j) {
  //     if (bs.test(j)) // a = a * 10 + atoi(s[j]);
  //       a = a * 10 + (s[j] - '0');
  //   }
  //   // cout << t << endl;
  //   // c.insert(t);
  //   v.insert(a);
  // }
  // // cout << c.size() << endl;
  // cout << v.size() << endl;
  set<int> v;
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      for (int k = j + 1; k < n; ++k) {
        int a = 100 * (s[i] - '0') + 10 * (s[j] - '0') + s[k] - '0';
        v.insert(a);
        if (v.size() >= 1000) {
          cout << v.size() << endl;
          return;
        }
      }
    }
  }
  cout << v.size() << endl;
}


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

#include <iostream>
#include <cmath>
#include <cstdio>
#include <string>
#define rep(i,n) for(int (i) = 0; (i) < (n); (i)++)
using namespace std;
int ok(string S, int N, int n) {
    char my[10];
    sprintf_s(my, "%03d", n);
    int index = 0;
    int match = 0;
    for (int i = 0; i < N - 2; i++) {
        if (S[i] == my[0]) {
            match = 1;
            index = i;
            break;
        }
    }
    if (match == 0) return 0;
    match = 0;
    for (int i = index + 1; i < N - 1; i++) {
        if (S[i] == my[1]) {
            match = 1;
            index = i;
            break;
        }
    }
    if (match == 0) return 0;
    for (int i = index + 1; i < N; i++) {
        if (S[i] == my[2]) {
            return 1;
        }
    }
    return 0;
}

int main() {
    int N;
    string S;
    int count = 0;
    cin >> N >> S;
    rep(i, 1000) {
        if (ok(S, N, i)) {
            count += 1;
        }
    }
    cout << count << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int ok(std::string, int, int)':
a.cc:9:5: error: 'sprintf_s' was not declared in this scope; did you mean 'sprintf'?
    9 |     sprintf_s(my, "%03d", n);
      |     ^~~~~~~~~
      |     sprintf
Language: C++


#include <math.h>
#include <iostream>
#include<string>
#include <algorithm>
#include <bits/stdc++.h>
#include <vector>
#include <stdlib.h>
using namespace std;

int main()
{
int N;
string S;
cin >> N >> S;
vector<string> ans;
for(int i=0;i<N;i++)
{
for(int j=i+1;j<N;j++)
{
for(int L=j+1;L<N;L++)
{
string K=S.at(i)+S.at(j)+S.at(L);
if(ans.find(K)==-1)ans.push_back(K);
else continue;
}
}
}
cout << ans.size() << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:25: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   23 | string K=S.at(i)+S.at(j)+S.at(L);
      |          ~~~~~~~~~~~~~~~^~~~~~~~
a.cc:24:8: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'find'
   24 | if(ans.find(K)==-1)ans.push_back(K);
      |        ^~~~
Language: C++

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

int main(){
	int n ; cin >> n ;
	string s ; cin >> s ;
	set<string> ok ;
	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++){
				string t ;
				t += s.at(i) ;
				t += s.at(j) ;
				t += s.at(k) ;
				ok.insert(t) ;
			}
		}
	}
	cout << t.size() << endl ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: 't' was not declared in this scope
   21 |         cout << t.size() << endl ;
      |                 ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vd = vector<double>;
using vvd = vector<vd>;

#define out(a) cout << a << endl
#define out1(a) cout << a
#define in(a) cin >> a
#define in2(a, b) cin >> a >> b
#define in3(a, b, c) cin >> a >> b >> c
#define rep(i, N) for (ll i = 0; i < (ll)N; i++)
#define rep1(i, N) for (ll i = 1; i <= (ll)N; i++)
#define repi(i, j, N) for (ll j = (ll)i + 1; j < (ll)N; j++)
#define all(v) v.begin(), v.end()

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;
}

constexpr int inf = 1e9;
constexpr ll linf = 1e18;
constexpr ll mod = 1e9 + 7;

void solve();

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

void solve()
{
    int n;
    string s;
    in2(n, s);
    ll ans = 0;
    rep(i, 10)
    {
        rep(j, 10)
        {
            rep(k, 10)
            {
                int flag = 0;
                rep(l, n)
                {
                    if (s[l] - '0' == i && flag == 0)
                    {
                        flag++;
                        continue;
                    }
                    if (s[l] - '0' == j && flag == 1)
                    {
                        flag++;
                        continue;
                    }
                    if (s[l] - '0' == k && flag == 2)
                    {
                        flag++;
                        continue;
                    }
                }
                if (flag == 3)
                {
                    ans++;
                }
            }
        }
    }
    out(ans);

Compiler output:
a.cc: In function 'void solve()':
a.cc:94:14: error: expected '}' at end of input
   94 |     out(ans);
      |              ^
a.cc:57:1: note: to match this '{'
   57 | {
      | ^
Language: C++

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

int main(){
  int N; 
  cin >> N;
  string S;
  cin >> S;
  int count;
  for (int i = 0; i < 1000; i++){
    vector<int> d = {i/100, (i%100)/10, i%10};
    int num = 0;
    for (int i = 0; i < N; i++){
      if (S[i] == d[num]){
        num++}
      if (num == 3){
        count++;
        break;
      }
    }
  }
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: expected ';' before '}' token
   17 |         num++}
      |              ^
      |              ;
Language: C++

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

int main(){
  int N;
  cin >> N;
  string S;
  cin >> S;
  vector<char> Num;
  #vector<int> Pass;
  int count=0;
  
  for (int i = 0; i < N-2;i++){
    for (int k = i; k < N-1; k++){
      for (int l = k; l < N; l++){
       count++;
      }
    }
  }
  
  cout << count << endl;
}
 
 
       
  

Compiler output:
a.cc:12:4: error: invalid preprocessing directive #vector
   12 |   #vector<int> Pass;
      |    ^~~~~~
Language: C++

N = int(input())
S = input()
ans = 0
for i in range(1000):
	a = '{:0=3}'.format(i)
	b = [False] * 3
	for j in S:
		if j == a[0] and not b[0]:
			b[0] = True
		elif j == a[1] and b[0] and not b[1]:
			b[1] = True
		elif j == a[2] and b[0] and b[1] and not b[2]:
			b[2] = True
	if all(b):
		ans += 1
print(ans)

Compiler output:
a.cc:5:13: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
    5 |         a = '{:0=3}'.format(i)
      |             ^~~~~~~~
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^
Language: C++

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

typedef long long ll;

int main() {
    int N;
    string S;
    cin >> N >> S;
    bool f[1000], g[11][11], h[11][11];
    rep(i, 1000) f[i] = false;
    rep(i, 11) rep(j, 11) g[i][j] = false;
    g[10][10] = true;
    rep(i, N) {
        int x = S[i] - '0';
        rep(j, 11) rep(k, 11) h[j][k] = false;
        rep(j, 11) {
            rep(k, 11) {
                if (g[j][k]) {
                    h[k][x] = true;
                    if (j < 10 && k < 10) f[j * 100 + k * 10 + x] = true;
                }
            }
        }
        rep(j, 11) rep(k, 11) if(h[j][k]) g[j][k] = true;
    }
    int ans = 0;
    rep(i, 1000) if (f[i]) {
        ans++;
        //cout << i << endl;
    }
    cout << ans << endl;
}v

Compiler output:
a.cc:34:2: error: 'v' does not name a type
   34 | }v
      |  ^
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); i++)
#define RREP(i, s, n) for (int i = s; i < (n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
#define maxs(x,y) x = max(x, y)
#define mins(x,y) x = min(x, y)
using namespace std;
using ll = long long;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;
const int inf = (1<<29);

int main() {

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

    map<string, int> mp;

    for(int i = 0; i < n; i++) {
        for(int j = i+1; j < n; j++) {
            for(int k = j+1; k < n; k++) {
                mp[s[i]+s[j]+s[k]]++;
            }
        }
    }

    cout << mp.size() << endl;
    
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:19: error: no match for 'operator[]' (operand types are 'std::map<std::__cxx11::basic_string<char>, int>' and 'int')
   28 |                 mp[s[i]+s[j]+s[k]]++;
      |                   ^
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 'int' 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 'int' to 'std::map<std::__cxx11::basic_string<char>, int>::key_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
Language: C++

#include "bits/stdc++.h"
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define MOD 1e9+7;
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long LL;
typedef vector<int> VI;
typedef vector<string> VS;

int main(){
    int N, f;
    string S;
    cin >> N >> S;
    REP(i, 1000){
        char p[3] = {(char) i/100, (char) (i%100)/10, (char) i%10};
        f = 0;
        REP(j, N){
            if (S[j] == p[f]){
                f++;
            }
            if (f == 3){
                break;
            }
        }
        if (f == 3) cnt++;
    }
    cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:30: warning: narrowing conversion of '(int)(((signed char)((int)((char)i))) / 100)' from 'int' to 'char' [-Wnarrowing]
   18 |         char p[3] = {(char) i/100, (char) (i%100)/10, (char) i%10};
      |                      ~~~~~~~~^~~~
a.cc:18:50: warning: narrowing conversion of '(int)(((signed char)((int)((char)(i % 100)))) / 10)' from 'int' to 'char' [-Wnarrowing]
   18 |         char p[3] = {(char) i/100, (char) (i%100)/10, (char) i%10};
      |                                    ~~~~~~~~~~~~~~^~~
a.cc:18:63: warning: narrowing conversion of '(int)(((signed char)((int)((char)i))) % 10)' from 'int' to 'char' [-Wnarrowing]
   18 |         char p[3] = {(char) i/100, (char) (i%100)/10, (char) i%10};
      |                                                       ~~~~~~~~^~~
a.cc:28:21: error: 'cnt' was not declared in this scope; did you mean 'int'?
   28 |         if (f == 3) cnt++;
      |                     ^~~
      |                     int
a.cc:30:13: error: 'cnt' was not declared in this scope; did you mean 'int'?
   30 |     cout << cnt << endl;
      |             ^~~
      |             int
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <fstream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
using namespace std;

#define DEBUG 1
#define ll         long long
#define REP(i, n) for (long long i = 0; i < (n); i++) 
static const ll INF = 1000000000000000000LL;
static const int MOD = 1000000007;


int N;
string s;

bool findNum(string num)
{
    int t = 0;
    for(int i = 0; i < N; ++i)
    {
        if(t == 3)break;
        if(s[i] == num[t])++t;
    }
    return t == 3;
}

int main(){
    //その暗証番号が使用できるか

    string numList = "0123456789";

    cin >> N;
    cin >> s;

    for(int i = 0; i < 10; ++i)
    {
        string num = "";
        num += numList[i];
        for(int j = 0; j < 10; ++j)
        {
            num += numList[j];
            for(int k = 0; k < 10; ++k)
            {
                num += numList[k];

                if(findNum(num))++res;
            }
        }
    }


    cout << res << endl;
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:35: error: 'res' was not declared in this scope
   57 |                 if(findNum(num))++res;
      |                                   ^~~
a.cc:63:13: error: 'res' was not declared in this scope
   63 |     cout << res << endl;
      |             ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main () {
  int N;
  string S;
  cin >> N >> S;
  int count, ans = 0;
  string C;
  for(int i = 0; i < 1000; i++){
    C = to_string(i);
    if(C.size() == 1)C = "0" + C;
    if(C.size() == 2)C = "0" + C;
    count = 0;
    for(int i = j; j < N; j++){
      if(C.at(count) == S.at(j))count++;
      if(count == 3){
        ans++;
        break;
      }
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'j' was not declared in this scope
   14 |     for(int i = j; j < N; j++){
      |                 ^