# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
371208 | 2021-02-26T05:32:02 Z | ja_kingy | Circus (Balkan15_CIRCUS) | C++14 | 38 ms | 2788 KB |
#include "circus.h" #include <bits/stdc++.h> using namespace std; typedef pair<int,int> pii; vector<pii> mnstk; void init(int N, int M, int P[]){ sort(P, P+N); priority_queue<pii> pq; mnstk.push_back({M,M}); for (int i = N; i-->0;) { while (pq.size() && pq.top().first >= P[i]) { if (pq.top().second < mnstk.back().second) { mnstk.push_back(pq.top()); } pq.pop(); } pq.push({2*P[i] - mnstk.back().second, P[i]}); } while (pq.size()) { if (pq.top().second < mnstk.back().second) { mnstk.push_back(pq.top()); } pq.pop(); } } int minLength(int D) { auto p = lower_bound(mnstk.rbegin(), mnstk.rend(), make_pair(D,0)); return p->second - D; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 32 ms | 1892 KB | Output is correct |
2 | Correct | 34 ms | 2788 KB | Output is correct |
3 | Correct | 33 ms | 2788 KB | Output is correct |
4 | Correct | 38 ms | 2660 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 32 ms | 1892 KB | Output is correct |
2 | Correct | 34 ms | 2788 KB | Output is correct |
3 | Correct | 33 ms | 2788 KB | Output is correct |
4 | Correct | 38 ms | 2660 KB | Output is correct |
5 | Incorrect | 1 ms | 364 KB | Output isn't correct |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 32 ms | 1892 KB | Output is correct |
2 | Correct | 34 ms | 2788 KB | Output is correct |
3 | Correct | 33 ms | 2788 KB | Output is correct |
4 | Correct | 38 ms | 2660 KB | Output is correct |
5 | Incorrect | 1 ms | 364 KB | Output isn't correct |
6 | Halted | 0 ms | 0 KB | - |