criyle/codenet-compile-errors huggingface dataset:
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))flag++;
      if(flag == 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++){
      |                 ^
a.cc:15:33: error: 'flag' was not declared in this scope
   15 |       if(C.at(count) == S.at(j))flag++;
      |                                 ^~~~
a.cc:16:10: error: 'flag' was not declared in this scope
   16 |       if(flag == 3){
      |          ^~~~
Language: Java

import java.util.Scanner;
public class Lucky2 {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        int N = scan.nextInt();
        String S1 = scan.next();
        char[] S = S1.toCharArray();

        String w;
        int num = 0;
        for(int i=0; i<1000; i++){
            int c=0;
            w = String.valueOf(i);
            for(int k=0; k<3; k++) {
                if (w.length() <= 2) {
                    w = "0" + w;
                }
            }
            char[] n = w.toCharArray();
            for(int j=0; j<N; j++){
                if(n[c] == S[j]){
                    c++;
                    if(c==3){
                        num++;
                        break;
                    }
                }
            }
        }
        System.out.println(num);
    }
}

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

#!/usr/bin/perl

use strict;
use warnings;

my $n = <STDIN>;
my $s = <STDIN>;

my $ans = 0;
for (my $i=0; $i<10; $i++) {
    my $a = index($s, $i);
    next if $a<0 || $a>=length($s)-2; 
    for (my $j=0; $j<10; $j++) {
        my $b = index(substr($s, $a+1), $j);
        next if $b<0 || $b>=length(substr($s, $a+1))-1; 
        for (my $k=0; $k<10; $k++) {
            my $c = index(substr(substr($s, $a+1), $b+1), $k);
            next if $c<0 || $c>=length(substr(substr($s, $a+1), $b+1)); 
            $ans++;
        }
    }
}

print "$ans\n";

Compiler output:
Main.java:1: error: illegal character: '#'
#!/usr/bin/perl
^
Main.java:1: error: class, interface, enum, or record expected
#!/usr/bin/perl
  ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
use warnings;
^
  (use --enable-preview to enable unnamed classes)
Main.java:6: error: illegal start of expression
my $n = <STDIN>;
               ^
Main.java:7: error: illegal start of expression
my $s = <STDIN>;
               ^
Main.java:10: error: class, interface, enum, or record expected
for (my $i=0; $i<10; $i++) {
^
Main.java:10: error: class, interface, enum, or record expected
for (my $i=0; $i<10; $i++) {
              ^
Main.java:10: error: class, interface, enum, or record expected
for (my $i=0; $i<10; $i++) {
                     ^
Main.java:12: error: class, interface, enum, or record expected
    next if $a<0 || $a>=length($s)-2; 
    ^
Main.java:13: error: class, interface, enum, or record expected
    for (my $j=0; $j<10; $j++) {
    ^
Main.java:13: error: class, interface, enum, or record expected
    for (my $j=0; $j<10; $j++) {
                  ^
Main.java:13: error: class, interface, enum, or record expected
    for (my $j=0; $j<10; $j++) {
                         ^
Main.java:15: error: class, interface, enum, or record expected
        next if $b<0 || $b>=length(substr($s, $a+1))-1; 
        ^
Main.java:16: error: class, interface, enum, or record expected
        for (my $k=0; $k<10; $k++) {
        ^
Main.java:16: error: class, interface, enum, or record expected
        for (my $k=0; $k<10; $k++) {
                      ^
Main.java:16: error: class, interface, enum, or record expected
        for (my $k=0; $k<10; $k++) {
                             ^
Main.java:18: error: class, interface, enum, or record expected
            next if $c<0 || $c>=length(substr(substr($s, $a+1), $b+1)); 
            ^
Main.java:19: error: class, interface, enum, or record expected
            $ans++;
            ^
Main.java:20: error: class, interface, enum, or record expected
        }
        ^
19 errors
Language: C++

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

const int MAX_N = 30005;
int L[MAX_N], R[MAX_N], p[10];

int main() {
	int n; cin >> n;
	string s; cin >> s;
	// memset(p, 0, sizeof(p));
	// left
" Press ? for help  |--2 9726118947988086960898214442800480278762077776717109997
	set<int> temp;
	for(int i=0; i<n; i++) {
		L[i]=temp.size();
		temp.insert(s[i]);
	}
	temp.clear();
	for(int i=n-1; i>=0; i--) {
		R[i]=temp.size();
		temp.insert(s[i]);
	}
	// for(int i=0; i<n; i++) {
	// 	cout << L[i] << ' ' << R[i] << endl;
	// }

	long long ans = 0;
	for(int i=0; i<n; i++) {
		ans += (L[i] - L[p[s[i]]]) * R[i];
		p[s[i]]=i;
	}

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

Compiler output:
a.cc:12:1: warning: missing terminating " character
   12 | " Press ? for help  |--2 9726118947988086960898214442800480278762077776717109997
      | ^
a.cc:12:1: error: missing terminating " character
   12 | " Press ? for help  |--2 9726118947988086960898214442800480278762077776717109997
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: Java

import  java.util.Scanner;
public class Lucky {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        int N = scan.nextInt();
        String S1 = scan.next();
        char[] S = S1.toCharArray();
        String[] pass = new String[1000]; //最高でも10^3通り
        int c=0;

        for(int i=0; i<N-2; i++){
            pass[c] = "" + S[i];
            for(int j=i+1; j<N-1; j++) {
                pass[c] = pass[c] + S[j];
                String tmp1 = pass[c].substring(0,1);
                for (int k = j + 1; k < N; k++) {
                    pass[c] = pass[c] + S[k];
                    String tmp2 = pass[c].substring(0,2);
                    if(c==0){
                        c++;
                        pass[c] = tmp2;
                    }else {
                        for (int l = 0; l < c; l++) {
                            if (pass[c].equals(pass[l])) {
                                pass[c] = tmp2;
                                break;
                            } else if (l == c - 1) {
                                c++;
                                pass[c] = tmp2;
                                break;
                            }
                        }
                    }
                }
                pass[c] = tmp1;
            }
        }
        System.out.println(c);
    }
}

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

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

int main() {
  int A = 0;
  vector<int> B(1000);
  for (int i = 0; i < 1000; i++) {
  C.at(i) = i;
  }
  string C;
  cin >> C;
  int D;
  int E;
  int F;
  int G = 1000;
  for (int j = 0; j < 1000; j++) {
    D = j / 100;
    E = 0;
    F = 0;
    while(F == 0){
      E = E + 1;
      if(C.at(E - 1) == D){
        F = 1;
      }
      if(E + 1 == C.size()){
        F = 2;
      }
    }
    if(F == 1){
      F = 0;
      D = (j - D * 100) / 10;
      while(F == 0){
        E = E + 1;
        if(C.at(E - 1) == D){
          F = 1;
        }
        if(E + 1 == C.size()){
          F = 2;
        }
      }
    }
    if(F == 1){
      F = 0;
      D = j % 10;
      while(F == 0){
        E = E + 1;
        if(C.at(E - 1) == D){
          F = 1;
        }
        if(E + 1 == C.size()){
          F = 2;
        }
      }
    }
    if (F == 2){
      G = G - 1;
    }
  }
  cout << G << endl;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'C' was not declared in this scope
    8 |   C.at(i) = i;
      |   ^
Language: C++

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

int main() {
  int A = 0;
  vector<int> B(1000);
  for (int i = 0; i < 1000; i++) {
  vec.at(i) = i;
  }
  string C;
  cin >> C;
  int D;
  int E;
  int F;
  int G = 1000;
  for (int j = 0; j < 1000; j++) {
    D = j / 100;
    E = 0;
    F = 0;
    while(F == 0){
      E = E + 1;
      if(C.at(E - 1) == D){
        F = 1;
      }
      if(E + 1 == C.size()){
        F = 2;
      }
    }
    if(F = 1){
      F = 0;
      D = (j - D * 100) / 10;
      while(F == 0){
        E = E + 1;
        if(C.at(E - 1) = D){
          F = 1;
        }
        if(E + 1 = C.size()){
          F = 2;
        }
      }
    }
    if(F = 1){
      F = 0;
      D = j % 10;
      while(F == 0){
        E = E + 1;
        if(C.at(E - 1) == D){
          F = 1;
        }
        if(E + 1 == C.size()){
          F = 2;
        }
      }
    }
    if (F == 2){
      G = G - 1;
    }
  }
  cout << G << endl;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vec' was not declared in this scope
    8 |   vec.at(i) = i;
      |   ^~~
a.cc:37:14: error: lvalue required as left operand of assignment
   37 |         if(E + 1 = C.size()){
      |            ~~^~~
Language: Java

class Main
{
  public static void main(String[] args)throws IOException
  {
    BufferedReader br = 
     new BufferedReader(new InputStreamReader(System.in));
    String S = br.readLine();

    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    
    int count = 0;  

    for(int i=0; i<10; i++){
       for(int j=0; j<10; j++){
          for(int k=0; k<10; k++){
             int a = i*100 + j*10 + k;
          
             int bi = S.indexOf(i);
             int bj = S.indexOf(j);
    
             if(bi<bj){

               int bk = S.indexOf(k);

               if(bj<bk){
                 count++;
               }
               else{
                 continue;
               }
             }
             else{
               continue;
             }

             System.out.println(count);
          }
       }
    }
  }
}






Compiler output:
Main.java:3: error: cannot find symbol
  public static void main(String[] args)throws IOException
                                               ^
  symbol:   class IOException
  location: class Main
Main.java:5: error: cannot find symbol
    BufferedReader br = 
    ^
  symbol:   class BufferedReader
  location: class Main
Main.java:6: error: cannot find symbol
     new BufferedReader(new InputStreamReader(System.in));
         ^
  symbol:   class BufferedReader
  location: class Main
Main.java:6: error: cannot find symbol
     new BufferedReader(new InputStreamReader(System.in));
                            ^
  symbol:   class InputStreamReader
  location: class Main
Main.java:9: error: cannot find symbol
    Scanner sc = new Scanner(System.in);
    ^
  symbol:   class Scanner
  location: class Main
Main.java:9: error: cannot find symbol
    Scanner sc = new Scanner(System.in);
                     ^
  symbol:   class Scanner
  location: class Main
6 errors
Language: Java

import java.util.*;

class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int S = sc.nextInt();

    int count = 0;  

    for(int i=0; i<10; i++){
       for(int j=0; j<10; j++){
          for(int k=0; k<10; k++){
             int a = ijk;
          
             int bi = S.indexOf(i);
             int bj = S.indexOf(j);
    
             if(bi<bj){

               int bk = S.indexOf(k);

               if(bj<bk){
                 count++;
               }
               else{
                 continue;
               }
             }
             else{
               continue;
             }

             System.out.println(count);
          }
       }
    }
  }
}

Compiler output:
Main.java:16: error: cannot find symbol
             int a = ijk;
                     ^
  symbol:   variable ijk
  location: class Main
Main.java:18: error: int cannot be dereferenced
             int bi = S.indexOf(i);
                       ^
Main.java:19: error: int cannot be dereferenced
             int bj = S.indexOf(j);
                       ^
Main.java:23: error: int cannot be dereferenced
               int bk = S.indexOf(k);
                         ^
4 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const double PI=3.14159265358979323846;
const int64_t waru = 1000000007;
using in = int64_t;


int sagasu(vector<int> s,int n, int x,int y){
   int ret=0;
  for(int i=x;i<n;i++){
     if(s.at(i)==y){
        ret=i;
        break;
      }
    else if(i==n-1) ret=-1;
  }
  return ret;
}

int main(){
  int x,y,z;
  int ans =0;
  int n;
  cin>>n;
  vector<int> s(n);
  rep(i,n) cin>> s.at(i);
  
  rep(i,10){
    x= sagasu(s,n,0,i);
    if(x==-1 || x>n-3) continue;
  rep(j,10){
    y= sagasu(s,n,x+1,j);
    if(y==-1 || y>n-2) continue;
  rep(k,10){
     /* x= sagasu(s,n,0,i);
    if(x==-1 || x>n-3) break;*/
      /*y= sagasu(s,n,x+1,j);
    if(y==-1 || y>n-2) break;*/
      z= sagasu(s,n,y+1,k);
    if(z><-1) ans ++;
         
    
  }  //if(x==-1 || x>n-3) break;
  } 
  }
  cout <<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:10: error: expected primary-expression before '<' token
   42 |     if(z><-1) ans ++;
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const double PI=3.14159265358979323846;
const int64_t waru = 1000000007;
using in = int64_t;


int sagasu(vector<int> s,int n, int x,int y){
   int ret=0;
  for(int i=x;i<n;i++){
     if(s.at(i)==y){
        ret=i;
        break;
      }
    else if(i==n-1) ret=-1;
  }
  return ret;
}

int main(){
  int x,y,z;
  int ans =0;
  int n;
  cin>>n;
  vector<int> s(n);
  rep(i,n) cin>> s.at(i);
  
  rep(i,10){
  rep(j,10){
  rep(k,10){
      x= sagasu(s,n,0,i);
    if(x==-1 || x>n-3) break;
      y= sagasu(s,n,x+1,j);
    if(y==-1 || y>n-2) break;
      z= sagasu(s,n,y+1,k);
    if(z><-1) ans ++;
         
    
  }  if(x==-1 || x>n-3) break;
  } 
  }
  cout <<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:10: error: expected primary-expression before '<' token
   38 |     if(z><-1) ans ++;
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const double PI=3.14159265358979323846;
const int64_t waru = 1000000007;
using in = int64_t;


int sagasu(vector<int> s,int n, int x,int y){
   int ret=0;
  for(int i=x;i<n;i++){
     if(s.at(i)==y){
        ret=i;
        break;
      }
    else if(i==n-1) ret=-1;
  }
  return ret;
}

int main(){
  int x,y,z;
  int ans =0;
  int n;
  cin>>n;
  vector<int> s(n);
  rep(i,n) cin>> s.at(i);
  
  rep(i,10){
  rep(j,10){
  rep(k,10){
      x= sagasu(s,n,0,i);
    if(x==-1 || x>n-3) break;
      y= sagasu(s,n,x+1,j);
    if(y==-1 || y>n-2) break;
      z= sagasu(s,n,y+1,k);
    if(z<>-1) ans ++;
         
    
  }  if(x==-1 || x>n-3) break;
  } 
  }
  cout <<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:10: error: expected primary-expression before '>' token
   38 |     if(z<>-1) ans ++;
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const double PI=3.14159265358979323846;
const int64_t waru = 1000000007;
using in = int64_t;


int sagasu(vector<int> s,int n, int x,int y){
   int ret=0;
  for(int i=x;i<n;i++){
     if(s.at(i)==y){
        ret=i;
        break;
      }
    else if(i==n-1) ret=-1;
  }
  return ret;
}

int main(){
  int x,y,z;
  int ans =0;
  int n;
  cin>>n;
  vector<int> s(n);
  rep(i,n) cin>> s.at(i);
  
  rep(i,10){
  rep(j,10){
  rep(k,10){
      x= sagasu(s,n,0,i);
    if(x==-1 || x>n-3) goto SKIPi;
      y= sagasu(s,n,x+1,j);
    if(y==-1 || y>n-2) goto SKIPj;
      z= sagasu(s,n,y+1,k);
    if(z!=-1) ans ++;
         
    
  } SKIPj;
  } SKIPi;
  }
  cout <<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:5: error: 'SKIPj' was not declared in this scope
   41 |   } SKIPj;
      |     ^~~~~
a.cc:42:5: error: 'SKIPi' was not declared in this scope
   42 |   } SKIPi;
      |     ^~~~~
a.cc:34:29: error: label 'SKIPi' used but not defined
   34 |     if(x==-1 || x>n-3) goto SKIPi;
      |                             ^~~~~
a.cc:36:29: error: label 'SKIPj' used but not defined
   36 |     if(y==-1 || y>n-2) goto SKIPj;
      |                             ^~~~~
Language: C++

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

int main() {
  unordered_set<string> u;
  int64_t n, c = 0;
  string s;
  cin >> n >> s;
  for(int i = 0; i < n; ++i){
    string a = s;
    a.pop(i);
    for(int j = 0; j < n-1; ++j){
      a.pop(j);
      for(int k = 0; k < n-2; ++k){
        a.pop(k);
        u.insert(a);
      }
    }
  }
  cout << u.size() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop'
   11 |     a.pop(i);
      |       ^~~
a.cc:13:9: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop'
   13 |       a.pop(j);
      |         ^~~
a.cc:15:11: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop'
   15 |         a.pop(k);
      |           ^~~
Language: C

#include <stdio.h>
#include <string.h>

int main(void) {
  int n;
  char s[MAX];
  scanf("%d %s", &n, s);
  int count = 0;
  rep(ci, 0, 1000) {
    int c[3] = {ci / 100, (ci / 10) % 10, ci % 10};
    int digit = 0;
    rep(si, 0, n) {
      if (c[digit] + '0' == s[si]) digit++;
      if (digit == 3) {
        count++;
        break;
      }
    }
  }
  printf("%d\n", count);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:10: error: 'MAX' undeclared (first use in this function)
    6 |   char s[MAX];
      |          ^~~
main.c:6:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:3: error: implicit declaration of function 'rep' [-Wimplicit-function-declaration]
    9 |   rep(ci, 0, 1000) {
      |   ^~~
main.c:9:7: error: 'ci' undeclared (first use in this function)
    9 |   rep(ci, 0, 1000) {
      |       ^~
main.c:9:19: error: expected ';' before '{' token
    9 |   rep(ci, 0, 1000) {
      |                   ^~
      |                   ;
Language: C++

int main(void)
{
    int n;
    string a;
    cin>>n>>a;
    int ans;

    rep(i,1000)
    {
    string s;
    s = to_string(i);
    if(s.size()==1) s="00"+s;
    if(s.size()==2) s="0"+s;

    for(int j=0;j<a.size();j++)
    {
        if(s[0]==a[j])
        {
            for(int k=j+1;k<a.size();k++)
            {
                if(s[1]==a[k])
                {
                    for(int l =k+1;l<a.size();l++)
                    {
                        if(s[2]==a[l]) ans ++;
                    }
                }
            }
        }
    }

    }


cout<<ans<<endl;




}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'string' was not declared in this scope
    4 |     string a;
      |     ^~~~~~
a.cc:5:5: error: 'cin' was not declared in this scope
    5 |     cin>>n>>a;
      |     ^~~
a.cc:5:13: error: 'a' was not declared in this scope
    5 |     cin>>n>>a;
      |             ^
a.cc:8:9: error: 'i' was not declared in this scope
    8 |     rep(i,1000)
      |         ^
a.cc:8:5: error: 'rep' was not declared in this scope
    8 |     rep(i,1000)
      |     ^~~
a.cc:35:1: error: 'cout' was not declared in this scope
   35 | cout<<ans<<endl;
      | ^~~~
a.cc:35:12: error: 'endl' was not declared in this scope
   35 | cout<<ans<<endl;
      |            ^~~~
Language: C++

/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/


int main() {
	
	int n;
	scanf("%d", &n);
	string s;
	scans(s);
	ll ans = 0;
	rep(i, 10){
		rep(j, 10){
			rep(k, 10){
				ans += (s.find(to_string(i)) != string::npos && s.find(to_string(j),1 +  s.find(to_string(i))) != string::npos && s.find(to_string(k)), 1 + s.find(to_string(j))) != string::npos);
			}
		}
	}
	printf("%lld\n", ans);
	Please AC;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:97:210: error: expected ';' before ')' token
   97 |                                 ans += (s.find(to_string(i)) != string::npos && s.find(to_string(j),1 +  s.find(to_string(i))) != string::npos && s.find(to_string(k)), 1 + s.find(to_string(j))) != string::npos);
      |                                                                                                                                                                                                                  ^
      |                                                                                                                                                                                                                  ;
Language: C++

/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/


int main() {
	
	int n;
	scanf("%d", &n);
	string s;
	scans(s);
	ll ans = 0;
	rep(i, 10){
		rep(j, 10){
			rep(k, 10){
				ans += (regex_match(s, regex("^.*" + to_string(i) + ".*" + to_string(j) + ".*" + to_string(k) + ".*"$)) == true);
			}
		}
	}
	printf("%lld\n", ans);
	Please AC;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:97:129: error: unable to find string literal operator 'operator""$' with 'const char [3]', 'long unsigned int' arguments
   97 |                                 ans += (regex_match(s, regex("^.*" + to_string(i) + ".*" + to_string(j) + ".*" + to_string(k) + ".*"$)) == true);
      |                                                                                                                                 ^~~~~
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 endl    '\n'
#define INF 2e9
#define int ll
#define vi          vector<int>
#define de          deque<int>
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()//全範囲指定を簡略化
typedef long long ll;
using namespace std;
//配列の要素数は　sizeof(ar)/sizeof(ar[0]) で求める

string S;
int N, cnt;

signed main(){
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    cin >> N >> S;
    REP(i,1000){
        int c[3] = {i/100,(i/10)%10, i%10}
        int f = 0;
        REP(j,N){
            if(S[j] == ('0' + c[f])){
                f++;
                if(f == 3){
                    break;
                }
            }
        }
        if(f == 3){
            cnt++;
        }
    }

    cout << cnt << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: expected ',' or ';' before 'll'
    7 | #define int ll
      |             ^~
a.cc:26:9: note: in expansion of macro 'int'
   26 |         int f = 0;
      |         ^~~
a.cc:28:33: error: 'f' was not declared in this scope
   28 |             if(S[j] == ('0' + c[f])){
      |                                 ^
a.cc:35:12: error: 'f' was not declared in this scope
   35 |         if(f == 3){
      |            ^
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 endl    '\n'
#define INF 2e9
#define int ll
#define vi          vector<int>
#define de          deque<int>
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()//全範囲指定を簡略化
typedef long long ll;
using namespace std;
//配列の要素数は　sizeof(ar)/sizeof(ar[0]) で求める

string S;
int N, cnt;

signed main(){
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    cin >> N >> S;
    REP(i,1000){
        int c[3] = {i/100,(i/10)%10, i%10}
        int f = 0;
        REP(j,N){
            if(S[j] == ('0' + c[f])){
                f++;
                if(f == 3){
                    break;
                }
            }
        }
        if(f == 3){
            cnt++;
        }
    }

    cout << cnt << endl
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: expected ',' or ';' before 'll'
    7 | #define int ll
      |             ^~
a.cc:26:9: note: in expansion of macro 'int'
   26 |         int f = 0;
      |         ^~~
a.cc:28:33: error: 'f' was not declared in this scope
   28 |             if(S[j] == ('0' + c[f])){
      |                                 ^
a.cc:35:12: error: 'f' was not declared in this scope
   35 |         if(f == 3){
      |            ^
a.cc:41:5: error: expected ';' before 'return'
   41 |     return 0;
      |     ^~~~~~
Language: C++

/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/


int main() {
	
	int n;
	scanf("%d", &n);
	string s;
	scans(s);
	ll ans = 0;
	rep1(i, 9){
		rep1(j, 9){
			rep1(k, 9){
				rep1(l, 9){
					ans += (regex_search(s, regex(to_string(i) .* to_string(j) .* to_string(k) .* to_string(l))));
				}
			}
		}
	}
	printf("%lld\n", ans);
	Please AC;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:98:98: error: 'std::__cxx11::to_string(int)()' cannot be used as a member pointer, since it is of type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   98 |                                         ans += (regex_search(s, regex(to_string(i) .* to_string(j) .* to_string(k) .* to_string(l))));
      |                                                                                                  ^
Language: C++

/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/


int main() {
	
	int n;
	scanf("%d", &n);
	string s;
	scans(s);
	ll ans = 0;
	rep1(i, 9){
		rep1(j, 9){
			rep1(k, 9){
				rep1(l, 9){
					ans += (regex_search(s, regex(to_string(i).*to_string(j).*to_string(k).*to_string(l))));
				}
			}
		}
	}

	Please AC;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:98:96: error: 'std::__cxx11::to_string(int)()' cannot be used as a member pointer, since it is of type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   98 |                                         ans += (regex_search(s, regex(to_string(i).*to_string(j).*to_string(k).*to_string(l))));
      |                                                                                                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;string s;cin>>n>>s;
  vector<string> a(0);
  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);
        int p=0;
        for(int m=0;m<a.size();m++){
          if(a.at(m)==t){p++;break;}
        }
        if(p==0)a.push_back(t);
        if(a.size>999)break;break;break;
      }
    }
  }
  cout<<a.size()<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; size_type = long unsigned int]' (did you forget the '()' ?)
   16 |         if(a.size>999)break;break;break;
      |            ~~^~~~
      |                  ()
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;string s;cin>>n>>s;
  vector<string> a(0);
  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=s.at(i);
        t+=s.at(j);t+=s.at(k);
        int p=0;
        for(int m=0;m<a.size();m++){
          if(a.at(m)==t){p++;break;}
        }
        if(p==0)a.push_back(t);
      }
    }
  }
  cout<<a.size()<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    9 |         string t=s.at(i);
      |                  ~~~~^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,string s;cin>>n>>s;
  vector<string> a(0);
  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=s.at(i);
        t+=s.at(j);t+=s.at(k);
        int p=0
        for(int m=0;m<a.size();m++){
          if(a.at(m)==t){p++;break;}
        }
        if(p==0)a.push_back(t);
      }
    }
  }
  cout<<a.size()<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:16: error: expected initializer before 's'
    4 |   int n,string s;cin>>n>>s;
      |                ^
a.cc:4:26: error: 's' was not declared in this scope
    4 |   int n,string s;cin>>n>>s;
      |                          ^
a.cc:12:9: error: expected ',' or ';' before 'for'
   12 |         for(int m=0;m<a.size();m++){
      |         ^~~
a.cc:12:21: error: 'm' was not declared in this scope
   12 |         for(int m=0;m<a.size();m++){
      |                     ^
Language: C++

#include <iostream>
using namespace std;
int sum[10000];
int main(void)
{
    ios::sync_with_stdio(false);
    int a,b,c=5,d;
    int i,j,n,r,q=0;
    string a;
    cin >> n;
    cin>>a;
    r=3;
    int *arrange = new int[r];
    int *element = new int[n];
    for(i=0; i <n; i++){
	 element[i]=a[i]-'0';
// element[i] = i + 1; //要素を入力せずに 1から順にn とするとき
    }
    int o=0,l=100;
    for(i=0;i<r;i++){
	arrange[i] = i;
	o+=element[arrange[i]]*l;
	l/=10;
	
    }
    sum[o]=1;
    
    while(arrange[0]<n-r){
	for(i=r-1; 0<=i ;i--){
	    if(arrange[i]<n-r+i){
		arrange[i] +=1;
		for(j=i; j<r-1; j++){
		    arrange[j+1] = arrange[j] +1;
		};
		break;
	    }
	}
	int o=0,l=100;
	for(i=0;i<r;i++){
	    o+=element[arrange[i]]*l;
	    l/=10;    
	}

	
	sum[o]=1;
    }
    for(int i=0;i<1000;i++){
	if(sum[i]==1) q++;
    }
    cout<<q<<"\n";
    
    delete(arrange);
    delete(element);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: conflicting declaration 'std::string a'
    9 |     string a;
      |            ^
a.cc:7:9: note: previous declaration as 'int a'
    7 |     int a,b,c=5,d;
      |         ^
a.cc:16:22: error: invalid types 'int[int]' for array subscript
   16 |          element[i]=a[i]-'0';
      |                      ^
Language: C++

#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
#include<queue>
#include<stack>
#include<cmath>
#include<list>
#include<set>
#include<map>


using namespace std;
long long MOD = 1000000007LL;

int main() {
	int N;
	cin >> N;
	string s;
	cin >> s;
	int count = 0;
	for (int i = 0; i < 1000; ++i) {
		int k = 0;
		char v[5] = { 0 };
		sprintf_s(v, "%03d", i);
		for (int j = 0; j < N; ++j) {
			if (s[j] == v[k]) {
				if (k == 2) {
					++count;
					break;
				}
				++k;
			}
		}
	}
	cout << count << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: 'sprintf_s' was not declared in this scope; did you mean 'sprintf'?
   25 |                 sprintf_s(v, "%03d", i);
      |                 ^~~~~~~~~
      |                 sprintf
Language: C++

//解説より

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll LongINF=1e13+7;
const int INF=1e9+7;
const int dx[]={0,1,0,-1};
const int dy[]={1,0,-1,0};

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;}
template <class T, class Y>T GCD(T a, Y b){if(a<b){int c=a;a=b;b=c;}if (a % b == 0){return b;}return GCD(b, a % b);}
void clear(queue<pair<int, int>> &q){queue<pair<int, int>> empty;swap(q, empty);} //queueの中身の型は適時変更を忘れない

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

//桁ごとに考えて大丈夫か否か
//残るのは確実に三桁だけ
/*
    ある桁までに数の種類を数える？
*/

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

    bool dp[30001][4][1001];
    dp[0][0][0]=1;

    for(int i=0;i<N;i++){
        for(int j=0;j<4;j++){
            for(int k=0;k<1000;k++){
                if(!dp[i][j][k])continue;

                dp[i+1][j][k]=true;//選ばない
                if(j<=2){//選ぶ
                    dp[i+1][j+1][k*10+(S[i]-'0')]=true;
                }
            }
        }
    }int cnt=0;
    for(int i=0;i<1000;i++){
        if(dp[N][3][i])cnt++;
    }
    cout<<cnt<<endl;

    return 0;
}

//a=97,z=122

Compiler output:
a.cc: In function 'int main()':
a.cc:43:40: error: 'S' was not declared in this scope
   43 |                     dp[i+1][j+1][k*10+(S[i]-'0')]=true;
      |                                        ^
Language: C++

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

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

    vector<string> t(1000);
    rep(i, 10){
        char tmp = '0' + i;
        t.at(i) = "00";
        t.at(i) += tmp;
    }

    for(int i=10; i<100; i++){
        string tmp = to_string(i);
        t.at(i) = "0";
        t.at(i) += tmp;
    }

    for(int i=100; i<1000; i++){
        t.at(i) = to_string(i);
    }

    vector<bool> used(1000, false);
    vector<bool> notok(1000, false);

    for(int i=0; i<1000; i++){
        for(ll j=0; j<S.size(); j++){
            if(t.at(i).at(0) == S.at(j)){
                for(ll k=j+1; k<S.size(); k++){
                    if(t.at(i).at(1) == S.at(k)){
                        for(ll l=k+1; l<S.size(); l++){
                            if(t.at(i).at(2) == S.at(l)){
                                used.at(i) = true;
                                break;
                            }
                            
                            if(l==S.size()-1){
                                notok.at(i) = true;
                                break;
                            }
                        }
                        if(used.at(i) || notok.at(i)) break;
                    }

                    if(l==S.size()-1){
                        notok.at(i) = true;
                        break;
                    }
                }
                if(used.at(i) || notok.at(i)) break;
            }
        }
        
    }

    int cnt = 0;
    for(int i=0; i<1000; i++){
        if(used.at(i) == true) cnt++;
    }

    cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:24: error: 'l' was not declared in this scope
   49 |                     if(l==S.size()-1){
      |                        ^
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;
    string S;
    cin >> N >> S;

    REP(i, 1000) {
        int c[3] = {i/100, (i/10) % 10, i%10};
        int f = 0;
        REP(i, N) {
            if (S[j] == ('0' + c[f])) f++;
            if (f == 3) break;
        }
        if (f == 3) cnt++;
    }

    cout << cnt << endl;

    return 0;
}

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

//     int N;
//     cin >> N;
//     string S;
//     cin >> S;

//     set<int> st;
    
//     int T;
//     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++) {
//                 T = (int)S[i]*100 + (int)S[j]*10 + S[k];
//                 // cout << T << endl;
//                 if (!st.count(T)) {
//                     st.insert(T);
//                 }
//             }            
//         }
//     }

//     cout << st.size() << endl;

//     return 0;
// }

Compiler output:
a.cc: In function 'int main()':
a.cc:26:19: error: 'j' was not declared in this scope
   26 |             if (S[j] == ('0' + c[f])) f++;
      |                   ^
a.cc:29:21: error: 'cnt' was not declared in this scope; did you mean 'int'?
   29 |         if (f == 3) cnt++;
      |                     ^~~
      |                     int
a.cc:32:13: error: 'cnt' was not declared in this scope; did you mean 'int'?
   32 |     cout << cnt << endl;
      |             ^~~
      |             int
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long long n;
  cin>>n;
  string s;
  cin>>s;
  vector<int> w(10);
  vector<int> q(10);
  for(int i=0;i<n;i++){
    char a=s[i];
    int h=a-'1';
    w[h]++;
    q[h]++;
  }
  long long cut=0;
  for(int i=0;i<n-2;i++){
    for(int j=i+1;j<n-1;j++){
      int y,u;
      char t,g;
      t=s[i];
      g=s[j];
      y=t-'1';
      u=g-'1';
      w[y]--;
      q[y]--;
      q[u]--;
      for(int i=0;i<10;i++){
        if(s[i]!>1){
          cut+=q[i];
        }
      }
      for(int i=0;i<10;i++){
        q[i]==w[i];
      }
    }
  }
  long long a=n*(n-1)*(n-2)/6-cut;
  cout<<a<<endl;
}
  
        
      
        


Compiler output:
a.cc: In function 'int main()':
a.cc:30:16: error: expected ')' before '!' token
   30 |         if(s[i]!>1){
      |           ~    ^
      |                )
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long long n;
  cin>>n;
  string s;
  cin>>s;
  vector<int> t(10);
  vector<int> s(10);
  for(int i=0;i<n;i++){
    char a=s[i];
    int h=a-'1';
    w[h]++;
    q[h]++;
  }
  long long cut=0;
  for(int i=0;i<n-2;i++){
    for(int j=i+1;j<n-1;j++){
      int y,u;
      char t,g;
      t=s[i];
      g=s[j];
      y=t-'1';
      u=g-'1';
      w[y]--;
      q[y]--;
      q[u]--;
      for(int i=0;i<10;i++){
        if(s[i]!>1){
          cut+=q[i];
        }
      }
      for(int i=0;i<10;i++){
        q[i]==w[i];
      }
    }
  }
  long long a=n*(n-1)*(n-2)/6-cut;
  cout<<a<<endl;
}
  
        
      
        


Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: conflicting declaration 'std::vector<int> s'
   10 |   vector<int> s(10);
      |               ^
a.cc:7:10: note: previous declaration as 'std::string s'
    7 |   string s;
      |          ^
a.cc:14:5: error: 'w' was not declared in this scope
   14 |     w[h]++;
      |     ^
a.cc:15:5: error: 'q' was not declared in this scope
   15 |     q[h]++;
      |     ^
a.cc:26:7: error: 'w' was not declared in this scope
   26 |       w[y]--;
      |       ^
a.cc:27:7: error: 'q' was not declared in this scope
   27 |       q[y]--;
      |       ^
a.cc:30:16: error: expected ')' before '!' token
   30 |         if(s[i]!>1){
      |           ~    ^
      |                )
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long long n;
  cin>>n;
  string s;
  cin>>s;
  vector<int> t(10);
  vector<int> s(10);
  for(int i=0;i<n;i++){
    char a=s[i];
    int h=a-'1';
    t[h]++;
    s[h]++;
  }
  long long cut=0;
  for(int i=0;i<n-2;i++){
    for(int j=i+1;j<n-1;j++){
      int y,u;
      char t,g;
      t=s[i];
      g=s[j];
      y=t-'1';
      u=g-'1';
      t[y]--;
      s[y]--;
      s[u]--;
      for(int i=0;i<10;i++){
        if(s[i]!>1){
          cut+=s[i];
        }
      }
      for(int i=0;i<10;i++){
        s[i]==t[i];
      }
    }
  }
  long long a=n*(n-1)*(n-2)/6-cut;
  cout<<a<<endl;
}
  
        
      
        

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: conflicting declaration 'std::vector<int> s'
   10 |   vector<int> s(10);
      |               ^
a.cc:7:10: note: previous declaration as 'std::string s'
    7 |   string s;
      |          ^
a.cc:26:8: error: invalid types 'char[int]' for array subscript
   26 |       t[y]--;
      |        ^
a.cc:30:16: error: expected ')' before '!' token
   30 |         if(s[i]!>1){
      |           ~    ^
      |                )
a.cc:35:16: error: invalid types 'char[int]' for array subscript
   35 |         s[i]==t[i];
      |                ^