This documentation is automatically generated by online-judge-tools/verification-helper
# verification-helper: PROBLEM https://atcoder.jp/contests/abc332/tasks/abc332_e
# verification-helper: ERROR 1e-6
{.checks: off.}
import cplib/utils/bititers
import sequtils, std/math
proc scanf(formatstr: cstring){.header: "<stdio.h>", varargs.}
proc ii(): int {.inline.} = scanf("%lld\n", addr result)
var N, D = ii()
var W = newSeqWith(N, float(ii()))
var avg = sum(W)/float(D)
var DP = newSeqWith(D+1, newSeqWith((1 shl N), 1e100))
DP[0][0] = 0
for d in 0..<D:
for i in 0..<(1 shl N):
for j in bitsuperset(i, N):
var k = i xor j
var tmp = 0.0
for l in standingbits(k):
tmp += W[l]
DP[d+1][j] = min(DP[d+1][j], DP[d][i] + (tmp-avg)^2)
echo "+", DP[D][^1]/float(D)
Traceback (most recent call last):
File "/home/runner/.local/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py", line 71, in _render_source_code_stat
bundled_code = language.bundle(stat.path, basedir=basedir, options={'include_paths': [basedir]}).decode()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.local/lib/python3.12/site-packages/onlinejudge_verify/languages/nim.py", line 86, in bundle
raise NotImplementedError
NotImplementedError