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

#include<bits/stdc++.h>

using namespace std;

int main()
{
    cin >> n >> k;
    for(int i = 0; i < k ; i++)
    {
        cin >> q;
        dislikes[q] = 1;
    }

    while(true)
    {
        int prev_n = n, cnt = 0;
        bool ok = false;
        s = toStr(n);
        for(int i = s.size() - 1; i >= 0; i--)
        {
            if(dislikes[s[i] - '0'])
                ok = true;
        }
        if(ok) n++;
        else break;
    }
    cout << n << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |     cin >> n >> k;
      |            ^
      |            yn
a.cc:7:17: error: 'k' was not declared in this scope
    7 |     cin >> n >> k;
      |                 ^
a.cc:10:16: error: 'q' was not declared in this scope
   10 |         cin >> q;
      |                ^
a.cc:11:9: error: 'dislikes' was not declared in this scope
   11 |         dislikes[q] = 1;
      |         ^~~~~~~~
a.cc:18:9: error: 's' was not declared in this scope
   18 |         s = toStr(n);
      |         ^
a.cc:18:13: error: 'toStr' was not declared in this scope
   18 |         s = toStr(n);
      |             ^~~~~
a.cc:21:16: error: 'dislikes' was not declared in this scope
   21 |             if(dislikes[s[i] - '0'])
      |                ^~~~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
  int N,K;
  int answer=0;
  cin>>N>>K;
  int D[K],R[5]={0};
  for(int i=0;i<K;i++)cin>>D[i];
  for(int ans=N;ans<=10*N;ans++){
    bool flag=true;
    int ans_=ans;
    while(true){
      int part=ans_%10;ans_/=10;
      for(int j=0;j<5;j++){if(part==D[j])flag=false;}
      if(ans_==0)break;
    }
    if(flag){answer=ans;break;}
  }
  cout<<ans<<endl;
}

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

#include<iostream>
using namespace std;
int main(){
  int N,K;
  cin>>N>>K;
  int D[K],R[5]={0};
  for(int i=0;i<K;i++)cin>>D[i];
  for(int ans=N;ans<=10*N;ans++){
    bool flag=true;
    int ans_=ans;
    while(true){
      int part=ans_%10;ans_/=10;
      for(int j=0;j<5;j++){if(part==D[j])flag=false;}
      if(ans_==0)break;
    }
    if(flag)break;
  }
  cout<<ans<<endl;
}

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

#include<iostream>
using namespace std;
int main(){
  int N,K;
  cin>>N>>K;
  int D[K],R[5]={0};
  for(int i=0;i<K;i++)cin>>D[i];
  for(int ans=N;ans<=10*N;ans++){
    bool flag=true;
    int ans_=ans;
    while(true){
      int part=ans_%10;ans_/=10;
      for(int j=0;j<5;j++){if(part==D[j])flag=false};
      if(ans_==0)break;
    }
    if(flag)break;
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:52: error: expected ';' before '}' token
   13 |       for(int j=0;j<5;j++){if(part==D[j])flag=false};
      |                                                    ^
      |                                                    ;
a.cc:18:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include <iostream>
using namespace std;

int D[10];

inline bool ok(n) {
  while (n) {
    if (D[n%10]==0) {
      n/=10;
    } else {
      return false;
    }
  }
  return true;
}
int main() {
  cin.tie(0);
  std::ios::sync_with_stdio(false);
  int N,K;
  cin>>N>>K;
  for (int i=0; i<K; i++) {
    int d;
    cin>>d;
    D[d]=1;
  }
  while (!ok(N)) {
    N++;
  }
  cout<<N<<endl;
  return 0;
}


Compiler output:
a.cc:6:16: error: 'n' was not declared in this scope
    6 | inline bool ok(n) {
      |                ^
a.cc: In function 'int main()':
a.cc:26:13: error: 'ok' cannot be used as a function
   26 |   while (!ok(N)) {
      |           ~~^~~
Language: C++

    #include<iostream>
    #include<algorithm>
    using namespace std;
    int main(){
      int N,K;
      cin>>N>>K;
      int no[K];
      for(int i=1;i<K;i++)cin>>no[K];
      int digit[4];
      int n=N;
      for(int i=0;i<4;i++){digit[i]=n%10;n/=10;}
      for(int i=0;i<4;i++){
        for(j=0;j<K;j++){
          if(digit[i]==no[j]&&digit[i]!=9)digit[i]++;
          if(digit[i]==no[j]&&digit[i]!=9){digit[i]=0;digit[i+1]++;}
        }
      }
      int ans=digit[0]+10*digit[1]+100*digit[2]*1000*digit[3];
      cout<<ans<<endl;
      
    }

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

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int N,K;
  cin>>N>>K;
  int no[K];
  for(int i=1;i<K;i++)cin>>okies[K];
  int digit[4];
  int n=N;
  for(int i=0;i<4;i++){digit[i]=n%10;n/=10;}
  for(int i=0;i<4;i++){
    for(j=0;j<K;j++){
      if(digit[i]==no[j]&&digit[i]!=9)digit[i]++;
      if(digit[i]==no[j]&&digit[i]!=9){digit[i]=0;digit[i+1]++;}
    }
  }
  int ans=digit[0]+10*digit[1]+100*digit[2]*1000*digit[3];
  cout<<ans<<endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:28: error: 'okies' was not declared in this scope
    8 |   for(int i=1;i<K;i++)cin>>okies[K];
      |                            ^~~~~
a.cc:13:9: error: 'j' was not declared in this scope
   13 |     for(j=0;j<K;j++){
      |         ^
Language: C++

N = int(input())
num = list(map(int,input().split()))
sumN = 0
for i in range(N):
    sumN += num[i]
ave = sumN//N
minN = 10**15
for j in range(-1,2):
    work = 0
    for k in range(N):
        work += pow(ave+j-num[k],2)
    minN = min(minN,work)
print(minN)

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

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int N,K;
  cin>>N>>K;
  int tar[5];
  for(int i=0;i<5;i++){
    tar[i]=N%10;
    N/=10;
    if(N==0)break;
  }
  int non[K];
  for(int i=0;i<K;i++)
    cin>>non[K];
  for(int i=0;i<5;i++){
    for(int j=0;j<9-K;j++){
      if(tar[i]==non[j])tar[i]++;
    }
  }
  int ans=tar[4]*10000+tar[3]*1000+tar[2]*100+tar[1]*10+tar[0];
  cout<<ns<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'ns' was not declared in this scope; did you mean 'ans'?
   22 |   cout<<ns<<endl;
      |         ^~
      |         ans
Language: Java

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

public class Beg42ProbC {
  static int MOD = 1000000007;
  static double EPS = 1e-9;

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

    StringTokenizer st = new StringTokenizer(in.readLine());

    String N = st.nextToken();
    int length = N.length();
    int K = Integer.parseInt(st.nextToken());

    TreeSet<Integer> set = new TreeSet<Integer>();

    st = new StringTokenizer(in.readLine());

    for (int i = 0; i < K; i++) {
      set.add(Integer.parseInt(st.nextToken()));
    }

    int[] valid = new int[10 - K];
    int index = 0;

    for (int i = 0; i < 10; i++) {
      if (!set.contains(i)) {
        valid[index] = i;
        index++;
      }
    }

    // System.out.println(Arrays.toString(valid));

    int res = 0;

    boolean b = true;
    boolean large = false;

    for (int i = 0; i < length; i++) {
      int d = N.charAt(i) - '0';
      // System.out.println(d);
      boolean done = false;
      if (large) {
        res = res * 10 + valid[0];
        continue;
      }
      for (int j = 0; j < valid.length; j++) {
        if (valid[j] >= d) {
          if (i == 0 && valid[j] > d)
            large = true;
          res = res * 10 + valid[j];
          done = true;
          break;
        }
      }
      if (!done) {
        b = false;
        break;
      }
    }

    if (!b) {
      res = valid[valid.length - 1];
      for (int i = 0; i < length - 1; i++) {
        res = res * 10 + valid[0];
      }
    }

    System.out.println(res);

    in.close();
  }
}

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

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

int main() {
    int N, K;
    cin >> N >> K;
    vector<bool> ban(10, false);
    for(int i=0; i<K; ++i) {
        int b;
        cin >> b;
        ban[b] = true;
    }
    for(int i=N; ; ++i) {
        string s = to_string(i);
        bool ok = true;
        for(int j=0; j<s.size(); ++j) {
            if(ban[s[j] - '0']) {
                ok = false;
                break;
            }
        }
        if(ok) {
            cout << s << endl;
            break;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'vector' was not declared in this scope
    9 |     vector<bool> ban(10, false);
      |     ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <algorithm>
  +++ |+#include <vector>
    4 | using namespace std;
a.cc:9:12: error: expected primary-expression before 'bool'
    9 |     vector<bool> ban(10, false);
      |            ^~~~
a.cc:13:9: error: 'ban' was not declared in this scope
   13 |         ban[b] = true;
      |         ^~~
a.cc:19:16: error: 'ban' was not declared in this scope
   19 |             if(ban[s[j] - '0']) {
      |                ^~~
Language: C++

#include<stdio.h>
int n;bool f[10];
bool ok(int x){
	while(x){
		if(f[x%10])return false;
		x/=10;
	}
	return true;
}
int main(){
	int k,x;
	for(scanf("%d%d",&n,&k); k--;){
		scanf("%d",&x);
		f[x] = true;
	}
	while(!ok(n))n++;
	printf("%d\n",n);
	return 0;

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

//#include <bits/stdc++.h>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <map>
#include <stack>
#include <bitset>
#include <array>
#include <set>
#include <string>

#include <iterator>
#include <algorithm>
#include <numeric>

#include <ios>
#include <sstream>
#include <iostream>
#include <fstream>
#include <climits>


using namespace std;

using ll=long long;

using vi=vector<int>;
using vvi=vector<vi>;
using vs=vector<string>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;

void OUT(bool isTrue, string t="YES", string f="NO"){
    cout<<(isTrue?t:f)<<endl;
}
void out(bool isTrue, string t="yes", string f="yes"){
    cout<<(isTrue?t:f)<<endl;
}

template <typename T>
string printItr(T b, T e, string delim=" ")
{
    stringstream ss;
    ostream_iterator<decltype(*b)> out_it(ss, delim.c_str());
    copy(b,e - 1, out_it);
    ss<<*(e-1);
    return ss.str();
}

void bulk(){}
template <class Head, class... Tail>
void bulk(Head& head, Tail&... tail){
    cin>>head;
    bulk(tail...);
}

#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define range(i,m,n) for(int i=m; i<n;i++)
#define each(i,n) for(auto i:n)
#define all(i) i.begin(),i.end()
#define cint(...) int __VA_ARGS__;bulk(__VA_ARGS__);

int main(void){
    cint(n,k);
    vi a(k),b;
    rep(i,k){cin>>a[i];}
    rep(i,10){if(find(all(a),i)==a.end())b.push_back(i);}
    b.push_back(b[0]+10);
    rep(i,(int)log10(n)+1){
        int p=n/((int)pow(10,i))%10;
        n+=(*lower_bound(all(b),p)-p)*(int)pow(10,i);
    }
    cout<<n;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:71:16: error: 'log10' was not declared in this scope
   71 |     rep(i,(int)log10(n)+1){
      |                ^~~~~
a.cc:58:32: note: in definition of macro 'rep'
   58 | #define rep(i,n) for(int i=0;i<n;i++)
      |                                ^
a.cc:72:23: error: 'pow' was not declared in this scope
   72 |         int p=n/((int)pow(10,i))%10;
      |                       ^~~
Language: C++

However, as mentioned before, she is very particular about numbers. When she hands money to the cashier, the decimal notation of the amount must not contain any digits that she dislikes. Under this condition, she will hand the minimum amount of money.



Compiler output:
a.cc:1:1: error: 'However' does not name a type
    1 | However, as mentioned before, she is very particular about numbers. When she hands money to the cashier, the decimal notation of the amount must not contain any digits that she dislikes. Under this condition, she will hand the minimum amount of money.
      | ^~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string.h>
using namespace sdtd;
int i,j,k,n;
bool dislike[10];

bool cek(int x)
{
	while (x>0)
	{
		int buntut=x%10;
		if (dislike[buntut])
		 return false;
		x/=10;
	}
	return true;
}

int main()
{
	memset(dislike,0,sizeof(dislike));
	cin>>n>>k;
	for (i=1;i<=k;i++)
	{
		cin>>j;
		dislike[j]=1;
	}
	while (1)
	{
		if (cek(n))
		{
			cout<<n<<"\n";
			return 0;
		}
		n++;
	}
}

Compiler output:
a.cc:4:17: error: 'sdtd' is not a namespace-name
    4 | using namespace sdtd;
      |                 ^~~~
a.cc: In function 'int main()':
a.cc:23:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   23 |         cin>>n>>k;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:33:25: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   33 |                         cout<<n<<"\n";
      |                         ^~~~
      |                         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string.h>

int i,j,k,n;
bool dislike[10];

bool cek(int x)
{
	while (x>0)
	{
		int buntut=x%10;
		if (dislike[buntut])
		 return false;
		x/=10;
	}
	return true;
}

int main()
{
	memset(dislike,0,sizeof(dislike));
	cin>>n>>k;
	for (i=1;i<=k;i++)
	{
		cin>>j;
		dislike[j]=1;
	}
	while (1)
	{
		if (cek(n))
		{
			cout<<n<<"\n";
			return 0;
		}
		n++;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   23 |         cin>>n>>k;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:33:25: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   33 |                         cout<<n<<"\n";
      |                         ^~~~
      |                         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

import java.util.*;

// ABC 42-C
// http://abc042.contest.atcoder.jp/tasks/arc058_a

public class Main {
	
	public static void main (String[] args) throws java.lang.Exception {
	    Scanner in = new Scanner(System.in);
	    
	    int n = in.nextInt();
	    int k = in.nextInt();
	    HashMap<Integer, Integer> avoid = new HashMap<Integer, Integer>();
	    
	    for (int i = 0; i < k; i++) {
	    	avoid.put(in.nextInt(), 1);
	    }
	    
	    while (!isConditionMet(avoid, n)) {
	    	n++;
	    }
	    System.out.println(n);
	}
	
	public static boolean isConditionMet(HashMap<Integer, Integer> avoid, int n) {
		while (n > 0) {
			if (avoid.containsKey(n % 10)) {
				return false;
			}
			if (n == 0) {
				break;
			}
			n /= 10;
		}
		return true;
	}
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: expected unqualified-id before 'public'
    6 | public class 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();
    int K = sc.nextInt();
    ArrayList<Integer> dislike = new ArrayList<Integer>();
    for(int i = 0; i < K; i++) {
      dislike.add(sc.nextInt());
    }
    int ans = N;
    while(true) {
      String s = String.valueOf(ans);
      int count = 0;
      for(int i = 0; i < s.length(); i++) {
        int d = Integer.parseInt(s.charAt(i));
        if(dislike.contains(d)) count++;
      }
      if(count == 0) break;
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:17: error: incompatible types: char cannot be converted to String
        int d = Integer.parseInt(s.charAt(i));
                                         ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    ArrayList<Integer> dislike = new ArrayList<Integer>();
    for(int i = 0; i < K; i++) {
      dislike.add(sc.nextInt());
    }
    ArrayList<Integer> like = new ArrayList<Integer>();
    for(int i = 0; i < 10; i++) {
      if(!(dislike.contains(i))) like.add(i);
    }
    ArrayList<Integer> digit = new ArrayList<Integer>();
    int digitNum = 0;
    for(int i = 1; i <= 4; i++) {
      if(N < (int)Math.pow(10, i)) {
        digitNum = i;
        break;
      }
    }
    for(int i = 0; i < digitNum; i++) {
      int a = N / (int)Math.pow(10, digitNum - i - 1);
      digit.get(a % 10);
    }
    int firstIndex = 4;
    for(int i = 0; i < digit.size(); i++) {
      if(digit.get(i) > like.get(like.size() - 1)) {
        firstIndex = i;
        break;
      }
    }
    String ans = "";
    if(firstIndex == 4) {
      for(int i = 0; i < digit.size(); i++) {
        for(int j = 0; j < like.size(); j++) {
          if(digit.get(i) <= like.get(j)) {
            ans += String.valueOf(like.get(j));
            break;
          }
        }
      }
    } else {
      int min = like.get(0);
      int nonzero = min;
      if(min == 0) nonzero = like.get(1);
      boolean flg = false;
      int victory = 0;
      for(int i = 0; i < firstIndex; i++) {
        if(digit.get(i) < like.get(like.size() - 1)) {
          victory = i;
          flg = true;
          break;
        }
      }
      if(flg) {
        for(int i = 0; i < victory; i++) {
          for(int j = 0; j < like.size(); j++) {
            if(digit.get(i) <= like.get(j)) {
              ans += String.valueOf(like.get(j));
              break;
            }
          }
        }
        for(int j = 0; j < like.size(); j++) {
          if(digit.get(i) < like.get(j)) {
            ans += String.valueOf(like.get(j));
            break;
          }
        }
        for(int i = victory + 1; i < digit.size(); i++) {
          ans += String.valueOf(min);
        }
      } else {
        ans += String.valueOf(nonzero);
        for(int i = 0; i < digit.size(); i++) {
          ans += String.valueOf(min);
        }
      }
    }
    System.out.println(Integer.parseInt(ans));
  }
}

Compiler output:
Main.java:68: error: cannot find symbol
          if(digit.get(i) < like.get(j)) {
                       ^
  symbol:   variable i
  location: class Main
1 error
Language: C++

#include <stdio.h>
#include <cstdlib>
#include <algorithm>
 
int N, K, D[11];
char temp[112345];
bool match_flag = false;
int ans;
 
int GetDigit(int num)
{
	int res = 0;
	while (num != 0)
	{
		num /= 10;
		++res;
	}
	return res;
}
 
int main(void)
{
	scanf("%d%d", &N, &K);
	for (int i = 0; i < K; ++i) { scanf("%d", &D[i]); }
 
	for (int i = N; i <= 10 * N; ++i)
	{
		itoa(i, temp, 10);
		for (int j = 0; j < GetDigit(i); ++j)
		{
			for (int k = 0; k < K; ++k)
			{
				if ((temp[j] - '0') == D[k])
				{
					match_flag = true;
					break;
				}
			}
			if (match_flag == true)
			{
				break;
			}
		}
		if (match_flag == false)
		{
			ans = i;
			break;
		}
		match_flag = false;
	}
 
	printf("%d\n", ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:17: error: 'itoa' was not declared in this scope
   28 |                 itoa(i, temp, 10);
      |                 ^~~~
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
 
int N, K, D[11];
char temp[112345];
bool match_flag = false;
int ans;
 
int GetDigit(int num)
{
	int res = 0;
	while (num != 0)
	{
		num /= 10;
		++res;
	}
	return res;
}
 
int main(void)
{
	scanf("%d%d", &N, &K);
	for (int i = 0; i < K; ++i) { scanf("%d", &D[i]); }
 
	for (int i = N; i <= 10 * N; ++i)
	{
		itoa(i, temp, 10);
		for (int j = 0; j < GetDigit(i); ++j)
		{
			for (int k = 0; k < K; ++k)
			{
				if ((temp[j] - '0') == D[k])
				{
					match_flag = true;
					break;
				}
			}
			if (match_flag == true)
			{
				break;
			}
		}
		if (match_flag == false)
		{
			ans = i;
			break;
		}
		match_flag = false;
	}
 
	printf("%d\n", ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:17: error: 'itoa' was not declared in this scope
   28 |                 itoa(i, temp, 10);
      |                 ^~~~
Language: C++

#include <stdio.h>
#include <algorithm>

int N, K, D[11];
char temp[112345];
bool match_flag = false;
int ans;

int GetDigit(int num)
{
	int res = 0;
	while (num != 0)
	{
		num /= 10;
		++res;
	}
	return res;
}

int main(void)
{
	scanf("%d%d", &N, &K);
	for (int i = 0; i < K; ++i) { scanf("%d", &D[i]); }

	for (int i = N; i <= 10 * N; ++i)
	{
		itoa(i, temp, 10);
		for (int j = 0; j < GetDigit(i); ++j)
		{
			for (int k = 0; k < K; ++k)
			{
				if ((temp[j] - '0') == D[k])
				{
					match_flag = true;
					break;
				}
			}
			if (match_flag == true)
			{
				break;
			}
		}
		if (match_flag == false)
		{
			ans = i;
			break;
		}
		match_flag = false;
	}

	printf("%d\n", ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:17: error: 'itoa' was not declared in this scope
   27 |                 itoa(i, temp, 10);
      |                 ^~~~
Language: C++

#include <stdio.h>
#include <algorithm>

int N, K, D[11];
char buf[7];
bool break_flag = false;
int ans;

int my_atoi(char c)
{
	switch (c)
	{
	case '1':
		return 1;
	case '2':
		return 2;
	case '3':
		return 3;
	case '4':
		return 4;
	case '5':
		return 5;
	case '6':
		return 6;
	case '7':
		return 7;
	case '8':
		return 8;
	case '9':
		return 9;
	}
}

int main(void)
{
	scanf("%d%d", &N, &K);
	for (int i = 0; i < K; ++i) { scanf("%d", &D[i]); }

	for (int i = N; i <= 10 * N; ++i)
	{
		sprintf(buf, "%d", i);
		for (int j = 0; j < strlen(buf); ++j)
		{
			for (int k = 0; k < K; ++k)
			{
				if (my_atoi(buf[j]) == D[k])
				{
					break_flag = true;
					break;
				}
			}
			if (break_flag == true)
			{
				break;
			}
		}
		if (break_flag == false)
		{
			ans = i;
			break;
		}
		break_flag = false;
	}

	printf("%d\n", ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:37: error: 'strlen' was not declared in this scope
   42 |                 for (int j = 0; j < strlen(buf); ++j)
      |                                     ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 | 
a.cc: In function 'int my_atoi(char)':
a.cc:32:1: warning: control reaches end of non-void function [-Wreturn-type]
   32 | }
      | ^
Language: C++

#include <stdio.h>
#include <algorithm>

int N, K, D[11];
char buf[7];
int ans;

int my_atoi(char c)
{
	switch (c)
	{
	case '1':
		return 1;
	case '2':
		return 2;
	case '3':
		return 3;
	case '4':
		return 4;
	case '5':
		return 5;
	case '6':
		return 6;
	case '7':
		return 7;
	case '8':
		return 8;
	case '9':
		return 9;
	}
}

int main(void)
{
	scanf("%d%d", &N, &K);
	for (int i = 0; i < K; ++i) { scanf("%d", &D[i]); }

	for (int i = N; i <= 10 * N; ++i)
	{
		sprintf(buf, "%d", i);
		for (int j = 0; j < strlen(buf); ++j)
		{
			for (int k = 0; k < K; ++k)
			{
				if (my_atoi(buf[j]) == D[k])
				{
					goto not;
				}
			}
		}
		ans = i;
		break;
		not:
		i = i;
	}

	printf("%d\n", ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:37: error: 'strlen' was not declared in this scope
   41 |                 for (int j = 0; j < strlen(buf); ++j)
      |                                     ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 | 
a.cc:47:46: error: expected identifier before 'not' token
   47 |                                         goto not;
      |                                              ^~~
a.cc:47:45: error: expected ';' before 'not' token
   47 |                                         goto not;
      |                                             ^~~~
      |                                             ;
a.cc:47:49: error: expected primary-expression before ';' token
   47 |                                         goto not;
      |                                                 ^
a.cc:53:20: error: expected primary-expression before ':' token
   53 |                 not:
      |                    ^
a.cc: In function 'int my_atoi(char)':
a.cc:31:1: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      | ^
Language: C++

#include <stdio.h>
#include <algorithm>

int N, K, D[11];
char buf[7];
int ans;

int my_atoi(char c)
{
	switch (c)
	{
	case '1':
		return 1;
	case '2':
		return 2;
	case '3':
		return 3;
	case '4':
		return 4;
	case '5':
		return 5;
	case '6':
		return 6;
	case '7':
		return 7;
	case '8':
		return 8;
	case '9':
		return 9;
	}
}

int main(void)
{
	scanf("%d%d", &N, &K);
	for (int i = 0; i < K; ++i) { scanf("%d", &D[i]); }

	for (int i = N; i <= 10 * N; ++i)
	{
		itoa(i, buf, 10);
		for (int j = 0; j < strlen(buf); ++j)
		{
			for (int k = 0; k < K; ++k)
			{
				if (my_atoi(buf[j]) == D[k])
				{
					goto not;
				}
			}
		}
		ans = i;
		break;
		not:
		i = i;
	}

	printf("%d\n", ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:17: error: 'itoa' was not declared in this scope
   40 |                 itoa(i, buf, 10);
      |                 ^~~~
a.cc:41:37: error: 'strlen' was not declared in this scope
   41 |                 for (int j = 0; j < strlen(buf); ++j)
      |                                     ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 | 
a.cc:47:46: error: expected identifier before 'not' token
   47 |                                         goto not;
      |                                              ^~~
a.cc:47:45: error: expected ';' before 'not' token
   47 |                                         goto not;
      |                                             ^~~~
      |                                             ;
a.cc:47:49: error: expected primary-expression before ';' token
   47 |                                         goto not;
      |                                                 ^
a.cc:53:20: error: expected primary-expression before ':' token
   53 |                 not:
      |                    ^
a.cc: In function 'int my_atoi(char)':
a.cc:31:1: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      | ^
Language: Java

import java.util.Scanner;
import java.util.LinkedList;

public class ABC042C {
	public static void main(String[] args) {
		IrohasObsession iroha = new IrohasObsession();
		iroha.run();
	}
}

class IrohasObsession {
	
	int N;
	int K;
	int[] dislikeNums;
	
	IrohasObsession() {
		//input
		Scanner cin = new Scanner(System.in);
		this.N = cin.nextInt();
		this.K = cin.nextInt();
		this.dislikeNums = new int[K];
		for (int i = 0; i < K; i++) {
			dislikeNums[i] = cin.nextInt();
		}
	}
	
	void run() {
		int i = N;
		while (true) {
			if (!isContains(i)) {
				break;
			}
			i++;
		}
		System.out.println(i);
	}
	
	boolean isContains(int num) {
		char[] tmpNums = String.valueOf(num).toCharArray();
		LinkedList<Integer> list = new LinkedList<Integer>();
		for (int i = 0; i < tmpNums.length; i++) {
			list.add(Integer.valueOf(String.valueOf(tmpNums[i])));
		}
		for (int i = 0; i < K; i++) {
			if (list.contains(this.dislikeNums[i])) {
				return true;
			}
		}
		return false;
	}
	
}


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

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

int main() {
  // 入力
  int N, K;  // N:購入金額, K:嫌いな数字の個数
  cin >> N >> K;
  bool num[10] = {false};
  int tmp;
  for (int i=0; i<K; i++) {
    cin >> tmp;
    num[tmp] = true;
  }

  bool able[10000] = {false};
  string n;
  for (int i=1; i<=10000; i++) {
    n=to_string(i);
    for (int j=0; j<n.size(); j++) {
      tmp = (int)(n[j]-'0');
      if (num[tmp]) able[i] = true;
    }
  }

  for (int i=N; i<=10000; i++) {
    if (!able[i]) {
      int ans = i;
    }
  }

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


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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Arrays;

public class Main {

    private static Scanner sc;

    public static void main(String[] args) {
        Main instance = new Main();
        sc = instance.new Scanner();
        instance.solve();
    }

    private void solve() {
        try {
            List<Integer> numbers = new ArrayList<Integer>(Arrays.asList(0,1,2,3,4,5,6,7,8,9));
            
            String n = sc.next();
            int k = sc.nextInt();

            for (int i = 0; i < k; i++) {
              int d = sc.nextInt();
              if (numbers(i) == d) {
                numbers.remove(i);
                continue;
              }
            }

            String[] answerArray = new String[4];
            for (int i = 0; i < n.length(); i++) {
              int number = n.charAt(i);

              for (int j = 0; j < k; j++) {
                if (number <= numbers.get(j)) {
                  answerArray[i] = String.valueOf(numbers.get(j));
                  break;
                }
              }
            }

            System.out.println(Intger.parseInt(String.join("", answerArray));

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private class Scanner {
        String[] s;
        int i;
        BufferedReader br;
        String regex = " ";

        public Scanner() {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        @Override
        protected void finalize() throws Throwable {
            try {
                super.finalize();
            } finally {
                destruction();
            }
        }

        private void destruction() throws IOException {
            if (br != null) br.close();
        }

        public String next() throws IOException {
            if (i < s.length) return s[i++];
            String st = br.readLine();
            while (st == "") st = br.readLine();
            s = st.split(regex, 0);
            i = 0;
            return s[i++];
        }

        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }

        public Long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }

        public Double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        }
    }
}


Compiler output:
Main.java:46: error: ')' or ',' expected
            System.out.println(Intger.parseInt(String.join("", answerArray));
                                                                            ^
1 error
Language: C

#include <iostream>
#include <vector>

int main(void)
{
  int n;
  int k;
  std::cin >> n >> k;
  auto ds = std::vector<int>(k);
  for (int i = 0; i < k; i++) {
    std::cin >> ds[i];
  }
  int result = n;
  while (true) {
    auto s = std::to_string(result);
    for (auto &&c : s) {
      for (auto &&d : ds) {
        if (d == c - '0') {
          goto next;
        }
      }
    }
    std::cout << result << '\n';
    return 0;
  next:
    result += n;
  }
}


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

import java.util.Scanner;
import java.util.Arrays;
public class irohaDigit {
	public static void main(String[] args)
	{
		int N;
		int D;
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		D = sc.nextInt();
		int d[] = new int[10];
		for(int i=0;i<D;i++)
		{
			d[sc.nextInt()]=1;
		}
		int sum=0;
		int start9= 0;
		int maxD = String.valueOf(N).length();
		for(int i=maxD-1;i>=0;i--)
		{
			int x = N/(int)(Math.pow(10,i));
			N = N%(int)Math.pow(10, i);
			if(d[x]==1)
			{	
				{
					for(int j=x;j<10;j++)
					{	if(d[j]!=1)
						{
							x=j;
							break;
						}
						else
							if(j==9)
							{	j=-1;
								start9=1;
							}
					}
				}
				
			}
			if(i==(maxD-1) && start9==1)
				sum = sum+10*(int)Math.pow(10,i);
			else
				sum = sum+x*(int)Math.pow(10,i);
			if(N==0)
				break;
		}
		System.out.print(sum);
	}
}


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

#include <iostream>
#include <cmath>
#include <algorithm>
#include <stdio.h>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <sstream>
#include <vector>
#include <map>
using namespace std;


const int N = 10000;

int arr[N];

bool func(string str, int *arr, int k);

int main()
{
	string str;
	int n, k;

	cin >> n >> k;

	for (int i = 0; i < k; i++) {
		cin >> arr[i];
	}

	str = to_string(n);

	while(func(str, arr, k)){
		n++;
		str = to_string(n);
	}

	cout << str << endl;
	return 0;
}

bool func(string str, int *arr, int k)
{
	for (int i = 0; i < k; i++) {
		if (str.find(to_string(arr[i])) != -1) {
			return true;
		}
	}

	return false;

Compiler output:
a.cc: In function 'bool func(std::string, int*, int)':
a.cc:50:22: error: expected '}' at end of input
   50 |         return false;
      |                      ^
a.cc:43:1: note: to match this '{'
   43 | {
      | ^
Language: C++

include <iostream>

using namespace std;

int main(){
    int n,k,ans;
    int D[10];

    cin >> n >> k;
    for(int i=0;i < k;i++){
        cin >> D[i];
    }

    int count = 1,num,flag=1,old_ans;
    while(1){
        ans = n*count;
        old_ans = ans;
        flag = 1;
        while(old_ans > 0){
            num = old_ans % 10;
            for(int i = 0;i<k;i++){
                if(num == D[i]){
                    flag = 0;
                    break;
                }
            }
            if(flag == 0){
                count++;
                break;
            }
            old_ans /= 10;
        }
        if(flag == 1){
            break;
        }
    }
    cout << n*count<<endl;

}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:9:5: error: 'cin' was not declared in this scope
    9 |     cin >> n >> k;
      |     ^~~
a.cc:37:5: error: 'cout' was not declared in this scope; did you mean 'count'?
   37 |     cout << n*count<<endl;
      |     ^~~~
      |     count
a.cc:37:22: error: 'endl' was not declared in this scope
   37 |     cout << n*count<<endl;
      |                      ^~~~
Language: C++

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int amount = sc.nextInt();
		int number = sc.nextInt();
		boolean [] discard = new boolean[10];
 		for(int i = 0; i < number; i ++) {
			discard[sc.nextInt()] = true; 			
		}

		int result = 0;
		int remain = 0;
		int base = 1;
		while(amount != 0 || remain != 0) {
			int digit = amount % 10 + remain;
			int upDigit = digit + 9;
			while((digit <= upDigit) && discard[digit % 10]) digit ++;
			remain = digit / 10;
			digit = digit % 10;
			result += digit * base;
			base *= 10;
			amount /= 10;
		}
		System.out.println(result);
	}
}

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

import java.util.Scanner;

/**
 * Created by wild on 2016/07/23.
 */
public class Main {
    public static void main(String[] args) {
        //入力
        Scanner scan = new Scanner(System.in);
        String[] tmpstr = scan.next().split("");
        int[] money = new int[5];
        int tmpcnt = 0;
        for (int i = 1; i < money.length; i++) {
            money[i] = Integer.parseInt(tmpstr[tmpcnt]);
            tmpcnt++;
        }

        int num = scan.nextInt();
        int[] hate = new int[num];
        for (int i = 0; i < hate.length; i++) {
            hate[i] = scan.nextInt();
        }


        boolean complate = false;
        boolean equ = false;
        boolean mbZero = true;
        while (!complate) {
            for (int i = 0; i < money.length; i++) {
                if (i == 0 && mbZero) {
                    continue;
                } else {
                    mbZero = false;
                }
                for (int j = 0; j < hate.length; j++) {
                    if (money[i] == hate[j]) {
                        money[i]++;
                        if (money[i] == 10) {
                            money[i] = 0;
                            money[i - 1]++;
                            equ = true;
                            break;
                        }
                    }
                }

                if (equ) {
                    break;
                }
            }
            if (!equ) {
                complate = true;
            } else {
                mbZero = true;
                equ = false;
            }
        }

        boolean zero = true;
        for (int tmp : money) {
            if (tmp == 0 && zero){
                continue;
            }else {
                zero = false;
            }
            System.out.print(tmp);
        }
    }

Compiler output:
Main.java:68: error: reached end of file while parsing
    }
     ^
1 error
Language: C++

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

bool can_pay(int x, vector<int> ds) {
    for ( ; x > 0; x /= 10) {
        int digit = x % 10;
        if (find(begin(ds), end(ds), digit) != end(ds)) {
            return false;
        }
    }
    return true;
}

int main() {
    int n, k;
    cin >> n >> k;
    vector<int> ds(k);
    for (auto &d : ds) {
        cin >> d;
    }

    for (int i = n; i < 1000000; i++) {
        if (can_pay(i, ds)) {
            cout << i << endl;
            break;
        }
    }
}


Compiler output:
a.cc: In function 'bool can_pay(int, std::vector<int>)':
a.cc:8:17: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
    8 |         if (find(begin(ds), end(ds), digit) != end(ds)) {
      |             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:8:17: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
    8 |         if (find(begin(ds), end(ds), digit) != end(ds)) {
      |             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: Java

import java.util.ArrayList;
import java.util.Scanner;

/**
 * Created by wild on 2016/07/23.
 */
public class C {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String[] tmpmoney = scan.next().split("");
        int[] money = new int[tmpmoney.length];
        for (int i = 0; i < tmpmoney.length; i++) {
            money[i] = Integer.parseInt(tmpmoney[i]);
        }
        ArrayList<Integer> mon = new ArrayList<Integer>();
        for (int i = money.length - 1; i > -1; i--) mon.add(money[i]);
        int disnum = scan.nextInt();
        int[] num = new int[disnum];
        for (int i = 0; i < disnum; i++) {
            num[i] = scan.nextInt();
        }

        boolean ok = false;
        for (int i = 0; i < mon.size(); ) {
            if (mon.get(i) > 9) {
                if (i == mon.size() - 1) {
                    mon.set(i, 0);
                    mon.add(i + 1, 1);
                } else {
                    mon.set(i + 1, mon.get(i + 1) + 1);
                    mon.set(i, 0);
                }
            }

            for (int j = 0; j < num.length; j++) {
                if (mon.get(i) == num[j]) {
                    mon.set(i, mon.get(i) + 1);
                    break;
                }

                if(j == num.length-1){
                    ok = true;
                    break;
                }
            }

            if (ok) {
                ok = false;
                i++;
            }
        }

        for (int i = mon.size()-1; i > -1; i--){
            System.out.print(mon.get(i));
        }
    }
}

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

#include <iostream>
using namespace std;

int main(){
	int n,k;
	bool arr[10] = {};
	cin >> n >> k;
	while(k--){
		int d;
		cin >> d;
		arr[d] = true;
	}
	for(int i = n;i < 10000;i++){
		int tmp = i;
		bool f = true;
		while(tmp){
			if(arr[x % 10]) f = false;
			x /= 10;
		}
		if(f){
			cout << i << endl;
			return 0;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:32: error: 'x' was not declared in this scope
   17 |                         if(arr[x % 10]) f = false;
      |                                ^
a.cc:18:25: error: 'x' was not declared in this scope
   18 |                         x /= 10;
      |                         ^
Language: C++

#include <iostream>
#include <stdio.h>       // printf,scanf
#include <stdlib.h>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm>  //sort,binarySearch
#include <functional> 
#include <iomanip> // setprecision
#include <utility>    // c+11 Array
#include <set>
#include <sstream>
#include <bits/stdc++.h>
#define PI 3.141592653589793238462643383279
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define pb(x) push_back(x)
#define debug(x) cout << #x << " = " << x << endl;
#define debret(x) debug(x) ; return 0;

using namespace std;

int main(void){

    string pay;
    int hate;

    cin >> pay >> hate;

    int pay_2_i[pay.size()];
    int copy = stoi(pay);
    REP(i,pay.size()){
        pay_2_i[i] = pay[i] - '0';
    }

    int h[hate];
    REP(i,hate){
        cin >> h[i];
    }
    int j;
    REP(i,pay.size()){
        for(j = 0;j<hate;j++){
            if(pay_2_i[i] == h[j]){
                pay_2_i[i]++;
                pay_2_i[i] = pay_2_i[i] % 10;
                j = -1;
            }
        }
    }
    int ans = 0;

    for(int i = 0; i < pay.size();i++){
        ans += pay_2_i[pay.size()-1-i]*pow(10,i);
    }

    sort(pay_2_i,pay_2_i+pay.size());
    if(copy > ans){
        REP(i,copy.size())
            if(pay_2_i[i] != 0){
                cout << pay_2_i[i];
                break;
            }
    }

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


Compiler output:
a.cc: In function 'int main()':
a.cc:58:20: error: request for member 'size' in 'copy', which is of non-class type 'int'
   58 |         REP(i,copy.size())
      |                    ^~~~
a.cc:15:37: note: in definition of macro 'FOR'
   15 | #define FOR(i,a,b) for(int i=(a);i<(b);++i)
      |                                     ^
a.cc:58:9: note: in expansion of macro 'REP'
   58 |         REP(i,copy.size())
      |         ^~~
Language: C++

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

using namespace std;

int main()
{
	int n, k;
	cin >> n >> k;
	vector<int> d(k);
	for(int i = 0;i < k;i++){
		cin >> d[i];
	}
	vector<int> uk(10 - k);
	for(int i = 0;i < 10;i++){
		if(!binary_search(d.begin(), d.end(), i)){
			uk.push_back(i);
		}
	}
	
	vector<int> r(4);
	r[0] = n % 10;
	n /= 10;
	r[1] = n % 10;
	n /= 10;
	r[2] = n % 10;
	n /= 10;
	r[3] = n % 10;
	n /= 10;
	
	bool f = false;
	
	int ans = 0;
	
	
	if(!f){
		bool sf;
		for(int i = 0;i <= r[3];i++){
			if(binary_search(d.begin(), d.end(), r[3] + i)){
				sf = true;
			}else{
				ans += ((r[3] + i) * 1000);
				if(i == 0){
					f = true;
				}
				sf = false;
				break;
			}
		}
		if(sf){
			ans += 10000;
			f = true;
		}
	}
	
	if(!f){
		for(int i = 0;i <= r[2];i++){
			if(binary_search(d.begin(), d.end(), r[2] + i)){
			}else{
				ans += ((r[2] + i) * 100);
				if(i == 0){
					f = true;
				}
				break;
			}
		}
	}else{
		for(int i = 0;i < 10 - k;i++){
			if(uk[i] >= r[2]){
				ans += uk[i] * 100;
				break;
			}
		}
	}
	if(!f){
		for(int i = 0;i <= r[1];i++){
			if(binary_search(d.begin(), d.end(), r[1] + i)){
			}else{
				ans += ((r[1] + i) * 10);
				if(i == 0){
					f = true;
				}
				break;
			}
		}
	}else{
		for(int i = 0;i < 10 - k;i++){
			if(uk[i] >= r[2]){
				ans += uk[i] * 10;
				break;
			}
		}
	}
	if(!f){
		for(int i = 0;i <= r[0];i++){
			if(binary_search(d.begin(), d.end(), r[0] + i)){
			}else{
				ans += r[0] + i);
				if(i == 0){
					f = true;
				}
				break;
			}
		}
	}else{
		for(int i = 0;i < 10 - k;i++){
			if(uk[i] >= r[2]){
				ans += uk[i];
				break;
			}
		}
	}
	
	
	cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:99:48: error: expected ';' before ')' token
   99 |                                 ans += r[0] + i);
      |                                                ^
      |                                                ;