随笔分类 - 思维题
摘要:Consider a un rooted tree T which is not the biological significance of tree or plant, but a tree as an undirected graph in graph theory with n nodes,
阅读全文
摘要:There are n banks in the city where Vasya lives, they are located in a circle, such that any two banks are neighbouring if their indices differ by no
阅读全文
摘要:有N个岛连在一起形成了一个大的岛屿,如果海平面上升超过某些岛的高度时,则这个岛会被淹没。原本的大岛屿则会分为多个小岛屿,如果海平面一直上升,则所有岛都会被淹没在水下。 给出N个岛的高度。然后有Q个查询,每个查询给出一个海平面的高度H,问当海平面高度达到H时,海上共有多少个岛屿。例如: 岛屿的高度为:
阅读全文
摘要:时间限制:1秒 空间限制:32768K 时间限制:1秒 空间限制:32768K 度度熊有一个N个数的数组,他想将数组从小到大 排好序,但是萌萌的度度熊只会下面这个操作:任取数组中的一个数然后将它放置在数组的最后一个位置。问最少操作多少次可以使得数组从小到大有序? 输入描述: 首先输入一个正整数N,接
阅读全文