Submission #398978

#TimeUsernameProblemLanguageResultExecution timeMemory
398978YaserFaisalSequence (BOI14_sequence)C++14
9 / 100
2 ms588 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...