Submission #398790

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

}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 208 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Incorrect 1 ms 204 KB Output isn't correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Incorrect 1 ms 204 KB Output isn't correct
7 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 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 316 KB Output is correct
5 Runtime error 1 ms 460 KB Execution killed with signal 11
6 Halted 0 ms 0 KB -