Submission #398982

# Submission time Handle Problem Language Result Execution time Memory
398982 2021-05-05T00:19:49 Z YaserFaisal Sequence (BOI14_sequence) C++14
0 / 100
1 ms 460 KB
#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 = 5*k ; i <= 10000000 ; 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
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Runtime error 1 ms 460 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -