树状数组
Zhangcan233
这个作者很懒,什么都没留下…
展开
-
D - 斜率小于0的连线数量 51Nod - 1107
题目:二维平面上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)的连线斜率 < 0,因此斜率小于0的连线数量为2。 Input 第1行:1个数N,N为点的数量(0 <= N <= 50000) 第2 - N原创 2017-08-16 11:12:25 · 322 阅读 · 0 评论 -
F - Matrix Sum HihoCoder - 1336
题目:You are given an N × N matrix. At the beginning every element is 0. Write a program supporting 2 operations:Add x y value: Add value to the element Axy. (Subscripts starts from 0Sum x1 y1 x2 y1: Re原创 2017-08-16 16:04:51 · 296 阅读 · 0 评论 -
poj2299 B - Ultra-QuickSort(线段树与树状数组求逆序对数)
题目:In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the sequence原创 2017-08-13 23:16:07 · 509 阅读 · 0 评论 -
hdu1556 D - Color the ball
题目:N个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a <= b),lele便为骑上他的“小飞鸽"牌电动车从气球a开始到气球b依次给每个气球涂一次颜色。但是N次以后lele已经忘记了第I个气球已经涂过几次颜色了,你能帮他算出每个气球被涂过几次颜色吗?Input每个测试实例第一行为一个整数N,(N 当N = 0,输入结束。Output每个测试实例输出一原创 2017-08-13 23:55:43 · 267 阅读 · 0 评论