# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
935057 | 2024-02-28T13:17:01 Z | Ludissey | Measures (CEOI22_measures) | C++14 | 1500 ms | 852 KB |
#include <bits/stdc++.h> #define int long long using namespace std; const int mod=1e9+7; signed main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int n,m,D; cin >> n >> m >> D; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; for (int _i = 0; _i < m; _i++) { int x; cin >> x; a.push_back(x); sort(a.begin(),a.end()); double l=0,r=(1<<20); double ans=0; while(r-l>=0.1){ double mid=(l+r)/(double)2; double lb=a[0]-mid; bool br=false; for (int i = 1; i < a.size(); i++) { double bc=max(lb+(double)D, (double)a[i]-mid); if(bc>(double)a[i]+mid) { br=true; break; } lb=bc; } if(br){ l=mid; }else{ ans=mid; r=mid; } } int roundAns=ans; if((double)ans-roundAns<0.25) cout << roundAns << " "; else if ((double)ans-roundAns<0.75) cout << roundAns << ".5 "; else cout << roundAns+1 << " "; } cout << "\n"; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 344 KB | Output is correct |
2 | Incorrect | 1 ms | 344 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 344 KB | Output is correct |
2 | Incorrect | 1 ms | 344 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1506 ms | 852 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1506 ms | 852 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |