제출 #1153284

#제출 시각아이디문제언어결과실행 시간메모리
1153284IssaMeasures (CEOI22_measures)C++20
0 / 100
1595 ms3600 KiB
// #include <bits/stdc++.h> #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define ent "\n" const int maxn = 5e5 + 100; const ll INF = (ll)4e18 + 100; const int inf = 1e9 + 100; const ll MOD = 998244353; const int maxl = 20; const ll P = 31; int n, m; long double a[maxn], D; long double calc(int n){ sort(a + 1, a + n + 1); long double l = 0, r = 1000000000; for(int i = 0; i < 100; i++){ long double mid = (l + r) / 2, last = -inf; bool ok = 1; for(int i = 1; i <= n; i++){ last = max(a[i] - mid, last + D); if(last > a[i] + mid){ ok = 0; break; } } if(!ok) l = mid; else r = mid; } return l; } void test(){ cin >> n >> m >> D; for(int i = 1; i <= n + m; i++){ cin >> a[i]; } for(int i = n + 1; i <= n + m; i++){ cout << calc(i) << ' '; } cout << ent; } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t = 1; while(t--) test(); cout << ent; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...