# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
41350 | gabrielsimoes | Sequence (BOI14_sequence) | C++14 | 1056 ms | 1092 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
bool test(int a, int b) {
while (a > 0) {
if (b == (a % 10))
return true;
else
a /= 10;
}
return false;
}
int n;
vector<int> v;
int main() {
scanf("%d", &n);
for (int i = 0, a; i < n; i++) {
scanf("%d", &a);
v.push_back(a);
}
for (int ans = 1; ans < 100000; ans++) {
bool ok = true;
for (int i = 0; i < n; i++) {
if (!test(ans + i, v[i])) ok = false;
}
if (ok) {
printf("%d\n", ans);
return 0;
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |