# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
105599 | luciocf | Sequence (BOI14_sequence) | C++14 | 4 ms | 384 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;
const int maxn = 1e3+10;
int n;
int a[maxn];
bool brute(int v)
{
for (int i = 0; i < n; i++)
{
int aux = v;
bool ok = 0;
while (aux > 0)
{
if (aux%10 == a[i]) ok = 1;
aux /= 10;
}
if (!ok) return 0;
v++;
}
return 1;
}
int main(void)
{
scanf("%d", &n);
for (int i = 0; i < n; i++)
scanf("%d", &a[i]);
for (int i = 1; i <= 1000; i++)
{
if (brute(i))
{
printf("%d\n", i);
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... |