摘要:
Link. Codeforces Luogu Description. 给定序列 \(\{a_i\}\),求有多少个排列是好的。 一个排列 \(\{p_i\}\) 是好的,当且仅当 \(\forall i\in[2,n],a_{p_{i-1}}\times a_{p_i}\) 是完全平方数。 Sol 阅读全文
摘要:
Link. Luogu Codeforces Description. 称一个数列 \(\{a_i\}\) 是好的,当且仅当 \(\exists \{b_i\}\),满足 \(\forall i\in[1,n],b_i\ge 0\) \(\{a_i+b_i\}\) 是个排列。 一个数列的权值是所有数 阅读全文