摘要: You are working for Macrohard company in data structures department. After failing your previous task about key insertion you were asked to write a new data structure that would be able to return quickly k-th order statistics in the array segment. 阅读全文
posted @ 2016-10-16 20:39 ZegWe 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 艾莎女王又开始用冰雪魔法盖宫殿了。 她决定先造一堵墙,于是释放魔法让形为直角梯形的冰砖从天而降,定入冻土之中。 现在你将回答女王的询问:某段冻土上冰砖的面积。 注:多块冰砖之间会互相重叠,重叠部分要多次计算。 阅读全文
posted @ 2016-10-13 20:43 ZegWe 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 每一头牛的愿望就是变成一头最受欢迎的牛。现在有N头牛,给你M对整数(A,B),表示牛A认为牛B受欢迎。 这 种关系是具有传递性的,如果A认为B受欢迎,B认为C受欢迎,那么牛A也认为牛C受欢迎。你的任务是求出有多少头 牛被所有的牛认为是受欢迎的。 阅读全文
posted @ 2016-10-13 17:18 ZegWe 阅读(209) 评论(0) 推荐(0) 编辑
摘要: There are n students in a class working on group projects. The students will divide into groups (some students may be in groups alone), work on their independent pieces, and then discuss the results together. It takes the i-th student ai minutes to finish his/her independent piece. 阅读全文
posted @ 2016-10-12 14:59 ZegWe 阅读(258) 评论(0) 推荐(0) 编辑
摘要: 八数码是一道很经典的搜索题,普通的bfs就可求出。为了优化效率,我曾经用过康托展开来优化空间,甚至还用过A*来优化时间。不过这道题懒得写了,就一个普普通通的bfs,再加上一个stl 的map就水过了。 阅读全文
posted @ 2016-10-08 22:19 ZegWe 阅读(339) 评论(0) 推荐(0) 编辑
摘要: 大家好,我是XXX——自己猜(雾,是一名高中在校学生,自从高一接触到信息学竞赛后,我就被这门充满朝气,前途光明的竞赛科目深深地吸引住了。一年多来,我写了无数代码,学习了无数的知识,这些都是在常规课堂上无法了解的。我十分感谢引我进门的教练们,感谢在我身旁和我一同努力的同学。即使头顶着烈日,亦或是暴风雨,即使浑身伤痕,前途永远是一片光明。 阅读全文
posted @ 2016-09-20 17:17 ZegWe 阅读(291) 评论(1) 推荐(1) 编辑