你现在要实现一个针对于数字序列的编辑器。
初始的时候,序列是空的。
在之后,有以下五种操作:
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.001079s ]
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.068553s ]
SHOW FULL COLUMNS FROM `jrk_tagrecords` [ RunTime:0.000975s ]
SELECT * FROM `jrk_tagrecords` WHERE `status` = 1 ORDER BY `num` DESC LIMIT 20 [ RunTime:0.001119s ]
SHOW FULL COLUMNS FROM `jrk_member` [ RunTime:0.000940s ]
SELECT `id`,`username`,`userhead`,`usertime` FROM `jrk_member` WHERE `status` = 1 ORDER BY `usertime` DESC LIMIT 10 [ RunTime:0.002970s ]
SHOW FULL COLUMNS FROM `jrk_searchrecords` [ RunTime:0.000867s ]
SELECT * FROM `jrk_searchrecords` WHERE `status` = 1 ORDER BY `num` DESC LIMIT 5 [ RunTime:0.003488s ]
SELECT aid,title,count(aid) as c FROM `jrk_downrecords` GROUP BY `aid` ORDER BY `c` DESC LIMIT 10 [ RunTime:0.017299s ]
SHOW FULL COLUMNS FROM `jrk_articles` [ RunTime:0.001519s ]
UPDATE `jrk_articles` SET `hits` = 2 WHERE `id` = 328939 [ RunTime:0.011106s ]