# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1006184 | 2024-06-23T14:05:07 Z | lalig777 | Circus (Balkan15_CIRCUS) | C++14 | 3420 ms | 2140 KB |
#include "circus.h" #include <iostream> #include <vector> #include <queue> #include <algorithm> #include <cmath> using namespace std; vector<int>minrope; vector<int>copiaP; int copiaN, copiaM; void init(int N, int M, int P[]){ copiaN=N; copiaM=M; copiaP.resize(N); for (int i=0; i<N; i++) copiaP[i]=P[i]; sort(copiaP.begin(), copiaP.end()); minrope.assign(N, 1e9); for (int i=0; i<N; i++) minrope[i]=M-copiaP[i]; for (int i=N-1; i>0; i--){ for (int j=i-1; j>=0; j--){ if (minrope[i]<=copiaP[i]-copiaP[j]) minrope[j]=min(minrope[j], copiaP[i]-copiaP[j]); } } } int minLength(int D){ int l=0, r=copiaN-1; int pos=copiaN; while (l<=r){ int m=(r-l)/2+l; if (copiaP[m]>=D){ r=m-1; pos=m; }else l=m+1; }int ans=copiaM-D; l=pos; r=copiaN-1; while (l<=r){ int m=(r-l)/2+l; if (minrope[m]<=copiaP[m]-D){ ans=copiaP[m]-D; r=m-1; }else l=m+1; }return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3420 ms | 2140 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3420 ms | 2140 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3420 ms | 2140 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |