#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 |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
296 KB |
Output is correct |
2 |
Incorrect |
1 ms |
312 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |