题意:
先给出一个数组,然后有两个操作
S x y 把第x个数改成y
M x y计算x~y个数的和
思路:
普通的树状数组,但不知道为什么会莫名其妙的一直WA
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#inclu...
分类:
编程语言 时间:
2015-06-19 00:04:07
阅读次数:
171
一开始块排敲错两次 1 program hehe; 2 var 3 t,n,m,i,j,k:longint; 4 c:array[0..1000000] of longint; 5 pre,next,a,x:array[0..50005] of longint; 6 ans,p,z,y:ar...
分类:
编程语言 时间:
2015-06-18 21:46:33
阅读次数:
133
D. Pashmak and Parmida's problem
time limit per test
3 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Parmida is a clever girl and she w...
分类:
编程语言 时间:
2015-06-18 19:56:26
阅读次数:
120
字典树,是一种存取字符串的树状存储结构,以字符串的每一个字符为结点,不断扩展。从根节点到叶子结点,途中经过的结点的值连接起来就是该字符串。该存储方式可以有效的减少空间的浪费,有很多字符串可以公用一些结点,减少了空间上的开支。在查找的时候也比较方便,若查询到某一个字符时,该结点不存在,那么该字符串必然不存在。
#include
#include
#include
#include
#inc...
分类:
其他好文 时间:
2015-06-18 15:28:32
阅读次数:
127
1 program hehe; 2 var 3 n,m,i,j,q,x1,y1,x2,y2,co:longint; 4 y:array[0..300,0..300] of longint; 5 x:array[0..100,0..300,0..300] of longint; 6 7 ...
分类:
编程语言 时间:
2015-06-16 22:37:51
阅读次数:
160
直线上有n个等距的村庄,每个村庄要么买酒,要么卖酒。把k个单位的酒从一个村庄运到相邻村庄需要k个单位的劳动力。问最少需要多少劳动力才能满足所有村庄的需求
思路贪心
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#includ...
分类:
编程语言 时间:
2015-06-15 14:39:28
阅读次数:
99
语法:connect by 是结构化查询中用到的,其基本语法如下:start with,connect by主要目的:从表中取出树状数据。可以假想成表中存成的各条数据是分别是树中的一个结点。select … from tablename start with 条件1connect by prior ...
分类:
数据库 时间:
2015-06-15 12:34:12
阅读次数:
141
Scala的模式匹配和条件类树是在程序中常用的一个数据结构。例如编译器和解析器常常吧程序表示为树;XML文档结构也是树状的;还有一些集合是基于树的,例如红黑树。接下来我们将通过一个计算器程序来研究树在Scala中是如何表示和操纵的。这个程序的目标是处理一些由整数常量、变量和加号组成的简单的算数表达式...
分类:
其他好文 时间:
2015-06-11 18:28:17
阅读次数:
108
As you are probably well aware, in Byteland it is always the military officer's main worry to order his soldiers on parade correctly. In Bitland ordering soldiers is not really such a problem. If a pl...
分类:
其他好文 时间:
2015-06-11 14:47:40
阅读次数:
100
Problem Description
For the k-th number, we all should be very familiar with it. Of course,to kiki it is also simple. Now Kiki meets a very similar problem, kiki wants to design a container, the co...
分类:
其他好文 时间:
2015-06-11 14:41:25
阅读次数:
107