模拟链表
文章平均质量分 81
h1021456873
这个作者很懒,什么都没留下…
展开
-
CSU - 1329 一行盒子 (数组模拟链表)
你有一行盒子,从左到右依次编号为1, 2, 3,…, n。你可以执行四种指令:1 X Y表示把盒子X移动到盒子Y左边(如果X已经在Y的左边则忽略此指令)。2 X Y表示把盒子X移动到盒子Y右边(如果X已经在Y的右边则忽略此指令)。3 X Y表示交换盒子X和Y的位置。4 表示反转整条链。指令保证合法,即X不等于Y。例如,当n=6时在初始状态下执行1 1 4后,盒子序列为2原创 2017-04-13 19:35:52 · 480 阅读 · 0 评论 -
codeforces 792 B. Counting-out Rhyme (模拟链表||约瑟夫环)
题意:n个人占成一圈,每点ai个人淘汰一个,输出淘汰顺序 解题思路:直接用数组模拟链表遍历即可n children are standing in a circle and playing the counting-out game. Children are numbered clockwise from 1 to n. In th原创 2017-04-16 16:00:10 · 422 阅读 · 0 评论