摘要:
##Problem A 不开ll见祖宗 ##Problem B 要求长度小于等于2n那么,我们贪心的情况下肯定选择最多的那个,然后直接补,这个长度一定不会超过2n,所以直接输出就好了,循环k值在不是一的情况下一定可以被补成2. #include<cstdio> #include<algorithm> 阅读全文
摘要:
##Problem A 要求从三个数组中每个位置取一个数字,构成一个相同长度的数组,要求相邻的不相等(环形),那么我们直接暴力选,记录当前不能取的值就可以了,然后要记得特判一下首位的两个元素。 ##Problem B 首先通过模拟样例我们发现相同的元素其实是一点用都没有的,所以我们先去重了再说,然后 阅读全文
摘要:
##Problem A 模拟即可 ##Problem B 由题可知每一个点都在以一个点为圆心,固定距离为半径的圆周上运动,那么要距离最小,直觉告诉我们是在同一条直线上,且位于同侧,但是看数据量发现,直接计算会炸时间,那么我们可以看看,一个距离在总和中有多少贡献,然后公式计算一下,可以优化到常数的时间 阅读全文
摘要:
##题面 In the figure, each node is labeled with an integer from {1, 2,...,16}. Node 8 is the root of the tree. Node x is an ancestor of node y if node x 阅读全文
摘要:
##题目 Description There are n planets in the planetary system of star X. They orbit star X in circular orbits located in the same plane. Their tangent 阅读全文
摘要:
##题目 Now it's time for lunch. Today's menu is chocolate! Though every baby likes chocolate, the appetites of babies are little. After lunch, there are 阅读全文
摘要:
##题目 There are n beautiful skyscrapers in New York, the height of the i-th one is hi. Today some villains have set on fire first n−1 of them, and now 阅读全文
摘要:
##Problem B emmm,我们肯定想让尽可能多的正数去消掉后面的负数,所以我们累加一个前缀和,如果这个前缀和当前元素为负数,表示前面的所有元素不需要花费代价的操作进行后,还剩余这些数量,需要花费代价去清除,那么我们就对这个前缀和数组里面的负数取一个最小值就好了。 ##Problem C 简单 阅读全文