Submission #398854

#TimeUsernameProblemLanguageResultExecution timeMemory
398854faresbasbsSequence (BOI14_sequence)C++14
0 / 100
1 ms312 KiB
#include <bits/stdc++.h> using namespace std; int n,arr[1001]; int ok(int a , int b){ while(a){ if(a%10 == b){ return true; } a /= 10; } return false; } int main(){ cin >> n; for(int i = 0 ; i < n ; i += 1){ cin >> arr[i]; } int val = max(arr[0],1); while(true){ int num = val , k = 1; for(int i = 0 ; i < n ; i += 1){ if(!ok(num,arr[i])){ k = 0; break; } num += 1; } if(k){ cout << val << endl; return 0; } val *= 10; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...