# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
275878 | 2020-08-20T08:12:35 Z | 최은수(#5098) | Circus (Balkan15_CIRCUS) | C++17 | 4000 ms | 1656 KB |
#include"circus.h" #include<iostream> #include<vector> #include<algorithm> #define ep emplace #define eb emplace_back #define fi first #define se second #define all(x) (x).begin(),(x).end() using namespace std; typedef long long ll; typedef pair<int,int>pi; typedef pair<ll,ll>pl; const int inf=1e9+7; const ll INF=1e18; static int n,m; static vector<int>p; static int cal[100010]; void init(int N,int M,int P[]) { n=N,m=M; for(int i=0;i<n;i++) p.eb(P[i]); sort(all(p)); p.erase(unique(all(p)),p.end()); n=p.size(); for(int i=0;i<n;i++) cal[i]=m-p[i]; for(int i=0;i<n;i++) for(int j=0;j<n;j++) for(int k=0;k<n;k++) if(abs(p[j]-p[k])>=cal[k]) cal[j]=min(cal[j],abs(p[j]-p[k])); p.eb(m); return; } int minLength(int D) { int d=D; int ans=m-d; for(int i=0;i<n;i++) if(abs(d-p[i])>=cal[i]) ans=min(ans,abs(d-p[i])); return ans; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 4094 ms | 1656 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 256 KB | Output is correct |
2 | Correct | 4 ms | 384 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
4 | Correct | 4 ms | 256 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 256 KB | Output is correct |
2 | Correct | 4 ms | 384 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
4 | Correct | 4 ms | 256 KB | Output is correct |
5 | Execution timed out | 4090 ms | 384 KB | Time limit exceeded |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 256 KB | Output is correct |
2 | Correct | 4 ms | 384 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
4 | Correct | 4 ms | 256 KB | Output is correct |
5 | Execution timed out | 4090 ms | 384 KB | Time limit exceeded |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 4094 ms | 1656 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 4094 ms | 1656 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |