# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1049560 | ymm | Let's Win the Election (JOI22_ho_t3) | C++17 | 714 ms | 4524 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 Loop(x,l,r) for (ll x = (l); x < (ll)(r); ++x)
#define LoopR(x,l,r) for (ll x = (r)-1; x >= (ll)(l); --x)
typedef long long ll;
typedef std::pair<int, int> pii;
typedef std::pair<ll , ll > pll;
using namespace std;
const int N = 512;
const ll inf = 1e15;
double dp1_[N][N], dp2_[N][N];
auto dp1 = dp1_, dp2 = dp2_;
pll a[N];
int n;
#define SMIN(x, y) ((x) = min((x), (y)))
double calc(ll col_tar, ll tot_tar)
{
dp1[0][0] = 0;
Loop (pos,0,n) {
Loop (col,0,pos+1) Loop (tot,col,pos+1)
dp2[col][tot] = dp1[col][tot];
Loop (col,0,pos+2)
dp2[col][pos+1] = inf;
if (a[pos].first != inf) {
Loop (col,0,pos+1) Loop (tot,col,pos+1)
SMIN(dp2[col+1][tot+1], dp1[col][tot] + (double)a[pos].first / (col + 1));
}
Loop (col,0,pos+1) Loop (tot,col,pos+1)
# | 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... |