标题:发个题给大家娱乐下^_^
只看楼主
草狼
Rank: 9Rank: 9Rank: 9
等 级:蜘蛛侠
威 望:2
帖 子:577
专家分:1040
注 册:2010-4-6
结帖率:94.44%
已结贴  问题点数:100 回复次数:13 
发个题给大家娱乐下^_^
Level up is the task of all online games. It's very boooooooooring. There is only level up in those games, except level up.
In a online game, there are N heroes numbered id from 1 to N, each begins with level 1 and 0 Experience. They need to kill monsters to get Exp and level up.
There are many waves of monsters, each wave, the heroes with id from li to ri will come to kill monsters and those hero with level k will get ei*k Exp. If one hero's Exp reach Needk then the hero level up to level k immediately.
After some waves, I will query the maximum Exp from li to ri.
Now giving the information of each wave and Needk, please tell me the answer of my query.
 

Input
The first line is a number T(1<=T<=30), represents the number of case. The next T blocks follow each indicates a case.
The first line of each case contains three integers N(1<=N<=10000), K(2<=K<=10) and QW(1<=QW<=10000)each represent hero number, the MAX level and querys/waves number.
Then a line with K -1 integers, Need2, Need3...Needk.(1 <= Need2 < Need3 < ... < Needk <= 10000).
Then QW lines follow, each line start with 'W' contains three integers li ri ei (1<=li<=ri<=N , 1<=ei<=10000); each line start with 'Q' contains two integers li ri (1<=li<=ri<=N).
 

Output
For each case, output the number of case in first line.(as shown in the sample output)
For each query, output the maximum Exp from li to ri.
Output a black line after each case.
 

Sample Input
2
3 3 5
1 2
W 1 1 1
W 1 2 1
Q 1 3
W 1 3 1
Q 1 3

5 5 8
2 10 15 16
W 5 5 9
W 3 4 5
W 1 1 2
W 2 3 2
Q 3 5
W 1 3 8
Q 1 2
Q 3 5


Sample Output
Case 1:
3
6

Case 2:
9
18
25

Hint
Case 1:
At first ,the information of each hero is 0(1),0(1),0(1) [Exp(level)]
After first wave, 1(2),0(1),0(1);
After second wave, 3(3),1(2),0(1);
After third wave, 6(3),3(3),1(2);
Case 2:
The information of each hero finally:
18(5) 18(5) 25(5) 5(2) 9(2)

[ 本帖最后由 草狼 于 2011-8-19 17:41 编辑 ]
搜索更多相关主题的帖子: online games except level reach 
2011-08-19 13:30
njkido
Rank: 9Rank: 9Rank: 9
等 级:蜘蛛侠
帖 子:224
专家分:1184
注 册:2011-3-8
得分:14 
mark
2011-08-19 13:58
waterstar
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:小飞侠
威 望:5
帖 子:984
专家分:2810
注 册:2010-2-12
得分:14 
占坑

冰冻三尺,非一日之寒;士别三日,不足刮目相看!
2011-08-19 14:31
小偌
Rank: 4
来 自:成都
等 级:业余侠客
帖 子:170
专家分:241
注 册:2011-8-15
得分:14 
这是什么啊~能不能发中文的?~

不是很好么..比起关在笼子里的可怜小鸟..我成为乌鸦已足矣
2011-08-19 15:41
草狼
Rank: 9Rank: 9Rank: 9
等 级:蜘蛛侠
威 望:2
帖 子:577
专家分:1040
注 册:2010-4-6
得分:0 
回复 4楼 小偌
题目意思就是有N个英雄在练级  刚开始每个英雄的等级为1级 经验为0,最高满级为k级
然后告诉你升到某级需要的经验,题目会给你M的询问
W li ri ie 说明 li~ri的英雄会得到 ie*英雄现在的等级 的经验
当英雄的经验达到升级的要求时他就会马上升级,
Q li ri 是问你li到ri的英雄中经验最高的使多少
 

例如第一个案例:
3 3 5 --> 说明有三个英雄  满级为3级 有5个询问
1 2 --> 说明到第2级需要1点经验 到第3级需要2点经验
W 1 1 1 -->  说明第一个英雄将获得 (1*英雄当前等级的) 的经验 即1*1;
W 1 2 1 -->  说明第一个英雄到第2个英雄将获得  (1*英雄当前等级的) 的经验;
Q 1 3 --> 问你第一个到第三个英雄中经验最高的那个英雄的经验是多少 (即3, 第一个英雄杀第一只怪得到1点经验生到2级 杀第二只怪得到2点经验 所以一共三点经验 )
W 1 3 1 -->说明第一个英雄到第3个英雄将获得  (1*英雄当前等级的) 的经验;
Q 1 3 -->问你第一个到第三个英雄中经验最高的那个英雄的经验是多少


如果我说的你还是不能搞明白  你就放弃这题吧- -
2011-08-19 16:02
voidx
Rank: 12Rank: 12Rank: 12
来 自:邯郸
等 级:火箭侠
帖 子:1250
专家分:3538
注 册:2011-4-7
得分:14 
确实挺娱乐的~
2011-08-19 16:33
wenmin910316
Rank: 2
等 级:论坛游民
帖 子:2
专家分:17
注 册:2011-8-19
得分:14 
这也叫娱乐
2011-08-19 17:04
卧龙孔明
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:59
帖 子:3872
专家分:684
注 册:2006-10-13
得分:14 
水题,易转化为询问区间覆盖线段的数量,用树状数组即可解决。

My Blog: www.aiexp.info
虽然我的路是从这里开始的,但是这里不再是乐土.感谢曾经影响过,引导过,帮助过我的董凯,飞燕,leeco,starwing,Rockcarry,soft_wind等等等等.别了,BCCN.
2011-08-19 17:11
voidx
Rank: 12Rank: 12Rank: 12
来 自:邯郸
等 级:火箭侠
帖 子:1250
专家分:3538
注 册:2011-4-7
得分:0 
大神又出现了
2011-08-19 17:13
草狼
Rank: 9Rank: 9Rank: 9
等 级:蜘蛛侠
威 望:2
帖 子:577
专家分:1040
注 册:2010-4-6
得分:0 
回复 8楼 卧龙孔明
直接区间不行的  他还要根据级数获得相应的经验的  不然就TL
2011-08-19 17:38



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-347943-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013857 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved