提出 #22214609


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;

int main() {
    int n, D, H;
    cin >> n >> D >> H;
    vector<int> d(n), h(n);
    for(int i = 0; i < n; ++i) cin >> d[i] >> h[i];

    double h1 = 0;
    for (int i = 0; i < n; ++i){
        double h2 = 0;
        h2 = (double) (H - h[i]) * D / (D - d[i]);
        h2 = H - h2;
        h1 = max(h1, h2);
    }

    if (h1 < 0) cout << 0.0 << endl;
    else cout << h1 << endl;



    return 0;
}

提出情報

提出日時
問題 B - 友好の印
ユーザ Polarnight
言語 C++ (GCC 9.2.1)
得点 200
コード長 469 Byte
結果 AC
実行時間 6 ms
メモリ 3820 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 3
AC × 26
セット名 テストケース
Sample 01_sample.txt, 02_sample.txt, 03_sample.txt
All 01_sample.txt, 02_sample.txt, 03_sample.txt, 04_random.txt, 05_random.txt, 06_random.txt, 07_random.txt, 08_random.txt, 09_random.txt, 10_random.txt, 11_random.txt, 12_random.txt, 13_random.txt, 14_random.txt, 15_random.txt, 16_random.txt, 17_random.txt, 18_random.txt, 19_random.txt, 20_random.txt, 21_random.txt, 22_random.txt, 23_random.txt, 24_zero.txt, 25_zero.txt, 26_zero.txt
ケース名 結果 実行時間 メモリ
01_sample.txt AC 5 ms 3596 KiB
02_sample.txt AC 2 ms 3724 KiB
03_sample.txt AC 2 ms 3820 KiB
04_random.txt AC 2 ms 3664 KiB
05_random.txt AC 2 ms 3604 KiB
06_random.txt AC 3 ms 3724 KiB
07_random.txt AC 2 ms 3596 KiB
08_random.txt AC 2 ms 3684 KiB
09_random.txt AC 3 ms 3720 KiB
10_random.txt AC 2 ms 3672 KiB
11_random.txt AC 2 ms 3600 KiB
12_random.txt AC 2 ms 3600 KiB
13_random.txt AC 3 ms 3660 KiB
14_random.txt AC 2 ms 3664 KiB
15_random.txt AC 2 ms 3664 KiB
16_random.txt AC 2 ms 3756 KiB
17_random.txt AC 2 ms 3708 KiB
18_random.txt AC 2 ms 3660 KiB
19_random.txt AC 2 ms 3664 KiB
20_random.txt AC 2 ms 3716 KiB
21_random.txt AC 2 ms 3672 KiB
22_random.txt AC 2 ms 3756 KiB
23_random.txt AC 2 ms 3684 KiB
24_zero.txt AC 6 ms 3816 KiB
25_zero.txt AC 2 ms 3764 KiB
26_zero.txt AC 2 ms 3680 KiB