本月博客排行
-
第1名
kaizi1992 -
第2名
arpenker -
第3名
wy_19921005 - hanbaohong
- jh108020
年度博客排行
-
第1名
龙儿筝 -
第2名
宏天软件 -
第3名
青否云后端云 - vipbooks
- wy_19921005
- benladeng5225
- fantaxy025025
- e_e
- kaizi1992
- tanling8334
- arpenker
- sam123456gz
- javashop
- zysnba
- xiangjie88
- lemonhandsome
- wallimn
- ganxueyun
- Xeden
- xyuma
- zhanjia
- wangchen.ily
- jh108020
- johnsmith9th
- zxq_2017
- jbosscn
- forestqqqq
- daizj
- ajinn
- xpenxpen
- ranbuijj
- 喧嚣求静
- kingwell.leng
- silverend
- kristy_yy
- lchb139128
- jveqi
- lich0079
- lzyfn123
- java-007
- sunj
- yeluowuhen
- lerf
- xiaoxinye
- flashsing123
- zhangjijun
- lxguy
- bosschen
- lyndon.lin
- sunnylocus
最新文章列表
Range Sum Query - Mutable
Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.
The update(i, val) function modifies nums by updating the element at index i to val.
Example:
Give ...
poj2886Who Gets the Most Candies?
个人觉得从一个位置下一个位置是关键,然后用树状数组就简单了。
之前举例子推推导公式时只用一个参数,一直凑不出来,后来用两个参数,一个是这列数中原来的位置,另一个是前一个位置的人跳出后,下一个人的前面和自己一共的人数。我用d表示前一个参数,k表示后一个参数。
这一题还学到反素数,真是很有用的东西。
反素数打表就行,然后线段树+二分, 还有我改得最多的main()函数:
...
【树状数组+二维】杭电 hdu 1892 See you~
/* THE PROGRAM IS MADE BY PYY */
/*----------------------------------------------------------------------------//
Copyright (c) 2012 panyanyany All rights reserved.
URL : http://ac ...
【树状数组+三维】杭电 hdu 3584 Cube
/* THE PROGRAM IS MADE BY PYY */
/*----------------------------------------------------------------------------//
Copyright (c) 2012 panyanyany All rights reserved.
URL : http://acm. ...
c/c++树状数组
今天在看程序竞赛的书,看到一段代码,是说树状数组的,书上讲得不怎么清楚,
自己也不是很理解,只知道可以这样用,但怎么构造成一个树就不是很明白了,希望大家指点一下。
数组:c[MAX];
函数:lowbit(int),insert(int),getsum(int);
代码如下:
#include <iostream>
#include <cstri ...
【树状数组+简单题】杭电 hdu 2689 Sort it
/* THE PROGRAM IS
MADE BY PYY */
/*----------------------------------------------------------------------------//
Copyright (c) 2011 panyanyany All rights
reserved.
URL : http://a ...
PKU 2352 Stars
Stars
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 18171
Accepted: 7918
Description
Astronomers often examine star maps where stars are represented by points on ...