이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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=0 ; 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... |