Submission #940094

# Submission time Handle Problem Language Result Execution time Memory
940094 2024-03-07T05:33:00 Z vjudge1 Sequence (BOI14_sequence) C++17
9 / 100
716 ms 604 KB
#include <bits/stdc++.h>
using namespace std;

const int N = 1e5 + 10;

int n, a[N];

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 <= 100000; w++) {
        int cnt = w;
        bool mark = true;
        for (int i = 0; i < n; i++) {
            if (i) cnt++;
            bool flag = false;
            string s = to_string(cnt);
            for (auto e : s)
                if (e == char(a[i] + '0')) flag = true;
            if (!flag) {
                mark = false;
                break;
            }
        }
        if (mark) {
            cout << w << '\n';
            return 0;
        }
    }
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 0 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 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Incorrect 38 ms 344 KB Output isn't correct
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 60 ms 348 KB Output is correct
3 Incorrect 716 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 600 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Incorrect 5 ms 604 KB Output isn't correct
6 Halted 0 ms 0 KB -