problem1 link 对于每个还未切掉的‘X’用cutter作用一次.从左上角到右下角,依次判断即可. problem2 link 首先,如果一个顶点不能从0到达或者不能到达节点$n-1$,那么可以直接将这个顶点从图中删掉.所以,可以认为每个顶点都可以从节点0到达且可以到达节点$n-1$. 按照如下策略进行路径选择: (1)设初始时已访问节点集合$S$只包含节点0: (2)对于$[1,n-2]$中的每个节点,找到一个节点$t$,满足在$S$中存在一个节点$r$,使得$r$->$t$有一条直…
problem1 link 倒着想.每次添加一个右括号再添加一个左括号,直到还原.那么每次的右括号的选择范围为当前左括号后面的右括号减去后面已经使用的右括号. problem2 link 令$h(x)=\sum_{i=1}^{x}g(i)$,那么答案为$h(R)-h(L-1)$.对于$h(x)$: (1)如果$x\leq K$,那么$h(x)=0$ (2)否则对于$[K+1,x]$之间的所有偶数来说,对答案的贡献为$even+h(\frac{x}{2})-h(\frac{K}{2})$,其中$e…
Problem Statement You are given the ints perimeter and area. Your task is to find a triangle with the following properties: The coordinates of each vertex are integers between 0 and 3000, inclusive. The perimeter of the triangle must be exactly…
Problem Statement The Happy Letter game is played as follows: At the beginning, several players enter the field. Each player has a lowercase English letter on their back. The game is played in turns. In each turn, you select two players with dif…