# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
105615 | luciocf | 수열 (BOI14_sequence) | C++14 | 9 ms | 428 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3+10;
int n;
int a[maxn];
int brute(void)
{
for (int j = 1; j <= 1000; j++)
{
int v = j;
bool deu = 1;
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) deu = 0;
v++;
}
if (deu) return j;
}
}
int main(void)
{
scanf("%d", &n);
for (int i = 0; i < n; i++)
scanf("%d", &a[i]);
if (n <= 1000)
{
printf("%d\n", brute());
return 0;
}
int x = 1;
for (int i = 0; i <= 20; i++)
{
if (x >= n)
{
printf("%d", a[0]);
for (int j = 1; j <= i; j++) printf("0");
printf("\n");
return 0;
}
x *= 10;
}
}
컴파일 시 표준 에러 (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... |