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 ;
//it ain't much but it's honest work
int a[1009] ;
int n ;
bool check(int x){
for(int i=0 ; i<n ; i++){
int k=x , r=0 ;
while(k>=0){
if(k%10==a[i]){
r++ ;
break ;
}
k/=10 ;
}
if(r==0) return false ;
x++ ;
}
return true ;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL), cout.tie(NULL);
cin >> n ;
for(int i=0 ; i<n ; i++) cin >> a[i] ;
for(int i=1 ; i<=1000 ; i++){
if(check(i)){
cout << i ;
return 0 ;
}
}
}
# | 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... |