답안 #940098

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
940098 2024-03-07T05:35:49 Z vjudge1 수열 (BOI14_sequence) C++17
9 / 100
39 ms 464 KB
#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 = 1e4 + 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;
}

# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 3 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 6 ms 348 KB Output is correct
15 Correct 6 ms 464 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 26 ms 460 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 3 ms 348 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Incorrect 39 ms 344 KB Output isn't correct
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 1 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 2 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Incorrect 1 ms 348 KB Output isn't correct
6 Halted 0 ms 0 KB -