Submission #60994001


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
//#define int long long
long double x[1000005],h[1000005],ans=-1e18;
int n;
signed main()
{
    cin.tie(0)->sync_with_stdio(0);
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>x[i]>>h[i];
        if(i!=1)ans=max(ans,h[i]-x[i]*((h[i]-h[i-1])/(x[i]-x[i-1])));
    }
    if(n==1||(!(abs(ans)<1e-8)&&ans<0))cout<<-1;
    else printf("%.13Lf",ans);
    return 0;
}

Submission Info

Submission Time
Task F - Visible Buildings
User FIRESTARS
Language C++ 20 (gcc 12.2)
Score 0
Code Size 430 Byte
Status WA
Exec Time 55 ms
Memory 9972 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 525
Status
AC × 4
AC × 26
WA × 1
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt
All hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt
Case Name Status Exec Time Memory
hand_01.txt AC 1 ms 3724 KiB
hand_02.txt WA 1 ms 3712 KiB
hand_03.txt AC 1 ms 3788 KiB
hand_04.txt AC 1 ms 3596 KiB
random_01.txt AC 55 ms 9972 KiB
random_02.txt AC 41 ms 8456 KiB
random_03.txt AC 35 ms 7796 KiB
random_04.txt AC 18 ms 5776 KiB
random_05.txt AC 41 ms 8332 KiB
random_06.txt AC 21 ms 6048 KiB
random_07.txt AC 8 ms 4608 KiB
random_08.txt AC 28 ms 6844 KiB
random_09.txt AC 5 ms 4200 KiB
random_10.txt AC 13 ms 4992 KiB
random_11.txt AC 35 ms 7740 KiB
random_12.txt AC 25 ms 6528 KiB
random_13.txt AC 6 ms 4312 KiB
random_14.txt AC 13 ms 5220 KiB
random_15.txt AC 43 ms 8792 KiB
random_16.txt AC 37 ms 8132 KiB
random_17.txt AC 27 ms 7004 KiB
random_18.txt AC 39 ms 8304 KiB
random_19.txt AC 30 ms 7484 KiB
sample_01.txt AC 1 ms 3764 KiB
sample_02.txt AC 1 ms 3592 KiB
sample_03.txt AC 1 ms 3848 KiB
sample_04.txt AC 1 ms 3784 KiB