# Difference between revisions of "2018 Multi-University, HDU Day 8"

## Problem A

Solved by zerol. 00:41 (+1)

## Problem B

Solved by kblack. 03:10 (+2)

## Problem D

Solved by zerol. 01:23 (+1)

$h+w-2$

((((((((
(()()())
()()()()
(()()())
()()()()
(()()())
()()()()
()))))))


$\max(h,w)-\min(h,w)/2-1$

()()()
(()())
()()()
(()())
()()()
(()())


zerol：看这一度 2%~3% 的通过率，吓坏了，果不其然，先 WA 一发。

## Problem E

Solved by zerol. 00:14 (+)

## Problem F

Upsolved by ultmaster.

partitions = IntegerPartitions[n];
cycles = Flatten[Table[{partitions[[i]], partitions[[j]]}, {i, 1, Length[partitions]}, {j, 1, Length[partitions]}], 1];
Length[cycles]
c[p_] := Total[p]!/(Times @@ p)/(Times @@ Map[Count[p, #]! &, Range[Total[p]]])
g[c_, k_] := Times @@ Flatten[Table[2^(c[[i]]*k[[j]]/LCM[c[[i]], k[[j]]]), {i, 1, Length[c]}, {j, 1, Length[k]}]]
flip[c_, k_] := Flatten[Table[If[col == i, LCM[c[[i]], k[[j]]]/c[[i]], If[col == Length[c] + j, LCM[c[[i]], k[[j]]]/k[[j]], 0]], {i, 1, Length[c]}, {j, 1, Length[k]}, {col, 1, Length[c] + Length[k]}], 1]
h[c_, k_] := 2^(2 n - MatrixRank[flip[c, k], Modulus -> 2])
ans = Total[Map[c[#[[1]]]*c[#[[2]]]*h[#[[1]], #[[2]]]*g[#[[1]], #[[2]]] &, cycles]] / (n!*2^n)^2


ultmaster's comment: 本题最难的地方在于把两种变换拆开算，最后乘到一起。这里面的不动点计数逻辑还是比较复杂的。

## Problem G

Upsolved by zerol.

## Problem I

Solved by zerol. 03:37 (+1)

## Problem J

Solved by kblack. 00:33 (+1)

## Problem K

Solved by ultmaster. 04:56 (+4)

## Problem L

Upsolved by kblack. (-5)