跪求解答,编程题不会做

Skydevour 2019-08-23 02:02:03
Shuffle CardTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0Problem DescriptionA deck of card consists of n cards. Each card is different, numbered from 1 to n. At first, the cards were ordered from 1 to n. We complete the shuffle process in the following way, In each operation, we will draw a card and put it in the position of the first card, and repeat this operation for m times.Please output the order of cards after m operations. InputThe first line of input contains two positive integers n and m.(1<=n,m<=105)The second line of the input file has n Numbers, a sequence of 1 through n.Next there are m rows, each of which has a positive integer si, representing the card number extracted by the i-th operation. OutputPlease output the order of cards after m operations. (There should be one space after each number.) Sample Input5 31 2 3 4 5343 Sample Output3 4 1 2 5
...全文
114 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
引用 4 楼 提笔想你 的回复:
[quote=引用 2 楼 早打大打打核战争的回复:]这样例有问题吧,3 4 1 2 5怎么得到的?

把数字往前提就好了,提到开头[/quote]

按他这例子,应该是1 4 3 2 5啊
Skydevour 2019-08-23
  • 打赏
  • 举报
回复
引用 2 楼 早打大打打核战争的回复:
这样例有问题吧,3 4 1 2 5怎么得到的?
把数字往前提就好了,提到开头
Skydevour 2019-08-23
  • 打赏
  • 举报
回复
把数字往前提,提到开头
  • 打赏
  • 举报
回复
这样例有问题吧,3 4 1 2 5怎么得到的?
Skydevour 2019-08-23
  • 打赏
  • 举报
回复
急求,求大神来帮忙,谢谢

64,648

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧