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;
vector<bool> digs(int ind){
vector<bool> rez(10);
do{
rez[ind%10]=true;
}while(ind/=10);
return rez;
}
int n;
vector<int> v;
int main(){
cin>>n;
v.resize(n);
for(int i = 0 ; i < n ; i ++)
cin>>v[i];
for(int i = 1 ; i <= 1000 ; i ++){
bool good=true;
for(int k = 0 ; k < n ; k ++){
if(!digs(i+k)[v[k]]){
good=false;
break;
}
}
if(good){
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... |