Submission #1069053

# Submission time Handle Problem Language Result Execution time Memory
1069053 2024-08-21T15:17:14 Z ortsac Brunhilda’s Birthday (BOI13_brunhilda) C++17
20 / 100
1000 ms 928 KB
#include <bits/stdc++.h>
 
using namespace std;

int inf = 0x3f3f3f3f;
const int MAXN = 1e4;
int dp[MAXN + 10];

int32_t main() {
    int n, q;
    cin >> n >> q;
    vector<int> v(n);
    for (int i = 0; i < n; i++) cin >> v[i];
    for (int i = 1; i <= MAXN; i++) {
        dp[i] = inf;
        int mx = 0;
        for (auto u : v) mx = max(mx, i % u);
        dp[i] = min(dp[i], dp[i - mx] + 1);
    }
    while (q--) {
        int x;
        cin >> x;
        if (dp[x] == inf) cout << "oo\n";
        else cout << dp[x] << "\n";
    }
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 14 ms 488 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 2 ms 348 KB Output is correct
11 Correct 2 ms 348 KB Output is correct
12 Correct 3 ms 436 KB Output is correct
13 Correct 22 ms 468 KB Output is correct
14 Correct 34 ms 348 KB Output is correct
15 Correct 2 ms 344 KB Output is correct
16 Correct 2 ms 348 KB Output is correct
17 Correct 13 ms 500 KB Output is correct
18 Correct 15 ms 496 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 239 ms 484 KB Execution killed with signal 11
2 Execution timed out 1078 ms 800 KB Time limit exceeded
3 Execution timed out 1068 ms 720 KB Time limit exceeded
4 Runtime error 63 ms 596 KB Execution killed with signal 11
5 Execution timed out 1022 ms 852 KB Time limit exceeded
6 Runtime error 24 ms 476 KB Execution killed with signal 11
7 Runtime error 238 ms 480 KB Execution killed with signal 11
8 Runtime error 20 ms 592 KB Execution killed with signal 11
9 Execution timed out 1050 ms 712 KB Time limit exceeded
10 Execution timed out 1065 ms 712 KB Time limit exceeded
11 Runtime error 790 ms 860 KB Execution killed with signal 11
12 Runtime error 43 ms 600 KB Execution killed with signal 11
13 Runtime error 62 ms 456 KB Execution killed with signal 11
14 Runtime error 63 ms 448 KB Execution killed with signal 11
15 Runtime error 824 ms 860 KB Execution killed with signal 11
16 Execution timed out 1091 ms 796 KB Time limit exceeded
17 Runtime error 60 ms 592 KB Execution killed with signal 11
18 Execution timed out 1098 ms 820 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Runtime error 991 ms 876 KB Execution killed with signal 11
2 Execution timed out 1016 ms 856 KB Time limit exceeded
3 Runtime error 989 ms 904 KB Execution killed with signal 11
4 Runtime error 68 ms 592 KB Execution killed with signal 11
5 Execution timed out 1098 ms 832 KB Time limit exceeded
6 Runtime error 162 ms 464 KB Execution killed with signal 11
7 Execution timed out 1041 ms 600 KB Time limit exceeded
8 Runtime error 985 ms 848 KB Execution killed with signal 11
9 Runtime error 994 ms 852 KB Execution killed with signal 11
10 Runtime error 117 ms 596 KB Execution killed with signal 11
11 Runtime error 88 ms 592 KB Execution killed with signal 11
12 Runtime error 117 ms 592 KB Execution killed with signal 11
13 Runtime error 591 ms 592 KB Execution killed with signal 11
14 Runtime error 1 ms 600 KB Execution killed with signal 11
15 Runtime error 109 ms 452 KB Execution killed with signal 11
16 Runtime error 140 ms 592 KB Execution killed with signal 11
17 Runtime error 885 ms 848 KB Execution killed with signal 11
18 Execution timed out 1031 ms 928 KB Time limit exceeded
19 Runtime error 101 ms 468 KB Execution killed with signal 11
20 Runtime error 985 ms 852 KB Execution killed with signal 11
21 Runtime error 3 ms 600 KB Execution killed with signal 11
22 Execution timed out 1092 ms 812 KB Time limit exceeded
23 Runtime error 591 ms 796 KB Execution killed with signal 11
24 Runtime error 23 ms 604 KB Execution killed with signal 11
25 Runtime error 58 ms 468 KB Execution killed with signal 11
26 Runtime error 67 ms 468 KB Execution killed with signal 11
27 Execution timed out 1081 ms 604 KB Time limit exceeded
28 Runtime error 21 ms 464 KB Execution killed with signal 11
29 Execution timed out 1034 ms 812 KB Time limit exceeded
30 Execution timed out 1032 ms 720 KB Time limit exceeded
31 Runtime error 87 ms 456 KB Execution killed with signal 11
32 Runtime error 58 ms 596 KB Execution killed with signal 11
33 Runtime error 25 ms 596 KB Execution killed with signal 11
34 Execution timed out 1020 ms 856 KB Time limit exceeded
35 Runtime error 40 ms 464 KB Execution killed with signal 11
36 Execution timed out 1082 ms 852 KB Time limit exceeded
37 Execution timed out 1067 ms 828 KB Time limit exceeded
38 Runtime error 163 ms 464 KB Execution killed with signal 11
39 Runtime error 46 ms 456 KB Execution killed with signal 11
40 Runtime error 186 ms 592 KB Execution killed with signal 11
41 Execution timed out 1044 ms 828 KB Time limit exceeded
42 Runtime error 61 ms 596 KB Execution killed with signal 11