답안 #940224

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
940224 2024-03-07T06:45:09 Z vjudge1 수열 (BOI14_sequence) C++17
9 / 100
107 ms 2908 KB
#include <bits/stdc++.h>
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;

const int N = 2e5 + 10;

int n, a[N];
bool mark[N][11];

int main() {
    ios:: sync_with_stdio(0), cin.tie(0);
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int w = 1; w <= 200000; w++) {
        string s = to_string(w);
        for (auto e : s)
            mark[w][e - '0'] = true;
    }
    for (int w = 1; w <= 200000; w++) {
        int cnt = w;
        bool flag = true;
        for (int i = 0; i < n; i++) {
            if (i) cnt++;
            if (!mark[cnt][a[i]]) {
                flag = false;
                break;
            }
        }
        if (flag) {
            cout << w << '\n';
            return 0;
        }
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 2652 KB Output is correct
2 Correct 4 ms 2652 KB Output is correct
3 Correct 3 ms 2648 KB Output is correct
4 Correct 3 ms 2652 KB Output is correct
5 Correct 4 ms 2696 KB Output is correct
6 Correct 4 ms 2652 KB Output is correct
7 Correct 4 ms 2684 KB Output is correct
8 Correct 3 ms 2652 KB Output is correct
9 Correct 3 ms 2692 KB Output is correct
10 Correct 3 ms 2652 KB Output is correct
11 Correct 3 ms 2652 KB Output is correct
12 Correct 3 ms 2908 KB Output is correct
13 Correct 3 ms 2696 KB Output is correct
14 Correct 3 ms 2652 KB Output is correct
15 Correct 3 ms 2696 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 2652 KB Output is correct
2 Correct 4 ms 2652 KB Output is correct
3 Correct 4 ms 2652 KB Output is correct
4 Correct 4 ms 2904 KB Output is correct
5 Correct 4 ms 2652 KB Output is correct
6 Correct 3 ms 2556 KB Output is correct
7 Correct 4 ms 2652 KB Output is correct
8 Correct 3 ms 2648 KB Output is correct
9 Correct 3 ms 2652 KB Output is correct
10 Correct 3 ms 2648 KB Output is correct
11 Incorrect 11 ms 2652 KB Output isn't correct
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 2652 KB Output is correct
2 Correct 8 ms 2652 KB Output is correct
3 Incorrect 107 ms 2652 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 2648 KB Output is correct
2 Correct 4 ms 2516 KB Output is correct
3 Correct 3 ms 2652 KB Output is correct
4 Correct 4 ms 2888 KB Output is correct
5 Incorrect 6 ms 2652 KB Output isn't correct
6 Halted 0 ms 0 KB -