Submission #398791

# Submission time Handle Problem Language Result Execution time Memory
398791 2021-05-04T20:15:34 Z katwamiaw Sequence (BOI14_sequence) C++14
0 / 100
1000 ms 204 KB
#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=1 ; i<=1000 ; i++){
        if(check(i)){
            cout << i ;
            return 0 ;
        }
    }

}
# Verdict Execution time Memory Grader output
1 Execution timed out 1075 ms 204 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1087 ms 204 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1087 ms 204 KB Time limit exceeded
2 Halted 0 ms 0 KB -