답안 #940136

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
940136 2024-03-07T05:52:31 Z vjudge1 수열 (BOI14_sequence) C++17
9 / 100
1000 ms 604 KB
#include <bits/stdc++.h>
using namespace std;

#ifdef DEBUG
#include "debug.h"
#else
#define debug(...) 0
#endif

#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2")

#define pb push_back
#define i2 array<int, 2>
#define ll long long

const int N = 1e5 + 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 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 3 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 436 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 7 ms 348 KB Output is correct
15 Correct 6 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 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 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 26 ms 468 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 4 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Incorrect 456 ms 348 KB Output isn't correct
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Execution timed out 1054 ms 348 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 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 348 KB Output is correct
5 Execution timed out 1091 ms 604 KB Time limit exceeded
6 Halted 0 ms 0 KB -