問題一覧 > 通常問題

No.3420 Letter Loading

レベル : / AI推定難易度 : 143 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 97
作問者 : ぶりけ / テスター : まみめ harel hirayuu_yc rogi52 👑 qand syndrome kidodesu 👑 ArcAki Eku
お気に入りにしたユーザー ProblemId : 12924 / 自分の提出
問題文最終更新日: 2026-01-11 12:49:49
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest YNUCPC Contest 2 (順位表) の他の問題:
Stack the packages o vertically, with $4,1,3$ packages from left to right

Problem Statement

You are given a string $S$ of length $N$, and the width $W$ and height $H$ of a cargo bed.
The space above the cargo bed is divided into a grid of cells of width $1$ and height $1$. The cell corresponding to the space between $x$ and $x+1$ from the left and between $y$ and $y+1$ from the bottom is called $(x,y)$.
Each package has width $1$ and height $1$, and is stacked so that it fits exactly into a grid cell. Here, for $h>0$, when a package is stacked at $(w,h)$, a package must exist at $(w,h-1)$.
$S$ represents the arranged packages and dividers, and consists of two kinds of characters: o representing a package and l representing a divider. Read $S$ from the front, starting at $(0,0)$; for each o, fill $1$ cell and move to the cell above, and for each l, move to the bottom cell of the column to the right.
Display x at the places where no o is stacked, and output the result.

Please refer to the sample.

Constraints

  • $1 \leq N \leq 2549$
  • $1 \leq W,H \leq 50$
  • $N,W,H$ are all integers
  • $S$ is a string of length $N$ consisting of o and l
  • The number of l in $S$ is at most $W-1$
  • The number of packages stacked in $1$ column is at most $H$

Input

$N$ $W$ $H$
$S$

Output

Output the result of stacking the packages.

Sample

Sample 1
Input

Separated by the dividers l, the packages o are lined up in groups of $4,1,3$ in order

10 3 5
oooololooo
Output
Stack the packages o vertically, with $4,1,3$ packages from left to right
xxx
oxx
oxo
oxo
ooo

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。