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 ;
//#define int long long
int MOD = 1e9+7 ;
int b[1234] ;
int32_t main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int k ; cin >> k ;
for ( int i = 0 ; i < k ; i++ )
{
cin >> b[i] ;
}
for ( int i = 1 ; i <= 1000 ; i++ )
{
for ( int j = 0 ; j < k ; j++ )
{
int x = i+j , bo = 0 ;
while(x)
{
int g = x%10 ;
//cout << g << " " << b[i] << endl ;
if ( g == b[j] ) { bo = 1 ; break ; }
x/=10 ;
}
if (bo==0) break ;
if ( j == (k-1) )
{
cout << i << endl ;
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... |