Submission #236416

#TimeUsernameProblemLanguageResultExecution timeMemory
236416kaplanbarSequence (BOI14_sequence)C++14
9 / 100
7 ms640 KiB
// In the name of God #include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int k; cin >> k; vector<int> d(k); for(int i = 0; i < k; i++) cin >> d[i]; function<bool(int,int)> check = [&](int N, int di) { while(N) { if(N % 10 == di) { return true; } N /= 10; } return false; }; for(int i = 0; i <= 1000; i++) { bool f = true; for(int j = 0; j < k; j++) { if(!check(i + j, d[j])) { f = false; break; } } if(f) { cout << i; exit(0); } } 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...