经典简约
清爽简洁,回归本真
液态水晶
毛玻璃+霓虹光带
赛博朋克
霓虹故障艺术风
🚫
违规操作检测
禁止使用右键菜单
⚠️ 此操作已被系统记录
1

计算机C13001第一次小组赛C题

📝 题解 🔵 仅限 C++
题目描述
<p> <strong><span style="color:#003399;font-size:14px;">Ms.Han was addicted to games about light .  </span></strong> </p> <p> <strong><span style="color:#003399;font-size:14px;">There are N lights putting in a line S[1...N] and we can change their status (open and closed ) by pressing their button. But they have a characteristic, when you press light s[i] (0&lt;=i&lt;=N), those lights who's numbers are i's multiple will also change their status.For example:There are 10 lights s[1...10] whose initial status is closed. When she press the light s[2] (it will be open), then the light s[2],s[4],s[6],s[8] and s[10] will also be open. When she press s[4] again, light s[4] and s[8] will be closed.Now Ms.Han has N lights all closed ,she will press them from 1 to N ,then how many lights will be open in the end?</span></strong> </p>
输入格式
<strong><span style="font-size:14px;color:#003399;">The input will contain multiple test cases ,Each case will only contain a number N(1 &lt;= N &lt;= 1,000,00).</span></strong>
输出格式
<strong><span style="color:#003399;font-size:14px;">A integer on a single line for each case indicates the number of lights which are open in the end.</span></strong>
样例
样例输入 1
10 15 20
样例输出 1
3 3 4
提交代码
请先登录后提交

🤖 AI 解题助手

DeepSeek
就绪
👋 你好!我是 AI 解题助手。
我已阅读了这道题,可以帮你分析思路、提供代码示例。
⚠️ 请先登录后使用