# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
535240 | 2022-03-09T18:05:08 Z | MKutayBozkurt | Brunhilda’s Birthday (BOI13_brunhilda) | C++14 | 108 ms | 262148 KB |
#include <bits/stdc++.h> using namespace std; #define int long long int mx = (int) 2e7 + 5; int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, q; cin >> n >> q; vector<int> a(n), d(mx), dp(mx, 1e9); for (int &x : a) { cin >> x; for (int i = x - 1; i < mx; i += x) { d[i] = max(d[i], x - 1); } } for (int i = mx - 2; i; i--) d[i] = max(d[i], d[i + 1] - 1); dp[0] = 0; for (int i = 1; i < mx; i++) { dp[i] = dp[i - d[i]] + 1; } while (q--) { int x; cin >> x; cout << (dp[x] >= 1e9 ? "oo" : to_string(dp[x])) << '\n'; } }
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 100 ms | 262148 KB | Execution killed with signal 9 |
2 | Runtime error | 107 ms | 262148 KB | Execution killed with signal 9 |
3 | Runtime error | 105 ms | 262144 KB | Execution killed with signal 9 |
4 | Runtime error | 101 ms | 262148 KB | Execution killed with signal 9 |
5 | Runtime error | 101 ms | 262148 KB | Execution killed with signal 9 |
6 | Runtime error | 100 ms | 262148 KB | Execution killed with signal 9 |
7 | Runtime error | 104 ms | 262148 KB | Execution killed with signal 9 |
8 | Runtime error | 100 ms | 262148 KB | Execution killed with signal 9 |
9 | Runtime error | 97 ms | 262148 KB | Execution killed with signal 9 |
10 | Runtime error | 98 ms | 262148 KB | Execution killed with signal 9 |
11 | Runtime error | 101 ms | 262148 KB | Execution killed with signal 9 |
12 | Runtime error | 100 ms | 262148 KB | Execution killed with signal 9 |
13 | Runtime error | 102 ms | 262148 KB | Execution killed with signal 9 |
14 | Runtime error | 99 ms | 262148 KB | Execution killed with signal 9 |
15 | Runtime error | 99 ms | 262148 KB | Execution killed with signal 9 |
16 | Runtime error | 100 ms | 262148 KB | Execution killed with signal 9 |
17 | Runtime error | 102 ms | 262148 KB | Execution killed with signal 9 |
18 | Runtime error | 101 ms | 262148 KB | Execution killed with signal 9 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 99 ms | 262148 KB | Execution killed with signal 9 |
2 | Runtime error | 100 ms | 262148 KB | Execution killed with signal 9 |
3 | Runtime error | 99 ms | 262148 KB | Execution killed with signal 9 |
4 | Runtime error | 101 ms | 262148 KB | Execution killed with signal 9 |
5 | Runtime error | 97 ms | 262148 KB | Execution killed with signal 9 |
6 | Runtime error | 97 ms | 262148 KB | Execution killed with signal 9 |
7 | Runtime error | 97 ms | 262148 KB | Execution killed with signal 9 |
8 | Runtime error | 105 ms | 262148 KB | Execution killed with signal 9 |
9 | Runtime error | 101 ms | 262148 KB | Execution killed with signal 9 |
10 | Runtime error | 100 ms | 262148 KB | Execution killed with signal 9 |
11 | Runtime error | 98 ms | 262148 KB | Execution killed with signal 9 |
12 | Runtime error | 101 ms | 262148 KB | Execution killed with signal 9 |
13 | Runtime error | 102 ms | 262148 KB | Execution killed with signal 9 |
14 | Runtime error | 106 ms | 262148 KB | Execution killed with signal 9 |
15 | Runtime error | 94 ms | 262148 KB | Execution killed with signal 9 |
16 | Runtime error | 102 ms | 262148 KB | Execution killed with signal 9 |
17 | Runtime error | 101 ms | 262148 KB | Execution killed with signal 9 |
18 | Runtime error | 100 ms | 262148 KB | Execution killed with signal 9 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 98 ms | 262148 KB | Execution killed with signal 9 |
2 | Runtime error | 100 ms | 262148 KB | Execution killed with signal 9 |
3 | Runtime error | 101 ms | 262148 KB | Execution killed with signal 9 |
4 | Runtime error | 101 ms | 262148 KB | Execution killed with signal 9 |
5 | Runtime error | 102 ms | 262148 KB | Execution killed with signal 9 |
6 | Runtime error | 107 ms | 262148 KB | Execution killed with signal 9 |
7 | Runtime error | 104 ms | 262148 KB | Execution killed with signal 9 |
8 | Runtime error | 97 ms | 262148 KB | Execution killed with signal 9 |
9 | Runtime error | 99 ms | 262148 KB | Execution killed with signal 9 |
10 | Runtime error | 100 ms | 262148 KB | Execution killed with signal 9 |
11 | Runtime error | 105 ms | 262148 KB | Execution killed with signal 9 |
12 | Runtime error | 96 ms | 262148 KB | Execution killed with signal 9 |
13 | Runtime error | 99 ms | 262148 KB | Execution killed with signal 9 |
14 | Runtime error | 103 ms | 262148 KB | Execution killed with signal 9 |
15 | Runtime error | 92 ms | 262148 KB | Execution killed with signal 9 |
16 | Runtime error | 100 ms | 262148 KB | Execution killed with signal 9 |
17 | Runtime error | 98 ms | 262148 KB | Execution killed with signal 9 |
18 | Runtime error | 106 ms | 262148 KB | Execution killed with signal 9 |
19 | Runtime error | 98 ms | 262148 KB | Execution killed with signal 9 |
20 | Runtime error | 98 ms | 262148 KB | Execution killed with signal 9 |
21 | Runtime error | 96 ms | 262148 KB | Execution killed with signal 9 |
22 | Runtime error | 101 ms | 262148 KB | Execution killed with signal 9 |
23 | Runtime error | 98 ms | 262148 KB | Execution killed with signal 9 |
24 | Runtime error | 100 ms | 262148 KB | Execution killed with signal 9 |
25 | Runtime error | 98 ms | 262148 KB | Execution killed with signal 9 |
26 | Runtime error | 101 ms | 262148 KB | Execution killed with signal 9 |
27 | Runtime error | 100 ms | 262148 KB | Execution killed with signal 9 |
28 | Runtime error | 103 ms | 262148 KB | Execution killed with signal 9 |
29 | Runtime error | 99 ms | 262148 KB | Execution killed with signal 9 |
30 | Runtime error | 103 ms | 262148 KB | Execution killed with signal 9 |
31 | Runtime error | 102 ms | 262148 KB | Execution killed with signal 9 |
32 | Runtime error | 103 ms | 262148 KB | Execution killed with signal 9 |
33 | Runtime error | 98 ms | 262148 KB | Execution killed with signal 9 |
34 | Runtime error | 104 ms | 262148 KB | Execution killed with signal 9 |
35 | Runtime error | 97 ms | 262148 KB | Execution killed with signal 9 |
36 | Runtime error | 100 ms | 262148 KB | Execution killed with signal 9 |
37 | Runtime error | 98 ms | 262148 KB | Execution killed with signal 9 |
38 | Runtime error | 108 ms | 262148 KB | Execution killed with signal 9 |
39 | Runtime error | 102 ms | 262148 KB | Execution killed with signal 9 |
40 | Runtime error | 103 ms | 262148 KB | Execution killed with signal 9 |
41 | Runtime error | 101 ms | 262148 KB | Execution killed with signal 9 |
42 | Runtime error | 100 ms | 262148 KB | Execution killed with signal 9 |