你现在要实现一个针对于数字序列的编辑器。
初始的时候,序列是空的。
在之后,有以下五种操作:
I x 在光标之后插入x
D 删除光标之前的数字
L 将光标向左移动,如果已经在最左,则不移动
R 将光标向右移动,如果已经在最右,则不移动
Q k 假设光标之前的序列是{a1, a2,...,an}, 定义Si=a1+a2+...+ai,此时输出满足1<=i<=k的最大的Si
输入包含多组数据,文件结尾作为输入结束的标志。
SHOW FULL COLUMNS FROM `jrk_downrecords` [ RunTime:0.006075s ]
SELECT `a`.`aid`,`a`.`title`,`a`.`create_time`,`m`.`username` FROM `jrk_downrecords` `a` INNER JOIN `jrk_member` `m` ON `a`.`uid`=`m`.`id` WHERE `a`.`status` = 1 GROUP BY `a`.`aid` ORDER BY `a`.`create_time` DESC LIMIT 10 [ RunTime:0.357633s ]
SHOW FULL COLUMNS FROM `jrk_tagrecords` [ RunTime:0.013729s ]
SELECT * FROM `jrk_tagrecords` WHERE `status` = 1 ORDER BY `num` DESC LIMIT 20 [ RunTime:0.001278s ]
SHOW FULL COLUMNS FROM `jrk_member` [ RunTime:0.001568s ]
SELECT `id`,`username`,`userhead`,`usertime` FROM `jrk_member` WHERE `status` = 1 ORDER BY `usertime` DESC LIMIT 10 [ RunTime:0.003402s ]
SHOW FULL COLUMNS FROM `jrk_searchrecords` [ RunTime:0.002886s ]
SELECT * FROM `jrk_searchrecords` WHERE `status` = 1 ORDER BY `num` DESC LIMIT 5 [ RunTime:0.004251s ]
SELECT aid,title,count(aid) as c FROM `jrk_downrecords` GROUP BY `aid` ORDER BY `c` DESC LIMIT 10 [ RunTime:0.016196s ]
SHOW FULL COLUMNS FROM `jrk_articles` [ RunTime:0.001298s ]
UPDATE `jrk_articles` SET `hits` = 2 WHERE `id` = 328939 [ RunTime:0.025900s ]