上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页
摘要: In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swap... 阅读全文
posted @ 2018-08-14 13:12 Fly_White 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 树状数组模板://Cnt为数组的界//cnt[i]为编号或者数值上小于id的数量void Update(LL Id){ while(Id0) { ans+=cnt[Id]; Id-=lowbit(Id); } return ans;}离散化//arr为保存原数据的... 阅读全文
posted @ 2018-08-14 12:58 Fly_White 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 二维平面上N个点之间共有C(n,2)条连线。求这C(n,2)条线中斜率小于0的线的数量。二维平面上的一个点,根据对应的X Y坐标可以表示为(X,Y)。例如:(2,3) (3,4) (1,5) (4,6),其中(1,5)同(2,3)(3,4)的连线斜率 #include... 阅读全文
posted @ 2018-08-14 12:48 Fly_White 阅读(168) 评论(0) 推荐(0) 编辑
摘要: A new form of life is recently discovered on Mars. Every alien has a DNA, that is a string with an alphabet of only two, rather than f... 阅读全文
posted @ 2018-08-12 11:19 Fly_White 阅读(151) 评论(0) 推荐(0) 编辑
摘要: A supermarket in Tehran is open 24 hours a day every day and needs a number of cashiers to fit its need. The supermarket manager has h... 阅读全文
posted @ 2018-08-09 21:58 Fly_White 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 杭州有N个景区,景区之间有一些双向的路来连接,现在8600想找一条旅游路线,这个路线从A点出发并且最后回到A点,假设经过的路线为V1,V2,....VK,V1,那么必须满足K>2,就是说至除了出发点以外至少要经过2个其他不同的景区,而且不能重复经过同一个景区。现在86... 阅读全文
posted @ 2018-08-08 08:43 Fly_White 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Weiwei is a software engineer of ShiningSoft. He has just excellently fulfilled a software project with his fellow workers. His boss i... 阅读全文
posted @ 2018-08-07 22:15 Fly_White 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗? Input输入包括多组数据。每组数据第一行是两个整数N、... 阅读全文
posted @ 2018-08-07 22:13 Fly_White 阅读(151) 评论(0) 推荐(0) 编辑
摘要: The Suspects UVA - 1197 并查集模板题,记得维护一下并查集的大小就好代码:#include#include#include#include#include#include#include#include#include#include#inclu... 阅读全文
posted @ 2018-08-06 20:27 Fly_White 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 给出n个点将他们连成最小生成树,给出k个卫星,有了这些卫星就可以无代价地连接一些边。求出在此条件下的最长的边也就是求出最小生成树的第k小条边考虑到这个图的边比较多,选择使用prim算法,需要注意的是,先生成的边不一定小,后生成的边也不一定大代码:#include#in... 阅读全文
posted @ 2018-08-06 20:12 Fly_White 阅读(108) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页