# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
329476 | 2020-11-21T09:48:43 Z | dolphingarlic | Circus (Balkan15_CIRCUS) | C++14 | 45 ms | 11096 KB |
#include "circus.h" #include <bits/stdc++.h> using namespace std; int n, m, p[100000], mn[100000]; void init(int N, int M, int P[]){ n = N, m = M; memcpy(p, P, sizeof p); sort(p, p + n); priority_queue<pair<int, int>> pq; for (int i = 0; i < n; i++) pq.push({p[i] - m, i}); int tmp = n; while (pq.size()) { int cost, curr; tie(cost, curr) = pq.top(); pq.pop(); if (!mn[curr]) { assert(curr == --tmp); mn[curr] = -cost; for (int i = 0; i < n; i++) if (!mn[i] && abs(p[curr] - p[i]) >= -cost) { pq.push({-abs(p[curr] - p[i]), i}); } } } } 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
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 45 ms | 11096 KB | Execution killed with signal 6 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 2 ms | 1260 KB | Execution killed with signal 6 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 2 ms | 1260 KB | Execution killed with signal 6 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 2 ms | 1260 KB | Execution killed with signal 6 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 45 ms | 11096 KB | Execution killed with signal 6 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 45 ms | 11096 KB | Execution killed with signal 6 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |