# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
41359 | gabrielsimoes | 수열 (BOI14_sequence) | C++14 | 673 ms | 1256 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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);
}
if (n <= 10000) {
for (int ans = 1; ans <= 10000; 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;
}
}
}
int x = v[0];
if (x > 0 && x < 9) {
printf("%d", x);
int cur = 1;
while (n >= cur + 1) {
printf("0");
cur *= 10;
}
printf("\n");
}
if (x == 9) {
int cur = 1;
while (n >= cur + 1) {
printf("8");
cur = cur * 10 + 1;
}
printf("9\n");
}
if (x == 0) {
printf("10");
if (n != 1) {
int cur = 1;
while (n > cur) {
printf("0");
cur = cur * 10 + 1;
}
}
printf("\n");
}
}
컴파일 시 표준 에러 (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... |