# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
549711 | cpp219 | Let's Win the Election (JOI22_ho_t3) | C++17 | 692 ms | 3916 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define fs first
#define sc second
#define debug(y) cout<<y,exit(0)
using namespace std;
typedef pair<ll,ll> LL;
const ll N = 500 + 9;
const ll inf = 1e18 + 7;
ld ans = inf*1.0,dp[N][N];
ll n,k,collab;
LL a[N];
bool lf(LL x,LL y){
return x.sc < y.sc;
}
ld cal(ll mid){
for (ll i = 1;i <= n;i++)
for (ll j = 0;j <= i;j++){
dp[i][j] = inf;
if (i - j - 1 >= mid) dp[i][j] = dp[i - 1][j];
else dp[i][j] = dp[i - 1][j] + (ld)a[i].sc/((ld)i - j);
if (j) dp[i][j] = min(dp[i][j],dp[i - 1][j - 1] + (ld)a[i].fs/((ld)mid + 1));
}
ld tmp = inf;
for (ll i = k - mid;i <= n;i++)
if (n - i >= mid) tmp = min(tmp,dp[n][i]);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |