Submission #940086

#TimeUsernameProblemLanguageResultExecution timeMemory
940086vjudge1Sequence (BOI14_sequence)C++17
9 / 100
6 ms464 KiB
#include <bits/stdc++.h> using namespace std; #ifdef DEBUG #include "debug.h" #else #define debug(...) 0 #endif #define pb push_back #define i2 array<int, 2> #define ll long long const int N = 1e3 + 4; int k, b[N]; bool have(int x, int d) { while (x) { if (x % 10 == d) { return 1; } x /= 10; } return 0; } void solve() { cin >> k; for (int i = 0; i < k; i++) { cin >> b[i]; } for (int i = 1; i < N; i++) { bool ok = true; for (int j = 0; j < k; j++) ok &= have(i + j, b[j]); if (ok) { cout << i; return; } } } int main() { ios::sync_with_stdio(0); cin.tie(0); int t = 1; // cin >> t; while (t--) { solve(); } 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...