CF475A.Bayan Bus

普及-

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

The final round of Bayan Programming Contest will be held in Tehran, and the participants will be carried around with a yellow bus. The bus has 34 passenger seats: 4 seats in the last row and 3 seats in remaining rows.

The event coordinator has a list of k participants who should be picked up at the airport. When a participant 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, he will take the leftmost one.

In order to keep track of the people who are on the bus, the event coordinator needs a figure showing which seats are going to be taken by k participants. Your task is to draw the figure representing occupied seats.

Bayan 编程竞赛的决赛将在德黑兰举行,参赛者将乘坐一辆黄色巴士前往比赛场地。该巴士共有 34 个乘客座位:最后一排有 4 个座位,其余每排均有 3 个座位。

活动协调员手中有一份包含 kk 名需在机场接载的参赛者的名单。每当一名参赛者登上巴士时,他将坐在最后一排中一个空闲的座位上;若该排存在多个空闲座位,则选择最左侧的一个。

为了实时掌握巴士上的就座情况,活动协调员需要一张图示,显示前 kk 名参赛者将占据哪些座位。你的任务是绘制一张图,标出这 kk 个被占用的座位。

输入格式

The only line of input contains integer k, (0 ≤ k ≤ 34), denoting the number of participants.

输入仅包含一个整数 kk(0 ≤ k ≤ 340 ≤ k ≤ 34),表示参赛者人数。

输出格式

Print the figure of a bus with k passengers as described in sample tests. Character '#' denotes an empty seat, while 'O' denotes a taken seat. 'D' is the bus driver and other characters in the output are for the purpose of beautifying the figure. Strictly follow the sample test cases output format. Print exactly six lines. Do not output extra space or other characters.

按照样例测试中描述的方式,打印一辆载有 kk 名乘客的公交车图形。字符 # 表示空座位,O 表示已被占用的座位。D 是公交车司机,输出中的其他字符仅用于美化图形。请严格遵循样例测试用例的输出格式。输出恰好六行,不得输出额外的空格或其他字符。

输入输出样例

  • 输入#1

    9

    输出#1

    +------------------------+
    |O.O.O.#.#.#.#.#.#.#.#.|D|)
    |O.O.O.#.#.#.#.#.#.#.#.|.|
    |O.......................|
    |O.O.#.#.#.#.#.#.#.#.#.|.|)
    +------------------------+
  • 输入#2

    20

    输出#2

    +------------------------+
    |O.O.O.O.O.O.O.#.#.#.#.|D|)
    |O.O.O.O.O.O.#.#.#.#.#.|.|
    |O.......................|
    |O.O.O.O.O.O.#.#.#.#.#.|.|)
    +------------------------+

输入解题思路,AI测评打分。不知道怎么写?

首页