# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1069182 | 2024-08-21T17:08:57 Z | ortsac | Brunhilda’s Birthday (BOI13_brunhilda) | C++17 | 329 ms | 262144 KB |
#include <bits/stdc++.h> using namespace std; #define int long long #define pii pair<long long, long long> #define fr first #define se second int inf = 0x3f3f3f3f3f3f3f3f; const int MAXN = 2e7 + 10; int dp[MAXN + 10], trans[MAXN + 10]; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); int n, q; cin >> n >> q; for (int i = 0; i < n; i++) { int a; cin >> a; for (int j = (a - 1); j <= MAXN; j += a) { trans[j] = max(trans[j], a - 1); } } for (int i = MAXN; i >= 1; i--) { trans[i] = max(trans[i], trans[i + 1] - 1); } for (int i = 1; i <= MAXN; i++) { dp[i] = inf; dp[i] = min(dp[i], dp[i - trans[i]] + 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 | Runtime error | 129 ms | 262144 KB | Execution killed with signal 9 |
2 | Runtime error | 150 ms | 262144 KB | Execution killed with signal 9 |
3 | Runtime error | 143 ms | 262144 KB | Execution killed with signal 9 |
4 | Runtime error | 130 ms | 262144 KB | Execution killed with signal 9 |
5 | Runtime error | 142 ms | 262144 KB | Execution killed with signal 9 |
6 | Runtime error | 131 ms | 262144 KB | Execution killed with signal 9 |
7 | Runtime error | 143 ms | 262144 KB | Execution killed with signal 9 |
8 | Runtime error | 153 ms | 262144 KB | Execution killed with signal 9 |
9 | Runtime error | 163 ms | 262144 KB | Execution killed with signal 9 |
10 | Runtime error | 177 ms | 262144 KB | Execution killed with signal 9 |
11 | Runtime error | 165 ms | 262144 KB | Execution killed with signal 9 |
12 | Runtime error | 141 ms | 262144 KB | Execution killed with signal 9 |
13 | Runtime error | 264 ms | 262144 KB | Execution killed with signal 9 |
14 | Runtime error | 253 ms | 262144 KB | Execution killed with signal 9 |
15 | Runtime error | 154 ms | 262144 KB | Execution killed with signal 9 |
16 | Runtime error | 143 ms | 262144 KB | Execution killed with signal 9 |
17 | Runtime error | 137 ms | 262144 KB | Execution killed with signal 9 |
18 | Runtime error | 118 ms | 262144 KB | Execution killed with signal 9 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 134 ms | 262144 KB | Execution killed with signal 9 |
2 | Runtime error | 160 ms | 262144 KB | Execution killed with signal 9 |
3 | Runtime error | 313 ms | 262144 KB | Execution killed with signal 9 |
4 | Runtime error | 155 ms | 262144 KB | Execution killed with signal 9 |
5 | Runtime error | 243 ms | 262144 KB | Execution killed with signal 9 |
6 | Runtime error | 149 ms | 262144 KB | Execution killed with signal 9 |
7 | Runtime error | 132 ms | 262144 KB | Execution killed with signal 9 |
8 | Runtime error | 147 ms | 262144 KB | Execution killed with signal 9 |
9 | Runtime error | 250 ms | 262144 KB | Execution killed with signal 9 |
10 | Runtime error | 302 ms | 262144 KB | Execution killed with signal 9 |
11 | Runtime error | 322 ms | 262144 KB | Execution killed with signal 9 |
12 | Runtime error | 206 ms | 262144 KB | Execution killed with signal 9 |
13 | Runtime error | 145 ms | 262144 KB | Execution killed with signal 9 |
14 | Runtime error | 155 ms | 262144 KB | Execution killed with signal 9 |
15 | Runtime error | 251 ms | 262144 KB | Execution killed with signal 9 |
16 | Runtime error | 163 ms | 262144 KB | Execution killed with signal 9 |
17 | Runtime error | 261 ms | 262144 KB | Execution killed with signal 9 |
18 | Runtime error | 266 ms | 262144 KB | Execution killed with signal 9 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 265 ms | 262144 KB | Execution killed with signal 9 |
2 | Runtime error | 313 ms | 262144 KB | Execution killed with signal 9 |
3 | Runtime error | 303 ms | 262144 KB | Execution killed with signal 9 |
4 | Runtime error | 197 ms | 262144 KB | Execution killed with signal 9 |
5 | Runtime error | 165 ms | 262144 KB | Execution killed with signal 9 |
6 | Runtime error | 255 ms | 262144 KB | Execution killed with signal 9 |
7 | Runtime error | 241 ms | 262144 KB | Execution killed with signal 9 |
8 | Runtime error | 260 ms | 262144 KB | Execution killed with signal 9 |
9 | Runtime error | 258 ms | 262144 KB | Execution killed with signal 9 |
10 | Runtime error | 232 ms | 262144 KB | Execution killed with signal 9 |
11 | Runtime error | 191 ms | 262144 KB | Execution killed with signal 9 |
12 | Runtime error | 237 ms | 262144 KB | Execution killed with signal 9 |
13 | Runtime error | 298 ms | 262144 KB | Execution killed with signal 9 |
14 | Runtime error | 195 ms | 262144 KB | Execution killed with signal 9 |
15 | Runtime error | 268 ms | 262144 KB | Execution killed with signal 9 |
16 | Runtime error | 283 ms | 262144 KB | Execution killed with signal 9 |
17 | Runtime error | 243 ms | 262144 KB | Execution killed with signal 9 |
18 | Runtime error | 305 ms | 262144 KB | Execution killed with signal 9 |
19 | Runtime error | 140 ms | 262144 KB | Execution killed with signal 9 |
20 | Runtime error | 308 ms | 262144 KB | Execution killed with signal 9 |
21 | Runtime error | 220 ms | 262144 KB | Execution killed with signal 9 |
22 | Runtime error | 312 ms | 262144 KB | Execution killed with signal 9 |
23 | Runtime error | 155 ms | 262144 KB | Execution killed with signal 9 |
24 | Runtime error | 155 ms | 262144 KB | Execution killed with signal 9 |
25 | Runtime error | 211 ms | 262144 KB | Execution killed with signal 9 |
26 | Runtime error | 207 ms | 262144 KB | Execution killed with signal 9 |
27 | Runtime error | 329 ms | 262144 KB | Execution killed with signal 9 |
28 | Runtime error | 142 ms | 262144 KB | Execution killed with signal 9 |
29 | Runtime error | 289 ms | 262144 KB | Execution killed with signal 9 |
30 | Runtime error | 247 ms | 262144 KB | Execution killed with signal 9 |
31 | Runtime error | 159 ms | 262144 KB | Execution killed with signal 9 |
32 | Runtime error | 162 ms | 262144 KB | Execution killed with signal 9 |
33 | Runtime error | 122 ms | 262144 KB | Execution killed with signal 9 |
34 | Runtime error | 242 ms | 262144 KB | Execution killed with signal 9 |
35 | Runtime error | 146 ms | 262144 KB | Execution killed with signal 9 |
36 | Runtime error | 303 ms | 262144 KB | Execution killed with signal 9 |
37 | Runtime error | 169 ms | 262144 KB | Execution killed with signal 9 |
38 | Runtime error | 300 ms | 262144 KB | Execution killed with signal 9 |
39 | Runtime error | 146 ms | 262144 KB | Execution killed with signal 9 |
40 | Runtime error | 221 ms | 262144 KB | Execution killed with signal 9 |
41 | Runtime error | 235 ms | 262144 KB | Execution killed with signal 9 |
42 | Runtime error | 277 ms | 262144 KB | Execution killed with signal 9 |