Submission #940094

#TimeUsernameProblemLanguageResultExecution timeMemory
940094vjudge1Sequence (BOI14_sequence)C++17
9 / 100
716 ms604 KiB
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; int n, a[N]; int main() { ios:: sync_with_stdio(0), cin.tie(0); cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; for (int w = 1; w <= 100000; w++) { int cnt = w; bool mark = true; for (int i = 0; i < n; i++) { if (i) cnt++; bool flag = false; string s = to_string(cnt); for (auto e : s) if (e == char(a[i] + '0')) flag = true; if (!flag) { mark = false; break; } } if (mark) { cout << w << '\n'; 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...