8.7 summary

8.7 summary

Score

100+100+80

Rank 1~~

The third question can be a lot of water points ah

NOIP true simulation environment

T1

Subject to the effect

For 30% of the data, n≤10000.

For the other 20% of data, bi = 1, n≤1000000.

For the other 20% of the data, f [1] ... f [k-1] = 1.

For the other 20% of the data, k≤30.

To 100% of the data, 1≤k≤200,1≤n≤40000000,1≤bi, fi≤998244352.

When the game like a long time, after playing out a positive solution but felt run, but it sucked oxygen. Later we found that there is a positive solution.

Correct

Obviously, the answer is the product of f [1 ~ k] of a certain power, i.e.,

\(ans=\Pi f[i]^{c[i]}|1\leq i \leq k\)

The key to how demand c [i]. Obviously optimize recursive matrix multiplication. Seeking separate each c [i], but the transition matrix is ​​the same. After building the transition matrix of nk power you can order c [i] a.

Time complexity O ( \ (k ^ 3logn \) ), open to over-O3

T2

Subject to the effect

Given n intervals, m points. If an interval contains a point that they can be paired. Seeking the maximum number of matches.

I think it is also very good.

Correct

greedy.

Obviously, the tap horizontal axis from small to large, to a point, that it contains the right end of the range to match its leftmost point is optimal. Get 70 points

Out, we want to maintain the collection interval containing the current point, but also to find the right point of the smallest one. Easy to think of a stack to keep open. The range of the left endpoint from small to large, maintain a pointer to the new interval containing the current point thrown into the pile. 100 get.

T3

Subject to the effect

N has an unrooted tree nodes, wherein the given point m of <x, y>. I asked how many simple path tree <u, v> does not exist on the path to meet any given pair of points of <x, y>.
Here we consider the path <u, v> and <v, u> is the same. For the given point and the title of <x, y> satisfies x! = Y, the path <u, v> you want to count satisfies u! = V (i.e., not a single point answer).

Fucks took 80 minutes. Only that kind of chrysanthemum Figure did not score points.

Correct

首先,这道题如果完全不会正解也是可以通过乱搞拿90分的。说一下菊花图怎么搞。有点对(1,x)时相当于删除x点,有点对(x,y)时答案只会减一。当然还要去重。

正解是求dfs序把树上问题转化为区间问题。

把dfs序求出来之后,有点对(x,y)时相当于把一个(或两个)平面上的矩形个禁掉了。分类讨论。

题目就转化为求矩形面积并。用线段树解决。每个线段树上的节点记录两个值bz被标记过几次和sum这个区间有多少个可用点。由于只用查询根节点,删除时是从加入时的对应区间删,所以很好做。不用下传标记。

小结

  1. 永远重视部分分,NOIP总是会给很多奇怪的部分分,拿三题的大量部分分比死刚两道题的正解要安全的多。
  2. 时间安排要有计划性,什么是时候做什么事,该换题就该换,不要优柔寡断导致全盘皆输

Guess you like

Origin www.cnblogs.com/leason-lyx/p/11323377.html