This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int n,arr[1001];
int ok(int a , int b){
while(a){
if(a%10 == b){
return true;
}
a /= 10;
}
return false;
}
int main(){
cin >> n;
for(int i = 0 ; i < n ; i += 1){
cin >> arr[i];
}
int val = max(arr[0],1);
while(true){
int num = val , k = 1;
for(int i = 0 ; i < n ; i += 1){
if(!ok(num,arr[i])){
k = 0;
break;
}
num += 1;
}
if(k){
cout << val << endl;
return 0;
}
val *= 10;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |