# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
275663 | 2020-08-20T06:58:35 Z | 임성재(#5103) | Circus (Balkan15_CIRCUS) | C++17 | 3529 ms | 524292 KB |
#include "circus.h" #include<bits/stdc++.h> using namespace std; #define fast ios::sync_with_stdio(false); cin.tie(0); #define fi first #define se second #define em emplace #define eb emplace_back #define all(v) (v).begin(), (v).end() #define mp make_pair typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; const int inf = 1e9; const ll INF = 1e18; int n, m; int dp[100010]; bool chk[100010]; vector<int> p; priority_queue<pii, vector<pii>, greater<pii>> pQ; void init(int N, int M, int P[]){ n = N; m = M; for(int i=0; i<n; i++) p.eb(P[i]); p.eb(0); p.eb(m); sort(all(p)); pQ.em(0, p.size()-1); while(pQ.size()) { auto x = pQ.top(); pQ.pop(); if(chk[x.se]) continue; chk[x.se] = true; dp[x.se] = x.fi; for(int i=0; i<p.size(); i++) { if(chk[i]) continue; if(abs(p[x.se] - p[i]) >= x.fi) { pQ.em(abs(p[x.se] - p[i]), i); } } } /*for(int i=0; i<p.size(); i++) cout << dp[i] << " "; cout << endl;*/ } int minLength(int D) { int ret = m - D; for(int i=0; i<p.size(); i++) { if(abs(p[i] - D) < dp[i]) continue; ret = min(ret, abs(p[i] - D)); } return ret; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1122 ms | 524292 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Correct | 1 ms | 384 KB | Output is correct |
4 | Correct | 1 ms | 384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Correct | 1 ms | 384 KB | Output is correct |
4 | Correct | 1 ms | 384 KB | Output is correct |
5 | Correct | 513 ms | 16856 KB | Output is correct |
6 | Correct | 509 ms | 16848 KB | Output is correct |
7 | Correct | 462 ms | 16856 KB | Output is correct |
8 | Correct | 455 ms | 16856 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Correct | 1 ms | 384 KB | Output is correct |
4 | Correct | 1 ms | 384 KB | Output is correct |
5 | Correct | 513 ms | 16856 KB | Output is correct |
6 | Correct | 509 ms | 16848 KB | Output is correct |
7 | Correct | 462 ms | 16856 KB | Output is correct |
8 | Correct | 455 ms | 16856 KB | Output is correct |
9 | Incorrect | 3529 ms | 23328 KB | Output isn't correct |
10 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1122 ms | 524292 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1122 ms | 524292 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |