답안 #946214

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
946214 2024-03-14T12:15:16 Z Ahmed57 Measures (CEOI22_measures) C++17
10 / 100
1500 ms 7124 KB
#include "bits/stdc++.h"
using namespace std;
 
signed main(){
    ios_base::sync_with_stdio(false);cin.tie(0);
    int n,m;
    long double d;
    cin>>n>>m>>d;
    std::vector<long double> v;
    for(int i = 0;i<n;i++){
        double x;cin>>x;
        v.push_back(x);
    }
    for(int i = 0;i<m;i++){
        double x;cin>>x;
        v.push_back(x);
        sort(v.begin(),v.end());
        if(v.size()==1){
            cout<<0<<" ";
            continue;
        }
        long double l = 0.0 , r = 10000000000000.0;
        long double ans = 0;
        for(int j = 0;j<70;j++){
            long double mid = (l+r)/2;
            long double la = -10000000000000.0;
            long double ss = 1;
            for(auto e:v){
                long double cur = max(la+d,e-mid);
                if(abs(cur-e)>mid){
                    ss = 0;
                    break;
                }
                la = cur;
            }
            if(ss){
                ans = mid;
                r = mid;
            }else l = mid;
        }
        long long lol = 1;
        long long nah = ans;
        cout<<nah;
        string s = ".";
        while(lol--){
            ans*=10;
            long long a3 = ans;
            s+=char(a3%10+'0');
            if(a3%10){
                cout<<s;
                s = "";
            }
        }
        if(i<m-1)cout<<" ";
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 348 KB Output is correct
2 Correct 9 ms 420 KB Output is correct
3 Correct 8 ms 344 KB Output is correct
4 Correct 8 ms 348 KB Output is correct
5 Correct 8 ms 344 KB Output is correct
6 Correct 9 ms 524 KB Output is correct
7 Correct 8 ms 348 KB Output is correct
8 Correct 9 ms 412 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 348 KB Output is correct
2 Correct 9 ms 420 KB Output is correct
3 Correct 8 ms 344 KB Output is correct
4 Correct 8 ms 348 KB Output is correct
5 Correct 8 ms 344 KB Output is correct
6 Correct 9 ms 524 KB Output is correct
7 Correct 8 ms 348 KB Output is correct
8 Correct 9 ms 412 KB Output is correct
9 Correct 781 ms 5580 KB Output is correct
10 Correct 1153 ms 7124 KB Output is correct
11 Correct 922 ms 5396 KB Output is correct
12 Correct 1161 ms 5840 KB Output is correct
13 Correct 741 ms 6532 KB Output is correct
14 Correct 741 ms 5576 KB Output is correct
15 Correct 929 ms 6608 KB Output is correct
16 Incorrect 193 ms 6092 KB Output isn't correct
17 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1537 ms 768 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1537 ms 768 KB Time limit exceeded
2 Halted 0 ms 0 KB -