C++-一维数组-有n个人,编号从1~n,开始时,所有人都站着,接着第1个人与1的倍数位置的人坐下...
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,开始时,所有人都站着,接着第1个人与1的倍数位置的人坐下,接着第2个人与2的倍数位置的人按相反的操作(坐着的人站起,站着的人坐下),然后第三个人与3的倍数位置的人按相反的操作(坐着的人站起,站着的人坐下),以此类推,一直操作到第k人,问最后哪些人站着?
Format
Input
Output
Samples
10
5
2 3 5 9
Limitation
1s, 1024KiB for each test case.
一维数组
- Status
- Done
- Rule
- ACM/ICPC
- Problem
- 6
- Start at
- 2024-4-27 21:30
- End at
- 2024-5-2 21:30
- Duration
- 120 hour(s)
- Host
- Partic.
- 3