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

#include <iostream>
#include <vector>
#include <string>

using namespace std;

typedef long long ll;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);

int main()
{
    fastInp;

    ll k;
    string n;
    cin >> n >> k;

    vector<ll> bd(k);
    vector<bool> hate(10);
    ll lst = -1;
    for (int i = 0; i < k; i++) {
        cin >> bd[i];
        hate[bd[i]] = 1;
    }

    bool gd = false;
    for (int i = 0; i < n.size(); i++) {
        bool flag = false;
        if (gd) n[i] = '0';
        for (int j = n[i] - '0'; j < 10; j++) {
            if (hate[j]) continue;

            flag = true;
            n[i] = j + '0';
            if (n[i] - '0' != j) gd = true;
            break;
        }

        if (!flag) {
            
                ll k;
                for (k = i; k >= 0; k--) {
                    bool flag = false;
                    for (int t = n[k] - '0'; t < 10; t++) {
                        if (hate[j]) continue;

                        flag = true;
                        n[i] = t +'0';
                        break;
                    }
                    if (flag) break;
                }
                if (k == -1) {
                    for (int j = 1; j < 10; j++) {
                        if (hate[j]) continue;

                        for (int k = 0; k < n.size() + 1; k++) cout << j;
                        return 0;
                    }
                } else {
                    for (int j = k; j < n.size(); j++) {
                        for (int t = 0; t < 10; t++) {
                            if (hate[t]) continue;

                            n[i] = j + '0';
                            break;
                        }
                    }
                }
                
                
                return 0;
            
        }
    }

    cout << n;

    return 0;    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:34: error: 'j' was not declared in this scope
   45 |                         if (hate[j]) continue;
      |                                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef double db;
typedef long long ll;
//typedef pair<int, int> pii;
//#define fi first
//#define se second
#define lbd(a, x) lower_bound(all(a), x)
const int mod = 1e9 + 7;
const int M = 10100;
const int N = 2100;
struct pii {
	int fi, se;
	pii(int x=0, int y=0):fi(x),se(y) {}
};
bitset<M> ok[N];
char vs[N][M];
int len[N];
int S = 15000;
pii q[2][S+N];
int t[2];
int main() {
#ifdef local
	freopen("in.txt", "r", stdin);
#endif
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	int n, k; cin >> n >> k;
	for(int i = 0; i < n; i++) {
		cin >> vs[i];
		len[i] = strlen(vs[i]);
	}
	ok[n][0] = 1;
	for(int i = n - 1; i; i--) {
		ok[i] = ok[i + 1] | (ok[i + 1] << len[i]);
	}
	int now = 0;
	for(int i = 0; i < n; i++) {
		if(ok[i + 1][k - len[i]]) {
			q[now][t[now]++] = pii(i, 0);
		}
	}
	string ans;
	for(int i = 0; i < k; i++) {
		now ^= 1;
		char z = 'z' + 1;
		for(int j = 0; j < t[now^1]; j++) {
			auto &e = q[now^1][j];
			z = min(z, vs[e.fi][e.se]);
		}
		ans.push_back(z);
		int zz = n;
		for(int j = 0; j < t[now^1]; j++) {
			auto &e = q[now^1][j];
			if(vs[e.fi][e.se] == z) {
				if(e.se == len[e.fi] - 1) {
					zz = min(zz, e.fi);
				} else {
					e.se++;
					q[now][t[now]++] = e;
				}
			}
		}
		int need = k - i - 1;
		for(int j = zz + 1; j < n && t[now] < S; j++)
			if(need >= len[j] && ok[j + 1][need - len[j]])
				q[now][t[now]++] = pii(j, 0);
		if(t[now] >= S) t[now] = S;
		t[now^1] = 0;
	}
	cout << ans << '\n';
	return 0;
}


Compiler output:
a.cc:20:11: error: size of array 'q' is not an integral constant-expression
   20 | pii q[2][S+N];
      |          ~^~
Language: Java

import java.util.*;
public class A {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int k = sc.nextInt();
		Set<Integer> set = new HashSet<Integer>();
		for(int i=0;i<k;i++){
			set.add(sc.nextInt());
		}
		
		while(true){
			boolean has = contain(n, set);
			if(has)
				n++;
			else
				break;
		}
		
		System.out.println(n);
	}
	static boolean contain(int n, Set<Integer> set){
		while(n>0){
			if(set.contains(n%10))
				return true;
			n/=10;
		}
		return false;
	}
}


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

#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;


#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
typedef long long ll;


void Main(){
	int N,K;
   	cin >> N >> K;
   	vector<int> D(K);
   	rep(i,K) { cin >> D[i]; }  
  
   	auto keta = [&](int n){
    	int count = 1;
       	while(n>=10){
        	n /= 10;
           	count++;
       	}
       	return count;
   	};
   
   	// n の下から k 桁目の数字
   	// = n の上から (keta(n) - k + 1) 桁目の数字
   	auto digitk = [&](int n, int k){
       	rep(i,k-1){
          	n /= 10;
       	}
       	return n%10;
   	};
   	
  	// D[i] <-> E[i] = {0,1,2,3,4,5,6,7,8,9} - D
	vector<int> E(10-K);
    int j = 0;
  	int flag0; 
  	rep(i,10){
		flag0 = 0;
      	rep(k,K){	
      		if(i == D[k]){
				flag0 = 1;
              	break;
            }
        }
      	if(flag0 == 0){
          E[j] = i;
          ++j;
        }
    }
  
   	int ketaN = keta(N);
   	int flag, decided;
  	int temp;
   	vector<int> ans(ketaN+1);
  	K = 10-K;
  
   	// 調べる桁 : digit = 1 からスタート. 最大で digit = ketaN まで.
   	// (A) N の digit 桁目と一致する E[i] がある？
   	// 	-> Yes: 暫定 ans[digit] = i. ++digit して (A) へ
   	// 	-> No : (B) (N の digit 桁目) < D[K-1] か？
   	//		-> Yes: (N の digit 桁目) を超える最小の D[j] を取ってきて ans[digit] = j. 
   	//				残りの桁は D[0].
   	//		-> No : ans[digit-1] = temp+1. 残りの桁は D[0].	
  	// 			[例外処理] 一番下の桁から見る. temp+1 = K ならば temp 

  	rep3(digit, 1, ketaN){
      	flag = 0;
      	decided = 0;
  		// (A)
    	rep(i,K){
   			if( digitk(N, ketaN - digit + 1) == E[i] ){
				ans[digit] = i;
          		flag = 1;
              	temp = i;
    			break;
       	 	}
    	}  	
      	// (B)
    	if(flag == 0){
          	if(digitk(N, ketaN - digit + 1) == 0){
            	ans[digit] = 0;
              	decided = 1;
            }
          	else if (digitk(N, ketaN - digit + 1) < E[K-1]){
  				rep3rev(j,K-2,0){            		
              		if(digitk(N, ketaN - digit + 1) > E[j]){
              			ans[digit] = j+1;
                      	decided = 1;
                      	break;
                	}
                }
            }
          	else {
              	ans[digit-1] = temp+1;
              	decided = 1;
              	break;
                }
            }
        }
      	if(decided == 1){
			rep3(j,1,ketaN-digit){
          		ans[digit+j] = 0;
            }
        	break;
        }
  	}
  	
  	rep3rev(i,ketaN,1){
  	    if(ans[i]>K){
  	        ans[i]=0;
  	        ans[i-1]++;
  	    }
  	}
  	
	rep3(i,1,ketaN){ cout << E[ans[i]];}
  	cout << endl; 
  	return;
    
}
  
int main(){
 cin.tie(nullptr);
 ios_base::sync_with_stdio(false);
 cout << fixed << setprecision(15);
 Main();
 return 0;
}

Compiler output:
a.cc:2:9: fatal error: boost/multi_array.hpp: No such file or directory
    2 | #include<boost/multi_array.hpp>
      |         ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
bool t[10];

bool dfs(int n)
{
	while(n>0)
	{
		if(t[n%10])
			return false;
		n/=10;
	}
	return true;
}
int main()
{
	int n,k,a;
	cin>>n>>k;
	for(int i=0;i<k;i++)
	{
		cin>>a;
		t[a]=true;
	}
	while(!dfsn))
		n++;
	cout<<n;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:16: error: 'dfsn' was not declared in this scope; did you mean 'dfs'?
   24 |         while(!dfsn))
      |                ^~~~
      |                dfs
a.cc:24:21: error: expected primary-expression before ')' token
   24 |         while(!dfsn))
      |                     ^
Language: C++

MAX_N = 10005

n, _ = input().split(' ')
n = int(n)

dislikes = set(map(int, input().split(' ')))

for num in range(n, MAX_N):
    num_set = set(str(num))
    if len(dislikes & num_set) > 0:
        continue
    print(num)
    break


Compiler output:
a.cc:1:1: error: 'MAX_N' does not name a type
    1 | MAX_N = 10005
      | ^~~~~
Language: C++

#include <bits/stdc++.h>

#define l_b lower_bound
#define u_b upper_bound

using namespace std;

typedef long long ll;







int n, k;
set<int> s;


int main() {
	for (int i = 0; i < 10; i++)
		s.insert(i);
	cin >> n >> k;
	{
		int d;
		for (int i = 0; i < k; i++)
			cin >> d, s.erase(d);
	}
	string t = to_string(n), q;
	if (s.l_b(t[0] - '0') == s.end()) {
		cout << *s.u_b(0);
		int z = *s.begin()
		for (int i = 0; i < t.size(); i++)
			cout << z;
		return 0;
	}
	for (int i = 0; i < t.size(); i++) {
		auto z = s.l_b(t[i] - '0');
		if (z == s.end()) {
			q.back() = *s.u_b(t[i - 1] - '0') + '0';
			i--;
			continue;
		}
		if (*z == t[i] - '0') {
			q.push_back(t[i]);
			continue;
		}
		cout << q << *z;
		z = s.begin();
		for (int j = i + 1; j < t.size(); j++)
			cout << *z;
		return 0;
	}
	cout << q;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:17: error: expected ',' or ';' before 'for'
   33 |                 for (int i = 0; i < t.size(); i++)
      |                 ^~~
a.cc:33:33: error: 'i' was not declared in this scope
   33 |                 for (int i = 0; i < t.size(); i++)
      |                                 ^
Language: C++

#include <bits/stdc++.h>

#define l_b lower_bound
#define u_b upper_bound

using namespace std;

typedef long long ll;







int n, k;
set<int> s;


int main() {
	for (int i = 0; i < 10; i++)
		s.insert(i);
	cin >> n >> k;
	{
		int d;
		for (int i = 0; i < k; i++)
			cin >> d, s.erase(d);
	}
	string t = to_string(n), q;
	if (s.l_b(t[0] - '0') == s.end()) {
		cout << *s.u_b(0);
		for (int i = 0; i < t.size(); i++)
			cout << *s.begin();
		return 0;
	}
	for (int i = 0; i < t.size(); i++) {
		auto z = s.l_b(t[i] - '0');
		if (z == s.end()) {
			q.back() = *s.u_b(t[i - 1] - '0') + '0';
			i--;
			continue;
		}
		if (*z == t[i] - '0') {
			q.push_back(t[i]);
			continue;
		}
		cout << q << *z;
		z = s.begin()
		for (int j = i + 1; j < t.size(); j++)
			cout << *z;
		return 0;
	}
	cout << q;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:30: error: expected ';' before 'for'
   48 |                 z = s.begin()
      |                              ^
      |                              ;
   49 |                 for (int j = i + 1; j < t.size(); j++)
      |                 ~~~           
a.cc:49:37: error: 'j' was not declared in this scope
   49 |                 for (int j = i + 1; j < t.size(); j++)
      |                                     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,k;
	cin>>n>>k;
	int a[k];
	bool like[10];
	for(int i=0;i<10;i++){
		like[i]=true;
	} 
	for(int i=0;i<k;i++){
		cin>>a[i];
		like[a[i]]=false;
	}
	bool flag=false;
	for(int i=1;i<=n*10;i*=10){
		if(flag==true){
			i/=10;
			flag=false;
		}
		if(like[n/i%10]){
			continue;
		}
		else{
			n+=i;
			if(i==1){
				flag=true;
			}
			else{
				i/=10;
			}
		}
	}
	cout<<n;
} #include<bits/stdc++.h>
using namespace std;
int main(){
	int n,k;
	cin>>n>>k;
	int a[k];
	bool like[10];
	for(int i=0;i<10;i++){
		like[i]=true;
	} 
	for(int i=0;i<k;i++){
		cin>>a[i];
		like[a[i]]=false;
	}
	bool flag=false;
	for(int i=1;i<=n*10;i*=10){
		if(flag==true){
			i/=10;
			flag=false;
		}
		if(like[n/i%10]){
			continue;
		}
		else{
			n+=i;
			if(i==1){
				flag=true;
			}
			else{
				i/=10;
			}
		}
	}
	cout<<n;
} #include<bits/stdc++.h>
using namespace std;
int main(){
	int n,k;
	cin>>n>>k;
	int a[k];
	bool like[10];
	for(int i=0;i<10;i++){
		like[i]=true;
	} 
	for(int i=0;i<k;i++){
		cin>>a[i];
		like[a[i]]=false;
	}
	bool flag=false;
	for(int i=1;i<=n*10;i*=10){
		if(flag==true){
			i/=10;
			flag=false;
		}
		if(like[n/i%10]){
			continue;
		}
		else{
			n+=i;
			if(i==1){
				flag=true;
			}
			else{
				i/=10;
			}
		}
	}
	cout<<n;
} #include<bits/stdc++.h>
using namespace std;
int main(){
	int n,k;
	cin>>n>>k;
	int a[k];
	bool like[10];
	for(int i=0;i<10;i++){
		like[i]=true;
	} 
	for(int i=0;i<k;i++){
		cin>>a[i];
		like[a[i]]=false;
	}
	bool flag=false;
	for(int i=1;i<=n*10;i*=10){
		if(flag==true){
			i/=10;
			flag=false;
		}
		if(like[n/i%10]){
			continue;
		}
		else{
			n+=i;
			if(i==1){
				flag=true;
			}
			else{
				i/=10;
			}
		}
	}
	cout<<n;
} 

Compiler output:
a.cc:35:3: error: stray '#' in program
   35 | } #include<bits/stdc++.h>
      |   ^
a.cc:69:3: error: stray '#' in program
   69 | } #include<bits/stdc++.h>
      |   ^
a.cc:103:3: error: stray '#' in program
  103 | } #include<bits/stdc++.h>
      |   ^
a.cc:35:4: error: 'include' does not name a type
   35 | } #include<bits/stdc++.h>
      |    ^~~~~~~
a.cc:37:5: error: redefinition of 'int main()'
   37 | int main(){
      |     ^~~~
a.cc:3:5: note: 'int main()' previously defined here
    3 | int main(){
      |     ^~~~
a.cc:69:4: error: 'include' does not name a type
   69 | } #include<bits/stdc++.h>
      |    ^~~~~~~
a.cc:71:5: error: redefinition of 'int main()'
   71 | int main(){
      |     ^~~~
a.cc:3:5: note: 'int main()' previously defined here
    3 | int main(){
      |     ^~~~
a.cc:103:4: error: 'include' does not name a type
  103 | } #include<bits/stdc++.h>
      |    ^~~~~~~
a.cc:105:5: error: redefinition of 'int main()'
  105 | int main(){
      |     ^~~~
a.cc:3:5: note: 'int main()' previously defined here
    3 | int main(){
      |     ^~~~
Language: C++

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

int main() {
  int N, K;
  cin >> N >> K;
  vector<int> d(10);
  for (int i = 0; i < K; ++i) {
    int num;
    cin >> num;
    ++d[num];
  }
  vector<int> use;
  for (int i = 0; i < 10; ++i) {
    if (d[i] == 0) {
      use.push_back(i);
    }
  }
  vector<int> ans(pow(8, 4));
  int cnt = 0
  for (int i = 0; i < use.size(); ++i) {
    for (int j = 0; j < use.size(); ++j) {
      for (int k = 0; k < use.size(); ++k) {
        for (int l = 0; l < use.size(); ++l) {
          int a = use[i] * 1000 + use[j] * 100 + use[k] * 10 + use[l];
          if (N <= a) {
            ++cnt;
            ans.push_back(a);
          }
        }
      }
    }
  }
  ans.resize(cnt);
  sort(ans.begin(), ans.end());
  cout << ans[0] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:3: error: expected ',' or ';' before 'for'
   21 |   for (int i = 0; i < use.size(); ++i) {
      |   ^~~
a.cc:21:19: error: 'i' was not declared in this scope
   21 |   for (int i = 0; i < use.size(); ++i) {
      |                   ^
Language: Java

import java.util.*;

public class A {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int k = in.nextInt();
		String no = "";
		for( int i = 0; i < k; i++ ) {
			no += in.nextInt();
		}
		String testString = "^[^"+no+"]+$";
		while(!Integer.toString(n).matches(testString)) n++;
		System.out.println(n);
	}
}

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

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
bool prime(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd(b,a%b);
  }
}
 
long long lcm(long long x, long long y){
  return (x/gcd(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};

int main(){
  int n,k;
  cin>>n>>k;
  int d[k];
  REP(i,k){
    cin>>d[i];
  }
  int dp[10000];//i以上でいろはちゃんのこだわりを満たす数。
  bool usable[10]={};//0~9が使えるかどうかを記録する配列。
  int index=0;
  REP(i,10){
    if(index<k && i==d[index]){
      index++;
      continue;
    }else{
      usable[i]=true;
    }
  }
  int ans;
  int temp;
  bool flag=true;
  for(int i=n;i<100000){
    temp=i;
    while(temp>0){
      if(usable[temp%10]){
        temp /= 10;
      }else{
        flag = false;
        break;
      }
    }
    
    if(flag){
      ans = i;
      break;
    }else{
      flag = true;
    }
  }
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:110:23: error: expected ';' before ')' token
  110 |   for(int i=n;i<100000){
      |                       ^
      |                       ;
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
bool prime(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd(b,a%b);
  }
}
 
long long lcm(long long x, long long y){
  return (x/gcd(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};

int main(){
  int n,k;
  cin>>n>>k;
  int d[k];
  REP(i,k){
    cin>>d[i];
  }
  int dp[10000];//i以上でいろはちゃんのこだわりを満たす数。
  bool usable[10]={};//0~9が使えるかどうかを記録する配列。
  index=0;
  REP(i,10){
    if(index<k && i==d[index]){
      index++;
      continue;
    }else{
      usable[i]=true;
    }
  }
  int ans;
  int temp;
  bool flag=true;
  for(int i=n;i<100000){
    temp=i;
    while(temp>0){
      if(usable[temp%10]){
        temp /= 10;
      }else{
        flag = false;
        break;
      }
    }
    
    if(flag){
      ans = i;
      break;
    }else{
      flag = true;
    }
  }
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:98:9: error: overloaded function with no contextual type information
   98 |   index=0;
      |         ^
a.cc:100:13: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<'
  100 |     if(index<k && i==d[index]){
      |        ~~~~~^~
a.cc:100:23: error: invalid types 'int [k][<unresolved overloaded function type>]' for array subscript
  100 |     if(index<k && i==d[index]){
      |                       ^
a.cc:101:12: error: no post-increment operator for type
  101 |       index++;
      |            ^~
a.cc:110:23: error: expected ';' before ')' token
  110 |   for(int i=n;i<100000){
      |                       ^
      |                       ;
Language: C++

#include<bits/stdc++.h>
#define mins(a,b) a=min(a,b)
#define maxs(a,b) a=max(a,b)
    template < typename T > std::string to_string( const T& n )
    {
        std::ostringstream stm ;
        stm << n ;
        return stm.str() ;
    }
}
using namespace std;

const long long INF=9000000000000000;
int main(){
  int n,x;
  cin>>n>>x;
  char num[x];
  for(int i=0;i<x;i++){
    cin>>num[i];
  }
  string s;
  int ok=0;
  for(int i=n;i<100010;i++){
    s=to_string(i);
    for(int j=0;j<s.size();j++){
      for(int k=0;k<x;k++){
        if(s[j]==num[k])
          ok++;
      }
    }
    if(ok==0){
      cout<<s<<endl;
      break;
    }
  }
}

Compiler output:
a.cc:10:1: error: expected declaration before '}' token
   10 | }
      | ^
Language: C++

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

#define int long long
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define repo(i,o,n) for(int i=o;i<(int)(n);i++)
#define repm(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define sperase(v,n) (v).erase(remove(all(v), n), (v).end());
#define vdelete(v) (v).erase(unique(all(v)), (v).end());
#define pb(n) push_back(n);

int n,k,d;
vector<int> v;

main() {
    cin >> n >> k;
    rep(i,k) cin >> d,v.pb(d);
    for(int i=n;;i++) {
        int f=1,tmp = i;
        while (tmp /= 10,tmp) {
            auto itr = lower_bound(all(v),tmp%10);
            if (*itr == tmp%10 || itr == v.end();) goto hoge;
        }
        cout << i << endl;
        return 0;
        hoge:;
    }
}



Compiler output:
a.cc:20:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   20 | main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:27:50: error: expected primary-expression before ')' token
   27 |             if (*itr == tmp%10 || itr == v.end();) goto hoge;
      |                                                  ^
Language: C++

#include <iostream>
#include <vector>
#include <climits>
using namespace std;
#define REP(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define INF INT_MAX
typedef vector<int> VI;

int n, k;
VI d(11);

bool check(int n) {
	bool flag = true;
	int keta = 0;
	for (int i = n; i > 0; i = i / 10)keta = keta + 1;
	FOR(i, 1, keta + 1) {
		int x = n / (int)(pow(10, i - 1)) % 10;
		REP(j, k) {
			if (x == d[j])flag = false;
		}
	}
	return flag;
}

int main() {
	cin >> n >> k;
	REP(i, k)cin >> d[i];

	int ans;
	FOR(i, n, INF) {
		if (check(i)) { ans = i; break; }
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'bool check(int)':
a.cc:18:35: error: 'pow' was not declared in this scope
   18 |                 int x = n / (int)(pow(10, i - 1)) % 10;
      |                                   ^~~
Language: C++


#include<iostream>
#include<cinttypes>
#include<vector>
#include<algorithm>
#include<string>



using ui = std::uint16_t;
using si = std::int32_t;

class number {
	si x[4];
public:
	number(si v)
		:x{si{v % 10 }  
		, si{(v % 100) / 10} 
		, si{(v % 1000)} / 100
		, si{v / 1000}} {}
	auto& operator[](si v)const {
		return x[v];
	}
	auto& operator[](si v) {
		return x[v];
	}
	template<si N>
	auto& get()const { return x[N]; }

	auto as_si()const->si{
		si t{x[3] * 1000 + x[2] * 100 + x[1] * 10 + x[0] };
		return t;
	}
	auto begin() { return std::begin(x); }
	auto end() {
		return std::end(x);
	}
};

int main() {


	si N{}, K{};
	std::cin >> N >> K;
	std::vector<si> vec;

	for (si i{ 0 }; i < K; i++) {
		si t;
		std::cin >> t;
		vec.emplace_back(t);
	}
	std::sort(std::begin(vec), std::end(vec) );

	number n{N};
	//for development
	/*
	for (const auto&e : n) {
		std::cout << e << " ";
	}std::cout << "\n";
	for (const auto &e : vec) {
		std::cout << e << " ";
	}std::cout << "\n";
	*/
	for (si i{ 0 }; i < 4;i++) {
		auto& ival = n[i];
//		auto& next = n[i + 1];
		for (const auto& ve : vec) {
			if (ve == ival) {//このはちゃんがこの数嫌い
				if (ival == 9) {
					n = number(n.as_si()+std::pow(10,i));
				}
				else {
					ival++;
				}
			}
		}
	}

	//for development
	//std::cout << "result :";

	std::cout << n.as_si() << "\n";

	//for development
	si t;
	std::cin >> t;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:70:67: error: 'pow' is not a member of 'std'
   70 |                                         n = number(n.as_si()+std::pow(10,i));
      |                                                                   ^~~
Language: C++


#include<iostream>
#include<cinttypes>
#include<vector>
#include<algorithm>
#include<string>



using ui = std::uint16_t;
template<class T>
auto begend(T&&t) {
	return 
		std::make_pair(
			std::begin(t)
			,std::end(t)
			); 
}

template<class Container, class ITP >
auto f(ui x,Container &vn,ITP& vitp)->bool {

	vn.clear();
	std::string str = std::to_string(x);
	//		auto sit = begend(sit);
	for (ui i{}; i < str.size(); i++) {
		const auto it = std::find(nsitp.first, nsitp.second, str[i]);
		if (it != nsitp.second) {
			const auto x = std::distance(nsitp.first, it);
			vn.push_back(x);
		}
	}
	//	for (auto &e : vn) { std::cout << e << " "; }std::cout << "\n";
	bool none{ true };
	for (const auto&e : vn) {
		const auto c = std::count(vitp.first, vitp.second, e) == 0;
		none &= c;
		//	std::cout << "e,c "<< e <<", "<< c <<" "<< (none ? "true" : "false") << "\n";
	}
	return none;
};
//using si = std::int16_t;

const std::string ns{ "0123456789" };
const auto nsitp = begend(ns);
int main() {
	

	ui N{}, K{};
	std::cin >> N >> K;
	
	std::vector<ui> vi;
	for (ui i{}; i < K; i++) {
		ui tmp{};
		std::cin >> tmp;
		vi.emplace_back( tmp );
	}

	auto vitp = begend(vi);
	std::sort(vitp.first, vitp.second);//for merge
	

	std::vector<ui> vn{};
	vn.reserve(4);
	
	ui init{ 1 };
	auto g = [&]()-> bool{
		return f(init, vn, vitp);
	};

	auto b = init >= N && g();
	while (!b) {
		init++;
		b = init >= N && g();
	}
	std::cout << init << "\n";
//	std::cin >> init;
	return 0;
}

Compiler output:
a.cc: In function 'bool f(ui, Container&, ITP&)':
a.cc:27:43: error: 'nsitp' was not declared in this scope
   27 |                 const auto it = std::find(nsitp.first, nsitp.second, str[i]);
      |                                           ^~~~~
Language: C++


#include<iostream>
#include<cinttypes>
#include<vector>
#include<algorithm>
#include<string>



using ui = std::uint16_t;
template<class T>
auto begend(T&&t) {
	return 
		std::make_pair(
			std::begin(t)
			,std::end(t)
			); 
}

template<class Container, class ITP >
auto f(ui x,Container &vn,ITP& vitp)->bool {

	vn.clear();
	std::string str = std::to_string(x);
	//		auto sit = begend(sit);
	for (ui i{}; i < str.size(); i++) {
		const auto it = std::find(nsitp.first, nsitp.second, str[i]);
		if (it != nsitp.second) {
			const auto x = std::distance(nsitp.first, it);
			vn.push_back(x);
		}
	}
	//	for (auto &e : vn) { std::cout << e << " "; }std::cout << "\n";
	bool none{ true };
	for (const auto&e : vn) {
		const auto c = std::count(vitp.first, vitp.second, e) == 0;
		none &= c;
		//	std::cout << "e,c "<< e <<", "<< c <<" "<< (none ? "true" : "false") << "\n";
	}
	return none;
};
//using si = std::int16_t;

const std::string ns{ "0123456789" };
const auto nsitp = begend(ns);
int main() {
	

	ui N{}, K{};
	std::cin >> N >> K;
	
	std::vector<ui> vi;
	for (ui i{}; i < K; i++) {
		ui tmp{};
		std::cin >> tmp;
		vi.emplace_back( tmp );
	}

	auto vitp = begend(vi);
	std::sort(vitp.first, vitp.second);//for merge
	

	std::vector<ui> vn{};
	vn.reserve(4);
	
	ui init{ 1 };
	auto g = [&]()-> bool{
		return f(init, vn, vitp);
	};

	auto b = init >= N && g();
	while (!b) {
		init++;
		b = init >= N && g();
	}
	std::cout << init << "\n";
	//std::cin >> init;
	return 0;
}

Compiler output:
a.cc: In function 'bool f(ui, Container&, ITP&)':
a.cc:27:43: error: 'nsitp' was not declared in this scope
   27 |                 const auto it = std::find(nsitp.first, nsitp.second, str[i]);
      |                                           ^~~~~
Language: C++


#include<iostream>
#include<cinttypes>
#include<vector>
#include<algorithm>
#include<string>



using ui = std::uint16_t;
template<class T>
auto begend(T&&t) {
	return 
		std::make_pair(
			std::begin(t)
			,std::end(t)
			); 
}

template<class Container, class ITP >
auto f(ui x,Container &vn,ITP& vitp)->bool {

	vn.clear();
	std::string str = std::to_string(x);
	//		auto sit = begend(sit);
	for (ui i{}; i < str.size(); i++) {
		const auto it = std::find(nsitp.first, nsitp.second, str[i]);
		if (it != nsitp.second) {
			const auto x = std::distance(nsitp.first, it);
			vn.push_back(x);
		}
	}
	//	for (auto &e : vn) { std::cout << e << " "; }std::cout << "\n";
	bool none{ true };
	for (const auto&e : vn) {
		const auto c = std::count(vitp.first, vitp.second, e) == 0;
		none &= c;
		//	std::cout << "e,c "<< e <<", "<< c <<" "<< (none ? "true" : "false") << "\n";
	}
	return none;
};
//using si = std::int16_t;

const std::string ns{ "0123456789" };
const auto nsitp = begend(ns);
int main() {
	

	ui N{}, K{};
	std::cin >> N >> K;
	
	std::vector<ui> vi;
	for (ui i{}; i < K; i++) {
		ui tmp{};
		std::cin >> tmp;
		vi.emplace_back( tmp );
	}

	auto vitp = begend(vi);
	std::sort(vitp.first, vitp.second);//for merge
	

	std::vector<ui> vn{};
	vn.reserve(4);
	
	ui init{ 1 };
	auto g = [&]()-> bool{
		return f(init, vn, vitp);
	};

	auto b = init >= N && g();
	while (!b) {
		init++;
		b = init >= N && g();
	}
	std::cout << init << "\n";
	std::cin >> init;
	return 0;
}

Compiler output:
a.cc: In function 'bool f(ui, Container&, ITP&)':
a.cc:27:43: error: 'nsitp' was not declared in this scope
   27 |                 const auto it = std::find(nsitp.first, nsitp.second, str[i]);
      |                                           ^~~~~
Language: C++


#include<iostream>
#include<cinttypes>
#include<vector>
#include<algorithm>
#include<string>



using ui = std::uint16_t;
template<class T>
auto begend(T&&t) {
	return 
		std::make_pair(
			std::begin(t)
			,std::end(t)
			); 
}

template<class Container>
auto f(ui x,Container &vn)->bool {

	vn.clear();
	std::string str = std::to_string(x);
	//		auto sit = begend(sit);
	for (ui i{}; i < str.size(); i++) {
		const auto it = std::find(nsitp.first, nsitp.second, str[i]);
		if (it != nsitp.second) {
			const auto x = std::distance(nsitp.first, it);
			vn.push_back(x);
		}
	}
	//	for (auto &e : vn) { std::cout << e << " "; }std::cout << "\n";
	bool none{ true };
	for (const auto&e : vn) {
		const auto c = std::count(vitp.first, vitp.second, e) == 0;
		none &= c;
		//	std::cout << "e,c "<< e <<", "<< c <<" "<< (none ? "true" : "false") << "\n";
	}
	return none;
};
//using si = std::int16_t;

const std::string ns{ "0123456789" };
const auto nsitp = begend(ns);
int main() {
	

	ui N{}, K{};
	std::cin >> N >> K;
	
	std::vector<ui> vi;
	for (ui i{}; i < K; i++) {
		ui tmp{};
		std::cin >> tmp;
		vi.emplace_back( tmp );
	}

	auto vitp = begend(vi);
	std::sort(vitp.first, vitp.second);//for merge
	

	std::vector<ui> vn{};
	vn.reserve(4);
	

	ui init{ 1 };
	auto b = init >= N && f(init,vn);
	while (!b) {
		init++;
		b = init >= N && f(init,vn);
	}
	std::cout << init << "\n";
	std::cin >> init;
	return 0;
}

Compiler output:
a.cc: In function 'bool f(ui, Container&)':
a.cc:27:43: error: 'nsitp' was not declared in this scope
   27 |                 const auto it = std::find(nsitp.first, nsitp.second, str[i]);
      |                                           ^~~~~
a.cc:36:43: error: 'vitp' was not declared in this scope
   36 |                 const auto c = std::count(vitp.first, vitp.second, e) == 0;
      |                                           ^~~~
Language: C++

using namespace std;

int N,K;
int num[11];
int main(){
    cin >> N >> K;
    for(int i=0; i<K; i++) {
        int x;
        cin >> x;
        num[x]++;
    }
    int ans = 0;
    int cnt = 0;
    while( N ) {
        int n = N % 10;
        for(int i=0; i<11; i++){
            if ( num[i] == 0 && i >= n) {
                for(int j=0; j<cnt; j++)  i *= 10;
                ans += i;
                break;
            }
        }
        cnt++;
        N /= 10;
    }
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> N >> K;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:26:5: error: 'cout' was not declared in this scope
   26 |     cout << ans << endl;
      |     ^~~~
a.cc:26:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:26:20: error: 'endl' was not declared in this scope
   26 |     cout << ans << endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

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

int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);

  int n, k;
  cin >> n >> k;
  vector<bool> a(10);
  while (k--) {
    int x;
    cin >> x;
    a[x] = true;
  }
  auto f = [&](int x) {
    while (x) {
      if (a[x % 10]) return true;
      x /= 10;
    }
    return false;
  };
  while (is_bad(n)) n++;
  cout << n;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:10: error: 'is_bad' was not declared in this scope; did you mean 'si_band'?
   24 |   while (is_bad(n)) n++;
      |          ^~~~~~
      |          si_band
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
long long n;
int k;
int a[10]={0};
for(int i=0;i<k;i++)
{
int x;xin>>x;a[x]=1;
}
long long ans=n;
while(1)
{
long long v=ans;
int y=1;
while(v>0)
{
if(a[v%10])
{y=0;break;}
v/=10;
}
if(y)
break;
ans+=n;
}
cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: 'xin' was not declared in this scope; did you mean 'sin'?
   10 | int x;xin>>x;a[x]=1;
      |       ^~~
      |       sin
Language: C++

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

using namespace std;

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

	string d = "";
	for (int i = 0; i < K; i++)
	{
		char c;
		cin >> c;
		d += c;
	}

	for (int i = N; i < N*10; i++)
	{
		string s = to_string(i);
		bool f = true;
		for (int j = 0; j < s.length(); ++j)
		{
			for (int k = 0; k < d.length(); k++)
			{
				if (s[j] == d[k])
				{
					f = false;
				}
			}
		}
		if (f)
		{
			cout << i << endl;
			return;
		}
	}
	return 0;
}

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

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <queue>
#include <sstream>
#include <stack>
#include <time.h>
#include <vector>
#include <complex>
using namespace std;
int d[12];
int main(){
  int n,k,a=-1,b=-1,c=-1,d=-1,e=-1,pos=0;
  cin>>n>>k;
  for (int i=0;i<k;i++)
    cin>>d[i];
  for (int i=n;i<i+1;i++){
    if (i > 9999)a = n / 10000;
    if (i > 999) b = n % 10000 / 1000;
    if (i > 99)c = n % 1000 / 100;
    if (i > 9) d = n % 100 / 10;
    e = n % 10;
    for (int j=0;j<k;j++)
      if ((a == d[j]) or (b == d[j]) or (c == d[j]) or (d == d[j]))
        pos++; 
    if (pos == 0){
      cout<<n;
  system ("pause");
  return 0;
  }
  pos=0;
  }
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:21:11: error: invalid types 'int[int]' for array subscript
   21 |     cin>>d[i];
      |           ^
a.cc:29:18: error: invalid types 'int[int]' for array subscript
   29 |       if ((a == d[j]) or (b == d[j]) or (c == d[j]) or (d == d[j]))
      |                  ^
a.cc:29:33: error: invalid types 'int[int]' for array subscript
   29 |       if ((a == d[j]) or (b == d[j]) or (c == d[j]) or (d == d[j]))
      |                                 ^
a.cc:29:48: error: invalid types 'int[int]' for array subscript
   29 |       if ((a == d[j]) or (b == d[j]) or (c == d[j]) or (d == d[j]))
      |                                                ^
a.cc:29:63: error: invalid types 'int[int]' for array subscript
   29 |       if ((a == d[j]) or (b == d[j]) or (c == d[j]) or (d == d[j]))
      |                                                               ^
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <queue>
#include <sstream>
#include <stack>
#include <time.h>
#include <vector>
#include <complex>
using namespace std;
int d[12];
int main(){
  int n,k,pos=0,ctc=0,hhy=0,jyh=0,syx=0,mym=0;
  cin>>n>>k;
  for (int i=0;i<k;i++)
  cin>>d[i];
  while (1){
  ctc = n / 10000;
  hhy = n % 10000 / 1000;
  jyh = n % 1000 / 100;
  syx = n % 100 / 10;
  mym = n % 10;
  for (int j=0;j<k;j++){
  if (n > 9999)
  if (ctc == d[j])
  pos++;
  if ((hhy == d[j]) or (jyh == d[j]) or (syx == d[j]) or (mym == d[j]))
  pos++; 
  }
  if (pos == 0){
  cout<<n;
  system ("pause");
  return 0;
}

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

    #include <iostream>

    int n,k,g = 0,s = 0,b = 0,q = 0,w = 0;
    cin >> n >> k;
    int d[k];
    for(int c = 0;c < k;c++){
        cin >> d[c];
        for(int a = n;a <= 10000;a++){
            g = a % 10;
            s = a % 100 / 10;
            b = a % 1000 / 100;
            q = a % 10000 / 1000;
            w = a / 10000;
            if(g != d[c]){
                if(s != d[c]){
                    if(b != d[c]){
                        if(q != d[c]){
                            if(w != d[c]){
                                cout << a << endl;
                                return 0;
                            }
                        }
                    }
                }
            }
        }
    }
    
    return 0;
}


Compiler output:
a.cc:4:5: error: 'cin' does not name a type
    4 |     cin >> n >> k;
      |     ^~~
a.cc:5:11: error: size of array 'd' is not an integral constant-expression
    5 |     int d[k];
      |           ^
a.cc:6:5: error: expected unqualified-id before 'for'
    6 |     for(int c = 0;c < k;c++){
      |     ^~~
a.cc:6:19: error: 'c' does not name a type
    6 |     for(int c = 0;c < k;c++){
      |                   ^
a.cc:6:25: error: 'c' does not name a type
    6 |     for(int c = 0;c < k;c++){
      |                         ^
a.cc:29:5: error: expected unqualified-id before 'return'
   29 |     return 0;
      |     ^~~~~~
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

#include<string.h> 
#include<map>
#include<math.h>
#include<string>
#include<algorithm>
#include<queue>
#include<vector>
#include<stdio.h>
using namespace std;
int main(){
int g[10000];
int n,k,w,d;
d=0;
w=0;
cin>>n>>k;
for(int j=1;j<=k;j++)
cin>>g[j];
for(int i=n;d<i.size;i++){
for(int l=1;l<=i.size();l++)
for(int f=1;f<=k;f++)
if(i[l]!=f) w++;
if(w=k) d++;}
cout<<n;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:1: error: 'cin' was not declared in this scope
   15 | cin>>n>>k;
      | ^~~
a.cc:7:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    6 | #include<queue>
  +++ |+#include <iostream>
    7 | #include<vector>
a.cc:18:17: error: request for member 'size' in 'i', which is of non-class type 'int'
   18 | for(int i=n;d<i.size;i++){
      |                 ^~~~
a.cc:19:18: error: request for member 'size' in 'i', which is of non-class type 'int'
   19 | for(int l=1;l<=i.size();l++)
      |                  ^~~~
a.cc:21:5: error: invalid types 'int[int]' for array subscript
   21 | if(i[l]!=f) w++;
      |     ^
a.cc:23:1: error: 'cout' was not declared in this scope
   23 | cout<<n;
      | ^~~~
a.cc:23:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<iostream>
#include<cstdio>
#include<cmath>
#include<string.h>
using namespace std;
char getnum(int n,int c)
{
char s[6];
sprintf(s,"%d",n);
return (s[c-1]);
}
void plusnum(int &n,int c)
{
char s[6];
sprintf(s,"%d",n);
n+=pow(10,strlen(s)-c);
}
template<size_t s>
bool pass(int n,int c,int (&d)[s])
{
int num;
num=getnum(n,c);
for(i=0;i<s;i++)
if(num==d[i])
return false;
return true;
}
int main()
{
int n,k,i;
int d[10];
char ms[6];
cin>>n>>k;
for(i=0;i<k;i++)cin>>d[i];
sprintf(ms,"%d",n);
i=1;
while(1)
{
if(!pass(n,i,k))plusnum(n,i);
else
if(i<strlen(ms))i++;
else goto STOP_WHILE0;
}
STOP_WHILE0:
cout<<n;
return 0;
}


Compiler output:
a.cc: In function 'bool pass(int, int, int (&)[s])':
a.cc:23:5: error: 'i' was not declared in this scope
   23 | for(i=0;i<s;i++)
      |     ^
a.cc: In function 'int main()':
a.cc:39:9: error: no matching function for call to 'pass(int&, int&, int&)'
   39 | if(!pass(n,i,k))plusnum(n,i);
      |     ~~~~^~~~~~~
a.cc:19:6: note: candidate: 'template<long unsigned int s> bool pass(int, int, int (&)[s])'
   19 | bool pass(int n,int c,int (&d)[s])
      |      ^~~~
a.cc:19:6: note:   template argument deduction/substitution failed:
a.cc:39:9: note:   mismatched types 'int [s]' and 'int'
   39 | if(!pass(n,i,k))plusnum(n,i);
      |     ~~~~^~~~~~~
Language: C++

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

int n, k, a[100500], res;
map<int, int> m;
vector<int> v;

int main(){
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);

cin >> n >> k;
for(int i=1;i<=k;i++){
	cin >> a[i];
	m[a[i]] = 1;
}

for(int i=9;i>=0;i--){
if(!m[i])v.push_back(i);
}

while(res <= n){
	res += v[0];
	res *= 10;
}

cout << res;

return 0;
}

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

#include<iostream>
#include<string>
#include<vector>

using namespace std;

int main() {
  string n;
  int k;
  cin >> n >> k;
  vector<bool> b(10);
  for(int i = 0; i < k; i++) {
    int a;
    cin >> a;
    b[a] = true;
  }
  vector<int> c;
  for(int i = 0; i < 10; i++) if(!b[i]) c.push_back(i);
  auto it = upper_bound(c.begin(), c.end(), n[i] - '0');
  if(it == c.end()) {
    if(c[0] == '0') {
      cout << c[1];
      for(int i = 0; i < n.size(); i++) cout << c[0];
      cout << endl;
      return 0;
    } else {
      for(int i = 0; i < n.size() + 1; i++) cout << c[0];
      cout << endl;
      return 0;
    }
  } else {
    cout << *it;
    for(int i = 0; i < n.size() - 1; i++) cout << c[0];
    cout << endl;
    return 0;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:47: error: 'i' was not declared in this scope; did you mean 'it'?
   19 |   auto it = upper_bound(c.begin(), c.end(), n[i] - '0');
      |                                               ^
      |                                               it
a.cc:19:13: error: 'upper_bound' was not declared in this scope
   19 |   auto it = upper_bound(c.begin(), c.end(), n[i] - '0');
      |             ^~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define REP(i,n) for(int i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, __VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

#define MOD 1000000007
#define INF 1000000000
#define MAX_N 100010

int N, K
bool okDigit[10] = {};

int main()
{
    cin >> N >> K;
    REP(i, 10) { okDigit[i] = true; }
    REP(i, K) {
        int k;
        cin >> k;
        okDigit[k] = false;
    }
    for(int i = K; i <= 100000; ++i) {
        // i に嫌いな数字が入っていないか
        ll num = i;
        bool isOk = true;
        while(num > 0) {
            if(!okDigit[num % 10]) {
                isOk = false;
                break;
            }
            num /= 10;
        }
        if(isOk) {
            printf("%d\n", i);
            return 0;
        }
    }

    return 0;
}


Compiler output:
a.cc:21:1: error: expected initializer before 'bool'
   21 | bool okDigit[10] = {};
      | ^~~~
a.cc: In function 'int main()':
a.cc:25:17: error: 'K' was not declared in this scope
   25 |     cin >> N >> K;
      |                 ^
a.cc:26:18: error: 'okDigit' was not declared in this scope
   26 |     REP(i, 10) { okDigit[i] = true; }
      |                  ^~~~~~~
a.cc:30:9: error: 'okDigit' was not declared in this scope
   30 |         okDigit[k] = false;
      |         ^~~~~~~
a.cc:37:17: error: 'okDigit' was not declared in this scope
   37 |             if(!okDigit[num % 10]) {
      |                 ^~~~~~~
Language: C


#include<stdio.h>
#include<math.h>
#include<string.h>
#include<iostream>
using namespace std;
int a[20];
int main()
{
    int n,k;
    while(~scanf("%d%d",&n,&k))
    {
        memset(a,0,sizeof(a));
        for(int i=0; i<k; i++)
        {
            int q;
            scanf("%d",&q);
            a[q]=1;
        }
        int ans=9;
        int f1=0,sum=0;
        for(int i=0; i<=9; i++)
        {
            for(int j=0; j<=9; j++)
            {
                for(int k=0; k<=9; k++)
                {
                    for(int r=0; r<=9; r++)
                    {
                        sum=i*1000+j*100+k*10+r;
                         int fa=0;
                          if(sum>=n)
                          {
                             ans=sum;
                              int r=0;
                              int s[20];
                              while(ans)
                              {
                                  s[r++]=ans%10;
                                  ans/=10;
                              }
                              for(int i=0;i<r;i++)
                              {
                                  if(a[s[i]]==1)
                                  {
                                      fa=1;
                                      break;
                                  }
                              }
                             if(fa==0)
                             {
                              f1=1;
                              break;
                             }
                          }
                    }
            if(f1==1) break;
                }
        if(f1==1) break;
            }
    if(f1==1)break;
        }
printf("%d\n",sum);
    }
}


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

n, _ = map(int, raw_input().split())
d = set(map(int, raw_input().split()))
while len(set(map(int, str(n))) & d) > 0:
    n += 1
print n

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n, _ = map(int, raw_input().split())
      | ^