Submission #47240866


Source Code Expand

#include <bits/stdc++.h>

using namespace std;
typedef long long lli;
typedef long double ld;
typedef pair<lli, lli> pll;
#define mp(x, y) make_pair(x, y)

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    lli N;
    cin >> N;
    ld P[N+1];
    for (lli i = 1; i <= N; i++) cin >> P[i];
    ld dp[N+1][N+1];
    for (lli i = 0; i <= N; i++) for (lli j = 0; j <= N; j++) dp[i][j] = -1e308;
    dp[0][0] = 0;

    for (lli i = 1; i <= N; i++) {
        for (lli j = 1; j <= N; j++) {
            dp[i][j] = max(dp[i-1][j], 0.9*dp[i-1][j-1] + P[i]);
        }
    }

    ld ans = -1e308;
    for (lli j = 1; j <= N; j++) {
        ld val = dp[N][j]*(-0.1)/(powl(0.9, j) - 1) - 1200/sqrtl(j);
        ans = max(ans, val);
    }

    cout << fixed << setprecision(20) << ans;

    return 0;
}

Submission Info

Submission Time
Task E - Maximize Rating
User omsincoconut
Language C++ 20 (gcc 12.2)
Score 0
Code Size 871 Byte
Status WA
Exec Time 290 ms
Memory 394740 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 475
Status
AC × 3
AC × 32
WA × 3
Set Name Test Cases
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, random_00.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, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt
Case Name Status Exec Time Memory
example_00.txt AC 1 ms 3900 KiB
example_01.txt AC 1 ms 3784 KiB
example_02.txt AC 1 ms 3924 KiB
hand_00.txt AC 289 ms 394652 KiB
hand_01.txt AC 1 ms 3864 KiB
hand_02.txt AC 289 ms 394740 KiB
hand_03.txt AC 290 ms 394692 KiB
hand_04.txt AC 1 ms 3800 KiB
hand_05.txt AC 1 ms 3764 KiB
hand_06.txt AC 290 ms 394716 KiB
random_00.txt AC 288 ms 393252 KiB
random_01.txt AC 279 ms 379452 KiB
random_02.txt AC 6 ms 10092 KiB
random_03.txt AC 1 ms 3804 KiB
random_04.txt WA 1 ms 3804 KiB
random_05.txt AC 287 ms 392316 KiB
random_06.txt AC 283 ms 385484 KiB
random_07.txt AC 5 ms 8548 KiB
random_08.txt WA 1 ms 3888 KiB
random_09.txt WA 1 ms 3896 KiB
random_10.txt AC 283 ms 386944 KiB
random_11.txt AC 281 ms 384100 KiB
random_12.txt AC 5 ms 9016 KiB
random_13.txt AC 1 ms 3804 KiB
random_14.txt AC 1 ms 3764 KiB
random_15.txt AC 280 ms 381128 KiB
random_16.txt AC 289 ms 394344 KiB
random_17.txt AC 5 ms 9372 KiB
random_18.txt AC 1 ms 3860 KiB
random_19.txt AC 1 ms 3764 KiB
random_20.txt AC 282 ms 385416 KiB
random_21.txt AC 280 ms 382800 KiB
random_22.txt AC 5 ms 8984 KiB
random_23.txt AC 1 ms 3884 KiB
random_24.txt AC 1 ms 3944 KiB