数据结构——链表
链表
Sstee1XD
这个作者很懒,什么都没留下…
展开
-
uva -12657 Boxes in a Line(数组实现双向链表)
题目链接 题意 :111 ~ nnn的数字原本按顺序摆好,接下来有四种操作。 1XY1 X Y1XY :将XXX移动到YYY的左边 2XY2 X Y2XY :将XXX移动到YYY的右边 3XY3 X Y3XY :交换X,YX,YX,Y的位置 444 :翻转整个数字串 经过这一系列操作后,最后输出奇数位上的数字和。 题解 :有移动到左右的操作,所以想到了双向链表。由于是第一次写双向链表,写得很精污。注意 ∑i=1100000\sum_{i = 1}^{100000}∑i=1100000会超出int范围,原创 2020-10-18 17:58:36 · 145 阅读 · 0 评论 -
uva - 11988 Broken Keyboard (a.k.a. Beiju Text) (数组实现链表)
You’re typing a long text with a broken keyboard. Well it’s not so badly broken. The only problem with the keyboard is that sometimes the “home” key or the “end” key gets automatically pressed (internally). You’re not aware of this issue, since you’re focu原创 2020-09-23 23:24:06 · 131 阅读 · 0 评论