# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
329480 | 2020-11-21T09:58:28 Z | dolphingarlic | Circus (Balkan15_CIRCUS) | C++14 | 2111 ms | 524292 KB |
#include "circus.h" #include <bits/stdc++.h> using namespace std; int n, m, p[100001], mn[100000]; void init(int N, int M, int P[]){ n = N, m = M; memcpy(p, P, sizeof p); sort(p, p + n); p[n] = m; memset(mn, 0x3f, sizeof mn); priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq; pq.push({mn[n] = 0, n}); while (pq.size()) { int cost, curr; tie(cost, curr) = pq.top(); pq.pop(); if (cost != mn[curr]) continue; for (int i = 0; i < n; i++) { if (abs(p[curr] - p[i]) >= cost && abs(p[curr] - p[i]) < mn[i]) { pq.push({mn[i] = abs(p[curr] - p[i]), i}); if (i > curr) break; } } } } int minLength(int D) { int ans = m - D; for (int i = 0; i < n; i++) if (abs(D - p[i]) >= mn[i]) { ans = min(ans, abs(D - p[i])); } return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 2111 ms | 524292 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 1132 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 1132 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 1132 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 2111 ms | 524292 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 2111 ms | 524292 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |