摘要:
A. Equator Polycarp has created his own training plan to prepare for the programming contests. He will train for nn days, all days are numbered from 1 阅读全文
摘要:
Description You are working for Macrohard company in data structures department. After failing your previous task about key insertion you were asked t 阅读全文
摘要:
题解:~~~~不太好想,用线段树记录区间内的最大值和最小值,什么是最大值?当两条线段相交但不包含的时候,len=l2+r2-(l1+r1),所以最大值是指区间内所有线段左右端点之和 的最大值。同理,当两条线段相交但是包含得时候,len=r1-l1-(r2-l2),所以最小值是指区间内所有线段长度的最 阅读全文
摘要:
Connected undirected weighted graph without self-loops and multiple edges is given. Graph contains n vertices and m edges. For each edge (u, v) find t 阅读全文
摘要:
A-n的约数 B-区间的连续段 题解:用ST表记录当前起点i跳2^j次能到达的位置,然后从大到小(当前查找的区间最长)查找就行了。 感受:看到网上题解说用ST表,蒙着脑袋就开始写了,结果。。。存错对象了。死活写不出来,orzzzzz。这里ST表存的是以当前结点为左端点,不满足区间和小于或等于k的第一 阅读全文
摘要:
A. Tritonic Iridescence 题解:分类讨论。注意题目要求,至少有两种方案。 B. Mystical Mosaic 题解:对于同一列的"#"所在行应该是对称的。 C. Three-level Laser 题解:分析式子,当 Ej 选定后,i=j-1,所以只需要考虑 Ek ,显然 k 阅读全文
摘要:
Description A rooted tree is a well-known data structure in computer science and engineering. An example is shown below: In the figure, each node is l 阅读全文
摘要:
C.平分游戏 D.psd面试 感受:dp还是不会,虽然这是最简单的dp。。。。。 E.回旋星空 题解:枚举中间的那个点,分别计算其它点到这个点的距离,再排序。那么相同距离的就会排在一起。 感受:想到了枚举中间点,但算错了复杂度。。。。 F.等式 题解:假设x=n+a,y=n+b;代入方程得:n*n= 阅读全文
摘要:
A. Feed the cat After waking up at hh:mm, Andrew realised that he had forgotten to feed his only cat for yet another time (guess why there's only one 阅读全文
摘要:
A. Diagonal Walking Mikhail walks on a 2D plane. He can go either up or right. You are given a sequence of Mikhail's moves. He thinks that this sequen 阅读全文