Classic
Clean & simple
Crystal
Glassmorphism + Neon
Cyberpunk
Neon glitch art
🚫
违规Action检测
禁止Use右键菜单
⚠️ 此Action已被系统记录
1

bus

📝 Solutions 🔵 仅限 C++
Problems Description
<p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;">The final round of Bayan Programming Contest will be held in Tehran, and the participants will be carried around</span> </p> <p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;">&nbsp;with a yellow bus. The bus has 34 passenger seats: 4 seats in the last row and 3 seats in remaining rows.</span> </p> <p class="MsoNormal" align="center" style="text-align:center;background:white;"> <br /> </p> <p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;">The event coordinator has a list of&nbsp;</span><i><span style="font-size:14px;">k</span></i><span style="font-size:14px;">&nbsp;participants who should be picked up at the airport. When a participant</span> </p> <p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;">&nbsp;gets on the bus, he will sit in the last row with an empty seat. If there is more than one empty seat in that row,</span> </p> <p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;">&nbsp;he will take the leftmost one.</span> </p> <p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;">In order to keep track of the people who are on the bus, the event coordinator needs a figure showing which</span> </p> <p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;">&nbsp;seats are going to be taken by&nbsp;</span><i><span style="font-size:14px;">k</span></i><span style="font-size:14px;">&nbsp;participants. Your task is to draw the figure representing occupied seats.</span> </p>
Input格式
<p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;">each line of input contains integer&nbsp;</span><i><span style="font-size:14px;">k</span></i><span style="font-size:14px;">,&nbsp;(0 ≤ </span><i><span style="font-size:14px;">k</span></i><span style="font-size:14px;"> ≤ 34), denoting the number of participants.</span> </p>
Output格式
<p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;">Print the figure of a bus with&nbsp;</span><i><span style="font-size:14px;">k</span></i><span style="font-size:14px;">&nbsp;passengers as described in sample tests. Character '#' denotes an empty seat,</span> </p> <p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;">&nbsp;while 'O' denotes a taken seat. 'D' is the bus driver and other characters in the output are for the purpose of</span> </p> <p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;">&nbsp;beautifying the figure. Strictly follow the sample test cases output format. Print exactly six lines. Do not output</span> </p> <p class="MsoNormal" align="left" style="background:white;"> <span style="font-size:14px;">&nbsp;extra space or other characters.</span> </p>
Sample
Sample Input 1
9 20
Sample Output 1
+------------------------+ |O.O.O.#.#.#.#.#.#.#.#.|D|) |O.O.O.#.#.#.#.#.#.#.#.|.| |O.......................| |O.O.#.#.#.#.#.#.#.#.#.|.|) +------------------------+ +------------------------+ |O.O.O.O.O.O.O.#.#.#.#.|D|) |O.O.O.O.O.O.#.#.#.#.#.|.| |O.......................| |O.O.O.O.O.O.#.#.#.#.#.|.|) +------------------------+
Submit Code
请先Login后Submit

🤖 AI 解题助手

OpenRouter
就绪
👋 你好!我是 AI 解题助手。
我已阅读了这problems题,可以帮你points析思路、提供Code示例。
🔓 完全Free · 无需消耗 Token