Submission #398791

#TimeUsernameProblemLanguageResultExecution timeMemory
398791katwamiawSequence (BOI14_sequence)C++14
0 / 100
1087 ms204 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...