0w1

Entries from 2017-01-23 to 1 day

CFR 351 A. Jeff and Rounding ( Ad hoc, Math )

kmjp さんの記事を参考にしました。 Problem - A - Codeforces題意: 給你 2 * N 個數字,要把 N 個數向下取整,另外 N 個數向上取整。問總和的最小變化量是多少。資料規模: The first line contains integer n (1 ≤ n ≤ 2000). The next line contains 2n …

CFR 235 B. Let's Play Osu! ( DP, Math )

Problem - B - Codeforces題意: 假設有個 OX 序列,每個連續段 'O' 長度若為 x,則該段貢獻為 x^2。已知序列長度,以及分別每個字符為 O 的機率,求期望貢獻和。資料規模: The first line contains an integer n (1 ≤ n ≤ 1e5) — the number of clicks. Th…