【题解】CCPC Wannafly Camp Day5

Note: Some problems have been weakened.

A、 Alternative Accounts

There are at most contest. We consider the hardest case that . For each account, we
compute the set of contests it participated in.
Let be the number of accounts whose participated contest is set .
It is easy to see for an account that participated in the contests , it can't participate other contests.
For an account that participated in the contest , it can match with an account that only participated in the contest . It's the same for and .
For the remaining account, we need peoples.

B、 Bitset Master

First, let's see how to compute the size of . When two sets and merge, the size becomes. We can see is exactly the set when these two sets merged last time. So we can compute it in .
For the original problem, we can solve the problem backward. The meaning of the set
becomes which vertices that can reach.

C、 Self-Adjusting Segment Tree

For a query and a vertex on the segment tree

  • If intersects with and is not included in , it will contribute to the number of visited vertices by .
  • If is included in and , it will contribute to the number of visited vertices by .
  • If is included in and , it will contribute to the number of visited vertices by .
    Thus the contribution of a vertex only depends on the vertex ifself now, instead of the structure of the tree (whether its father is included in ).
    We can use the partial sum technique to compute the contribute of each pair , denoted as .
    Let be the minimum total contributition of a subtree with the root ,

D、 Circle Union

Recall the circle union algorithm, we need to find the border of the circle and find the answer.
In this problem, we can easily solve it in a similar way. For each piece of arcs on the circle, we just simply compute the probability that it's on the border and contribute it to the answer.

E、 Matching Problem

We can enumerate first elements in and calculate the fourth element in .

F、 Inversion Pairs

Let be the number of permutations with elements and inverse pairs,
The answer . We can compute first terms in .
We can prove sequence is a polynomial, thus we can compute first terms and find -th term by interpolation.
However, CaiDui said is a linear recurrence sequence, we can solve it by BerlekampMassey algorithm.

G、 Cryptographically Secure PRNG

We can regard the modulo inverse as a random sequence. If we compute the first term and the minimum value can become . Thus for the remaining term, we can enumerate the value and compute the position of the value to see if it is the minimum. The expected time complexity is .

H、 Geometry PTSD

First, let's see how to compute the distance from to plane . We can compute the volume of by the determinant. Then we have , where is the area of triangle , which can be computed stably.
Then we can try some constructions and test locally. One intuitive way is that find an equilateral triangle and make some numerical perturbations.
图片说明

I、 Practice for KD Tree

is small, we can compute the entire matrix in . Then find the maximum by 2d segment tree.

J、Xor on Figures

We need to find the rank of binary vectors. It can be solved in by Gaussian elimination and bitset.

全部评论
F题怎么证明f[i]/i!是个2k次多项式啊?
点赞 回复 分享
发布于 2020-02-18 17:33

相关推荐

找工作勤劳小蜜蜂:自我描述部分太差,完全看不出想从事什么行业什么岗位,也看不出想在哪个地区发展,这样 会让HR很犹豫,从而把你简历否决掉。现在企业都很注重员工稳定性和专注性,特别对于热爱本行业的员工。 你实习的工作又太传统的it开发(老旧),这部分公司已经趋于被淘汰,新兴的互联网服务业,比如物流,电商,新传媒,游戏开发和传统的It开发有天然区别。不是说传统It开发不行,而是就业岗位太少,基本趋于饱和,很多老骨头还能坚持,不需要新血液。 工作区域(比如长三角,珠三角,成渝)等也是HR考虑的因素之一,也是要你有个坚定的决心。否则去几天,人跑了,HR会被用人单位骂死。
点赞 评论 收藏
分享
情绪y:不是,王者的数据工程都进了,校招怎么会失败呢
点赞 评论 收藏
分享
评论
4
1
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务