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;
bool check_is_number_has(int n,int a)
{
while(n>0)
{
if(n%10==a)return true;
n/=10;
}
return false;
}
bool check(int a,int k,int numberarray[])
{
for(int i=a;i<=k+a-1;i++)
if(!check_is_number_has(i,numberarray[i-a]))
return false;
return true;
}
void print(int n,int k)
{
cout<<n;
exit(0);
}
int main (){
int k;
cin>>k;
int a[k];
for(int i=0;i<k;i++)
cin>>a[i];
for(int i=a[0];i<=1000;i++)
{
bool flag=check(i,k,a);
if(flag)print(i,k);
}
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... |