# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
712225 | 2023-03-18T12:02:18 Z | stevancv | Brunhilda’s Birthday (BOI13_brunhilda) | C++14 | 493 ms | 262276 KB |
#include <bits/stdc++.h> #define ll long long #define ld long double #define sp ' ' #define en '\n' #define smin(a, b) a = min(a, b) #define smax(a, b) a = max(a, b) using namespace std; const int N = 1e5 + 2; const int M = 1e7 + 2; const int inf = 1e9; vector<int> primes[M]; int idx[M], ans[N], koji[M], dp[M]; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); assert(false); int n, q; cin >> n >> q; for (int i = 0; i < n; i++) { int x; cin >> x; //for (int j = x; j < M; j += x) primes[j].push_back(x); } multiset<int> s; for (int i = 0; i < n; i++) s.insert(0); for (int i = 1; i <= q; i++) { int x; cin >> x; idx[x] = i; } for (int i = 1; i < M; i++) { dp[i] = inf; for (int j : primes[i]) { s.erase(s.find(koji[j])); } if (!s.empty()) dp[i] = *(s.begin()) + 1; ans[idx[i]] = dp[i]; for (int j : primes[i]) { koji[j] = dp[i]; s.insert(koji[j]); } } for (int i = 1; i <= q; i++) { if (ans[i] >= inf) cout << "oo" << en; else cout << ans[i] << en; } assert(false); return 0; }
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 391 ms | 262144 KB | Execution killed with signal 6 |
2 | Runtime error | 338 ms | 262144 KB | Execution killed with signal 6 |
3 | Runtime error | 367 ms | 262144 KB | Execution killed with signal 6 |
4 | Runtime error | 330 ms | 262144 KB | Execution killed with signal 6 |
5 | Runtime error | 350 ms | 262144 KB | Execution killed with signal 6 |
6 | Runtime error | 350 ms | 262144 KB | Execution killed with signal 6 |
7 | Runtime error | 338 ms | 262144 KB | Execution killed with signal 6 |
8 | Runtime error | 349 ms | 262144 KB | Execution killed with signal 6 |
9 | Runtime error | 357 ms | 262144 KB | Execution killed with signal 6 |
10 | Runtime error | 347 ms | 262144 KB | Execution killed with signal 6 |
11 | Runtime error | 339 ms | 262144 KB | Execution killed with signal 6 |
12 | Runtime error | 335 ms | 262144 KB | Execution killed with signal 6 |
13 | Runtime error | 347 ms | 262144 KB | Execution killed with signal 6 |
14 | Runtime error | 357 ms | 262144 KB | Execution killed with signal 6 |
15 | Runtime error | 348 ms | 262144 KB | Execution killed with signal 6 |
16 | Runtime error | 358 ms | 262144 KB | Execution killed with signal 6 |
17 | Runtime error | 347 ms | 262144 KB | Execution killed with signal 6 |
18 | Runtime error | 340 ms | 262144 KB | Execution killed with signal 6 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 360 ms | 262144 KB | Execution killed with signal 6 |
2 | Runtime error | 354 ms | 262144 KB | Execution killed with signal 6 |
3 | Runtime error | 355 ms | 262144 KB | Execution killed with signal 6 |
4 | Runtime error | 358 ms | 262144 KB | Execution killed with signal 6 |
5 | Runtime error | 343 ms | 262144 KB | Execution killed with signal 6 |
6 | Runtime error | 362 ms | 262144 KB | Execution killed with signal 6 |
7 | Runtime error | 334 ms | 262144 KB | Execution killed with signal 6 |
8 | Runtime error | 363 ms | 262144 KB | Execution killed with signal 6 |
9 | Runtime error | 337 ms | 262144 KB | Execution killed with signal 6 |
10 | Runtime error | 348 ms | 262144 KB | Execution killed with signal 6 |
11 | Runtime error | 400 ms | 262144 KB | Execution killed with signal 6 |
12 | Runtime error | 372 ms | 262144 KB | Execution killed with signal 6 |
13 | Runtime error | 354 ms | 262144 KB | Execution killed with signal 6 |
14 | Runtime error | 326 ms | 262144 KB | Execution killed with signal 6 |
15 | Runtime error | 380 ms | 262144 KB | Execution killed with signal 6 |
16 | Runtime error | 389 ms | 262144 KB | Execution killed with signal 6 |
17 | Runtime error | 346 ms | 262144 KB | Execution killed with signal 6 |
18 | Runtime error | 357 ms | 262144 KB | Execution killed with signal 6 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 339 ms | 262144 KB | Execution killed with signal 6 |
2 | Runtime error | 350 ms | 262144 KB | Execution killed with signal 6 |
3 | Runtime error | 334 ms | 262144 KB | Execution killed with signal 6 |
4 | Runtime error | 374 ms | 262144 KB | Execution killed with signal 6 |
5 | Runtime error | 350 ms | 262144 KB | Execution killed with signal 6 |
6 | Runtime error | 382 ms | 262144 KB | Execution killed with signal 6 |
7 | Runtime error | 368 ms | 262144 KB | Execution killed with signal 6 |
8 | Runtime error | 336 ms | 262144 KB | Execution killed with signal 6 |
9 | Runtime error | 359 ms | 262144 KB | Execution killed with signal 6 |
10 | Runtime error | 322 ms | 262144 KB | Execution killed with signal 6 |
11 | Runtime error | 373 ms | 262144 KB | Execution killed with signal 6 |
12 | Runtime error | 324 ms | 262144 KB | Execution killed with signal 6 |
13 | Runtime error | 341 ms | 262144 KB | Execution killed with signal 6 |
14 | Runtime error | 362 ms | 262144 KB | Execution killed with signal 6 |
15 | Runtime error | 340 ms | 262144 KB | Execution killed with signal 6 |
16 | Runtime error | 371 ms | 262144 KB | Execution killed with signal 6 |
17 | Runtime error | 333 ms | 262144 KB | Execution killed with signal 6 |
18 | Runtime error | 335 ms | 262144 KB | Execution killed with signal 6 |
19 | Runtime error | 349 ms | 262144 KB | Execution killed with signal 6 |
20 | Runtime error | 337 ms | 262144 KB | Execution killed with signal 6 |
21 | Runtime error | 344 ms | 262144 KB | Execution killed with signal 6 |
22 | Runtime error | 341 ms | 262144 KB | Execution killed with signal 6 |
23 | Runtime error | 351 ms | 262144 KB | Execution killed with signal 6 |
24 | Runtime error | 366 ms | 262144 KB | Execution killed with signal 6 |
25 | Runtime error | 353 ms | 262144 KB | Execution killed with signal 6 |
26 | Runtime error | 342 ms | 262144 KB | Execution killed with signal 6 |
27 | Runtime error | 347 ms | 262144 KB | Execution killed with signal 6 |
28 | Runtime error | 403 ms | 262144 KB | Execution killed with signal 6 |
29 | Runtime error | 375 ms | 262144 KB | Execution killed with signal 6 |
30 | Runtime error | 407 ms | 262144 KB | Execution killed with signal 6 |
31 | Runtime error | 373 ms | 262144 KB | Execution killed with signal 6 |
32 | Runtime error | 376 ms | 262144 KB | Execution killed with signal 6 |
33 | Runtime error | 417 ms | 262144 KB | Execution killed with signal 6 |
34 | Runtime error | 402 ms | 262144 KB | Execution killed with signal 6 |
35 | Runtime error | 391 ms | 262144 KB | Execution killed with signal 6 |
36 | Runtime error | 432 ms | 262144 KB | Execution killed with signal 6 |
37 | Runtime error | 206 ms | 262144 KB | Execution killed with signal 9 |
38 | Runtime error | 392 ms | 262144 KB | Execution killed with signal 6 |
39 | Runtime error | 428 ms | 262144 KB | Execution killed with signal 9 |
40 | Runtime error | 381 ms | 262144 KB | Execution killed with signal 6 |
41 | Runtime error | 405 ms | 262144 KB | Execution killed with signal 6 |
42 | Runtime error | 493 ms | 262276 KB | Execution killed with signal 6 |