调了两天的BUG
来源:互联网 发布:℃-ute 知乎 编辑:程序博客网 时间:2024/03/29 17:55
A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate the battleships. Each of the battleships can be marked a value of endurance. For every attack of our secret weapon, it could decrease the endurance of a consecutive part of battleships by make their endurance to the square root of it original value of endurance. During the series of attack of our secret weapon, the commander wants to evaluate the effect of the weapon, so he asks you for help.
You are asked to answer the queries that the sum of the endurance of a consecutive part of the battleship line.
Notice that the square root operation should be rounded down to integer.
You are asked to answer the queries that the sum of the endurance of a consecutive part of the battleship line.
Notice that the square root operation should be rounded down to integer.
For each test case, the first line contains a single integer N, denoting there are N battleships of evil in a line. (1 <= N <= 100000)
The second line contains N integers Ei, indicating the endurance value of each battleship from the beginning of the line to the end. You can assume that the sum of all endurance value is less than 2 63.
The next line contains an integer M, denoting the number of actions and queries. (1 <= M <= 100000)
For the following M lines, each line contains three integers T, X and Y. The T=0 denoting the action of the secret weapon, which will decrease the endurance value of the battleships between the X-th and Y-th battleship, inclusive. The T=1 denoting the query of the commander which ask for the sum of the endurance value of the battleship between X-th and Y-th, inclusive.
101 2 3 4 5 6 7 8 9 1050 1 101 1 101 1 50 5 81 4 8
Case #1:1976
在初始化的时候,在函数中调用数组的时候,一定要确保数组已经初始化完毕或赋值完毕。
这道题还有一个很细节的地方,在update函数中,r>=mid 和r>mid 差别太大了。这和区间染色问题正好反着。
0 0
- 调了两天的BUG
- 看了两天的bug,既然说不用处理
- 这样的bug能发现真不容易啊,花了我两天时间才找到
- ContentProvider外部应用读取出错:(查了两天半的bug)
- 看了两天的spring的感想
- 这两天学习了ISO8583的知识。
- 累呀~加了两天的班
- 尝试做了两天的IT培训
- 困扰了我两天的一个exception
- 学了两天SVN的结果
- 折腾了快两天的问题
- HttpCLient请求困扰了两天的问题
- 这两天调了下iic
- 两天解决一个bug引起的真实感想
- 歇了两天了
- 搞了两天终于用上大名鼎鼎的Dynamips了
- 江南的雨就是缠绵 滴滴答答下了两天了
- 前两天开会了
- 去除活动的title
- Q90:简易地模拟透明材质(Simple Transparency)
- 剑指offer-整数中1出现的次数
- 也谈责任
- Linux命令行模式安装VMware Tools
- 调了两天的BUG
- Ajax表单验证
- 论文Visualizing and Understanding Convolutional Networks
- 欢迎来到我的博客
- vim必备操作
- Nginx + Tomcat 实现动静分离
- Python网络爬虫获取淘宝商品价格
- 输入一行由多个词构成的语句并反序输出语句
- KVM虚拟机创建功能详细讲解