摘要: Description Give a tree with n vertices,each edge has a length(positive integer less than 1001). Define dist(u,v)=The min distance between node u and 阅读全文
posted @ 2017-03-11 23:08 Robin! 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Treap(树堆)的大部分功能STL的set都可以实现,但因为set的过度封装使得某些特定的功能不能实现,比如求第k大的值。 Code: 阅读全文
posted @ 2017-03-11 18:03 Robin! 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Problem Description 吉哥又想出了一个新的完美队形游戏! 假设有n个人按顺序站在他的面前,他们的身高分别是h[1], h[2] ... h[n],吉哥希望从中挑出一些人,让这些人形成一个新的队形,新的队形若满足以下三点要求,则就是新的完美队形: 1、挑出的人保持原队形的相对顺序不变 阅读全文
posted @ 2017-03-11 13:47 Robin! 阅读(157) 评论(0) 推荐(0) 编辑