题意如下:
dota里面有一个hero名为Pudge,他有一个用链子连着的铁钩,一开始他的链子全是一块一块的铜块(价值为1)连接而制的,现在他可以选择任意长度(从i到j)然后对其进行改造,可以改成银块(价值为2),也可以改成金块(价值为3),然后在Q次改造后,要求你求出现在他的链子的总价值是多少!!!
这个题简化的话--->就是给出一个长度为n的数组,初始值全为1,然后在Q次改变指定长度的子数组的值后,再求出这个长度为n的数组的总值大小!
思路:使用线段树来做!百度线段树的地址:--->>>线段树
(说起来...
分类:
其他好文 时间:
2014-07-26 15:23:03
阅读次数:
277
参考链接:http://blog.163.com/hero_213/blog/static/398912142010312024809近年来ORM(Object-Relational Mapping)对象关系映射,即实体对象和数据库表的映射)技术市场人声音鼎沸,异常热闹, Sun在充分吸收现有的优秀...
分类:
系统相关 时间:
2014-07-26 14:52:40
阅读次数:
295
To Learn something you need to do it, without the fear of being unsuccessful. I believe in practicality and hence will be accompanying you to the prac...
分类:
系统相关 时间:
2014-07-26 14:09:15
阅读次数:
492
Invoker
Problem Description
On of Vance's favourite hero is Invoker, Kael. As many people knows Kael can control the elements and combine them to invoke a powerful skill. Vance like Kael v...
分类:
其他好文 时间:
2014-07-26 02:16:36
阅读次数:
312
A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message conta...
分类:
其他好文 时间:
2014-07-24 21:56:32
阅读次数:
219
The Fewest CoinsDescriptionFarmer John has gone to town to buy some farm supplies. Being a very efficient man, he always pays for his goods in such a ...
分类:
其他好文 时间:
2014-07-24 17:11:36
阅读次数:
326
A message containing letters from A-Z is being encoded to numbers using the following mapping:
'A' -> 1
'B' -> 2
...
'Z' -> 26
Given an encoded message containing digits, determine the total numb...
分类:
其他好文 时间:
2014-07-23 17:06:05
阅读次数:
324
创建表: hive> CREATE TABLE pokes (foo INT, bar STRING); Creates a table called pokes with two columns, the first being an integer and the other a string....
分类:
其他好文 时间:
2014-07-22 22:50:54
阅读次数:
262
工具:eclipse3.7.2 升级ADT:从ADT-22.3.0到ADT-23.0.2 错误信息: Cannot?complete?the?install?because?of?a?conflicting?dependency.
??Software?being?installed:?Android?Development?Tools...
分类:
系统相关 时间:
2014-07-22 08:28:34
阅读次数:
506
现象,外网发包,流量暴涨 这个gitlab安全不? ?[20:20:49]?Warning:?Network?TCP?port?6667?is?being?used?by?/var/tmp/lib/init.?Possible?rootkit:?Possible?rogue?IRC?bot ????????...
分类:
其他好文 时间:
2014-07-22 08:16:37
阅读次数:
294