C++-一维数组-有n个人,编号从1~n,开始时,所有人都站着,接着第2个人与2的倍数位置的人坐下...
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Background
Description
有n个人,编号从1~n,开始时,所有人都站着,接着第2个人与2的倍数位置的人坐下,然后第三个人与3的倍数位置的人按相反的操作(坐着的人站起,站着的人坐下),以此类推,一直操作到第k人,问最后哪些人站着? 输入n,k 输出站着的人的编号
Format
Input
Output
Samples
10 5
1 4 6 7 8 10
Limitation
1s, 1024KiB for each test case.
C++基础知识03(数组-一维数组和二维数组)
- Status
- Done
- Rule
- ACM/ICPC
- Problem
- 6
- Start at
- 2024-5-5 17:00
- End at
- 2024-5-20 17:00
- Duration
- 360 hour(s)
- Host
- Partic.
- 11