Submission #788950

# Submission time Handle Problem Language Result Execution time Memory
788950 2023-07-20T18:09:34 Z Ozy Boarding Passes (BOI22_passes) C++17
0 / 100
1 ms 332 KB
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define debug(a) cout << #a << " = " << a << endl
#define debugsl(a) cout << #a << " = " << a << ", "
#define rep(i,a,b) for(int i = (a); i<=(b); i++)
#define repa(i,a,b) for(int i = (a); i>=(b); i--)
#define pll pair<lli,lli>

#define MAX 100000

lli n,k;
long double dp[MAX+2],res,a;
string st;

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

    cin >> st;
    n = st.size();
    res = -1;
    rep(i,2,n) {

        a = (i-1);
        a/=2;
        dp[i] = dp[i-1] + a;

        k = n-i;
        if (k <= i) {
            a = dp[k] + dp[i];
            if (res < 0 || a < res) res = a;
        }
    }

    cout << res;

    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB 1st numbers differ - expected: '100800.5000000000', found: '100800.0000000000', error = '0.0000049603'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB 1st numbers differ - expected: '1.0000000000', found: '3.0000000000', error = '2.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB 1st numbers differ - expected: '1.0000000000', found: '3.0000000000', error = '2.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB 1st numbers differ - expected: '100800.5000000000', found: '100800.0000000000', error = '0.0000049603'
2 Halted 0 ms 0 KB -