E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
1166
HDU
1166
敌兵布阵 (树状数组)
pid=
1166
敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768
·
2015-11-11 16:24
树状数组
HDU
1166
敌兵布阵
(更新点查询区间) 好吧,今天算是被这道题坑惨了,TLE了许久,结果发现原来就是用了一个cout的原因。。改成printf后一下就过了,而且时间一下缩短数倍。。俗话说,吃一堑,长一智,,我算是长记性了。。 代码: #include <iostream> #include <cstdio> #include <cstring
·
2015-11-11 16:33
HDU
hdu 1754 I Hate It (线段树 单点更新)
pid=1754 照着hdu
1166
的模板稍加改动即可 #include<cstdio> #include<cstring> #include<
·
2015-11-11 16:27
HDU
hdu
1166
敌兵布阵(线段树)
pid=
1166
View Code 1 #include<stdio.h> 2 #include<string.h> 3 int sum[1000001]
·
2015-11-11 16:09
HDU
hdu
1166
树状数组
不知道为什么用C++输入输出死活不过,换成C的就过了。。。 #include <stdio.h> #include <string.h> //============================== #define maxn 50020 int c[maxn]; int a[maxn]; int n; int t; int lowbit(i
·
2015-11-11 16:37
树状数组
FZU 1894 (双端队列)
Problem 1894 志愿者选拔 Accept:
1166
Submit: 3683 Time Limit: 1500 mSec  
·
2015-11-11 15:55
队列
HDU
1166
敌兵布阵 我的第一棵树,线段树,树状数组。
敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12032 Accepted Submission(s): 5237 Problem Des
·
2015-11-11 15:09
树状数组
HDU
1166
敌兵布阵(第一个线段树)
题目链接 这个题,用完树状数组,再用线段树水过。线段树,却是感觉比树状数组的功能强多了。只要把线段树的思想理解,然后把实现过程,递归过程了解,单点更新就没问题了。 #include <stdio.h> #include <string.h> #include <stdlib.h> #define N 50001 struct node {
·
2015-11-11 15:10
HDU
hdu
1166
赤裸裸的树状数组
题目没啥说的,赤裸裸的树状数组 /* * hdu
1166
/win.cpp * Created on: 2011-9-6 * Author : ben */#include <cstdio
·
2015-11-11 15:29
树状数组
A - 敌兵布阵 (线段树)
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU
1166
·
2015-11-11 12:51
线段树
线段树(单点更新)/树状数组 HDOJ
1166
敌兵布阵
题目传送门 1 /* 2 线段树基本功能:区间值的和,修改某个值 3 */ 4 #include <cstdio> 5 #include <cstring> 6 #define lson l, m, rt << 1 7 #define rson m+1, r, rt << 1|1 8 9 const int M
·
2015-11-11 12:18
树状数组
【HDU
1166
】敌兵布阵(树状数组或线段树)
是一道树状数组的裸题,也可以说是线段树的对于单点维护的裸题。多做这种题目可以提高自己对基础知识的理解程度,很经典。 1 #include <iostream> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cstdio> 5 #include <
·
2015-11-11 12:01
树状数组
HDU
1166
- 敌兵布阵
题目大意 给定N个数,可以对这些数进行三种操作: 1、Add(i,x),对第i个数增加x 2、Sub(i,x),对第i个数减x 3、Query(x,y) ,查询区间[x,y]的和 题解 赤裸裸的树状数组啊。。。我还二逼得WA了两次,原因是读入字符串的时候用的while(cin>>s),然后就一直不能退出循环了,不知道为啥会这样。。。换成C语言风格的字符串,然后用scanf读入
·
2015-11-11 12:32
HDU
hdu
1166
敌兵布阵
第一个线段树,参考别人代码 #include<iostream> #include<cctype> #include<cstdlib> #include<cstring> #include<cstdio> using namespace std; const int MAXN = 55555; int sum[MAX
·
2015-11-11 11:58
HDU
HDU
1166
敌兵布阵(第一个树状数组)
题目链接 以前用普通方法150+ms 今天看了书上有这个题的详细树状数组的代码,理解下,敲敲交上居然300ms+,我正纳闷的时候,交上以前的代码TLE了。。 1 #include <stdio.h> 2 #include <string.h> 3 #define N 50005 4 int p[N],n;//p[i] 就代表从i - i&(-i)
·
2015-11-11 10:35
树状数组
线段树简析
线段树资料:http://dongxicheng.org/structure/segment-tree/ PS: 以HDU
1166
为例 线段树的使用一般分如下几个操作 建树 插入 查询
·
2015-11-11 10:05
线段树
HDU
1166
敌兵布阵 (线段树 & 树状数组)
pid=
1166
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/
·
2015-11-11 09:56
树状数组
HDOJ
1166
HDU
1166
敌兵布阵 ACM
1166
IN HDU
MiYu原创, 转帖请注明 : 转载自 ______________白白の屋 先前做了这一题, 不过是用 树状数组做的, 对于这一类型的题目也来说非常方便快捷. 具体地址 : http://www.cnblogs.com/MiYu/archive/2010/08/25/1808441.html
·
2015-11-11 07:54
ACM
HDOJ
1166
HDU
1166
敌兵布阵 ACM
1166
IN HDU
pid=
1166
题目描述: 敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) &nb
·
2015-11-11 07:39
ACM
HDOJ
1166
敌兵布阵
线段树的入门题,数组代替树; 线段树是一种完全二叉树,主要操作有建树、修改节点、区间询问(最大值或者和等),由于采用二叉树结构,对一个结点的操作复杂为 logn; 这里建树、修改和询问操作没有采用递归方式,主要是利用了线段树也是完全二叉树的特点,因此可以直接根据要查看节点的编号(1..n)求得其对应在树中的编号,就可以直接进行操作,而不需要递归来实现。 # include <stdi
·
2015-11-11 07:43
OJ
[HDU]
1166
敌兵布阵 [线段树]
敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 46267 Accepted Submission(s): 19644 Problem De
·
2015-11-11 05:15
HDU
线段树(单点更新)HDU
1166
、HDU1742
今天AC一题感觉都很累,可能是状态不佳,在做HDU
1166
这题目时候,RE了无数次。 原因是:我的宏定义写错了,我已经不是第一犯这种错误了!
·
2015-11-11 02:49
HDU
HDU
1166
——敌兵布阵——————【线段树单点增减、区间求和】
nbsp; 64bit IO Format:%I64d & %I64u Submit Status Practice HDU
1166
·
2015-11-11 02:23
HDU
hdu
1166
敌兵布阵 (树状数组)
1 #include<stdio.h> 2 #include<string.h> 3 #define N 600000 4 int n; 5 int a[N],c[N]; 6 int lowbit(int x) 7 { 8 return x&(-x); 9 } 10 int sum(int k) 11 { 12
·
2015-11-11 01:42
树状数组
hdu
1166
敌兵布阵
敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 32178 Accepted Submission(s): 13823
·
2015-11-09 14:51
HDU
hdu
1166
敌兵布阵(线段树单点更新)
题意:单点更新线段树,求区间和。线段树:http://blog.csdn.net/metalseed/article/details/8039326#include #include #defineM50005 #definelsonl,m,rt>1; Build(lson); Build(rson); PushPlus(rt); } voidUpdata(intp,intadd,intl,
u014552756
·
2015-11-08 17:00
【HDU】
1166
敌兵布阵
1 #include<cstdio> 2 #include<cstring> 3 #define MAXN 50010 4 int tree[MAXN<<2]; 5 inline void PushUp(int rt) 6 { 7 tree[rt]=tree[rt<<1]+tree[rt<<1|1];
·
2015-11-08 17:07
HDU
1166
1 #include<iostream> 2 using namespace std ; 3 int gcd(int a,int b) 4 { 5 if(a%b!=0) 6 return gcd(b,a%b); 7 else 8 return b ; 9 } 10 int main() {
·
2015-11-08 15:09
HDU
1166
(中文题意) 线段树水题。我写的第一个线段树。 re是因为数组开小了。线段树的数组下次开3*n,而不是2*n。 #include<iostream> #include<stdio.h> using namespace std; int n,tar,val,ans; bool ok; struct tr { int l,r,num; }; i
·
2015-11-08 15:22
HDU
线段树
hdu
1166
敌兵布阵 很基础的题目~,就只有建树~更新点~和询问~。。。。。。
·
2015-11-08 15:00
线段树
hdu
1166
敌兵布阵
线段树最简单的题目:区间求和,修改单点数值,中文题目就不说题意了 今天看了神牛的代码感慨良多,写代码像写诗一样 感觉自己的代码就是写得太累赘 下次线段树要加大难度了 #include <cstdio> #include <cstring> #define N 50010 struct node { int a,b; int sum;
·
2015-11-08 14:12
HDU
线段树
HDU
1166
敌兵步阵 #include <iostream> #include <cstdio> #include <string> #include
·
2015-11-08 14:46
线段树
线段树(单点更新,区间求和)
hdu
1166
敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768
·
2015-11-08 14:51
线段树
【总结】线段树
【HDU】
1166
敌兵布阵 【HDU】1754 I Hate It 【POJ】3264 Balanced Lineup &
·
2015-11-07 15:47
线段树
HDU
1166
敌兵布阵
敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15926 Accepted Submission(s): 6983 Problem Des
·
2015-11-07 15:38
HDU
浏览器并发处理请求个数一览表
版本 HTTP1.0 HTTP1.1IE6\742IE866IE91010IE1066IE
1166
chrome66firefox66
guogang83
·
2015-11-05 08:00
HDU
1166
敌兵布阵【线段树 单点更新】
题意:给出n个数,a1,a2,a3,,,,,an,再给出一些操作 add i j 表示给第i个节点增加j sub i j 表示给第i个节点减少j query i j 表示询问第i个节点到第j个节点的和 套的别人的模板写的---还是要再多自己写写的说------- 1 #include<iostream> 2 #in
·
2015-11-03 21:46
HDU
简单单点更新线段树
简单线段树 hdu
1166
1 #include<stdio.h> 2 #define lson l,m,rt<<1 3 #define rson
·
2015-11-03 21:51
线段树
Manecher算法
http://hi.baidu.com/735612658gfy/blog/item/f88114d526dc39bdcc
1166
db.html http://acm.uestc.edu.cn/bbs
·
2015-11-03 21:47
ANE
高铁运营数据积累
2004年国务院批准的《武广铁路客运专线可行性报告》中,武广高铁建设成本应为930亿元,但随后,由于拆迁、原材料和人力价格等因素,到了武广高铁前期筹备协调会议上,投资额涨到
1166
亿元,最终实
·
2015-11-02 19:42
数据
HDU
1166
敌兵布阵
该题可以用树状数组也可以用线段数; 树状数组:#include<stdio.h>#include<stdlib.h>#include<string.h>int c[50024],sum[50024],N;int lowbit(int x){ return x&(-x); }int SUM(int n){ int sum=0;
·
2015-11-02 18:41
HDU
线段树练习——单点更新(一)
hdu
1166
http://acm.hdu.edu.cn/showproblem.php?
·
2015-11-02 11:59
线段树
HDU
1166
敌兵布阵 线段树的基本应用——动态区间和问题
pid=
1166
简单题,1A了,这个好像就是传说中的“点树”。
·
2015-11-02 11:37
HDU
hdu
1166
敌兵布阵(线段树)
pid=
1166
敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768
·
2015-11-02 10:59
HDU
线段树专辑——hdu
1166
敌兵布阵
pid=
1166
这是一道线段树的基础入门题,题目中的所有跟新操作都是对点进行的,也即无需任何lazy标记传递信息。
·
2015-11-02 09:09
HDU
HDU
1166
敌兵布阵 (线段树)
敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 54737 Accepted Submission(s): 22959 Problem De
·
2015-11-01 16:42
HDU
HDU
1166
敌兵布阵
Original ID:
1166
64-bit integer IO format: %I64d Java class
·
2015-11-01 15:54
HDU
简单线段树中的一系列题目
1.HDU
1166
http://acm.hdu.edu.cn/showproblem.php?
·
2015-11-01 14:41
线段树
hdu
1166
线段树单点更新
等线段树复习完再做个总结 1101 2 3 4 5 6 7 8 9 10Query 1 3Add 3 6Query 2 7Sub 10 2Add 6 3Query 3 10EndCase 1:63359 2015-05-15: 1 #include<cstdio> 2 #include<iostream> 3 #include<algorith
·
2015-11-01 11:48
HDU
【ACM】hud
1166
敌兵布阵(线段树)
经验: cout 特别慢 如果要求速度 全部用 printf !!! 在学习线段树 内容来自:http://www.cnblogs.com/shuaiwhu/archive/2012/04/22/2464583.html 作者Microgoogle 线段树在一些acm题目中经常见到,这种数据结构主要应用在计算几何和地理信息系统中。下图就为一个线段树: (PS:可能
·
2015-11-01 08:47
ACM
上一页
8
9
10
11
12
13
14
15
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他