Submission #136065

#TimeUsernameProblemLanguageResultExecution timeMemory
136065forelaxSequence (BOI14_sequence)C++14
9 / 100
14 ms632 KiB
#include<bits/stdc++.h> using namespace std; vector<bool> digs(int ind){ vector<bool> rez(10); do{ rez[ind%10]=true; }while(ind/=10); return rez; } int n; vector<int> v; int main(){ cin>>n; v.resize(n); for(int i = 0 ; i < n ; i ++) cin>>v[i]; for(int i = 1 ; i <= 1000 ; i ++){ bool good=true; for(int k = 0 ; k < n ; k ++){ if(!digs(i+k)[v[k]]){ good=false; break; } } if(good){ 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...