問題一覧 > 通常問題

No.2775 Nuisance Balls

レベル : / AI推定難易度 : 126 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 176
作問者 : yuusaan / テスター : 👑 seekworser 👑 amentorimaru
お気に入りにしたユーザー ProblemId : 10949 / 自分の提出
問題文最終更新日: 2024-06-06 20:16:59
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 432 (順位表) の他の問題:

Story

Yu-san is now able to get proper sleep, so she has decided to tidy up the nuisance balls that, for some reason, are in her room in large numbers.

However, even though Yu-san intends to clean up, she does not seem to be very motivated.

Yu-san said, "If only I could represent the number of balls in the style of a certain falling-block puzzle game..."

Let's make this happen and motivate Yu-san.

Problem Statement

Yu-san has $N$ balls.

However, she wants to make the number of balls easier to understand visually, so she has decided to represent the count using symbols.

The correspondence between symbols and counts is as follows.

  • . represents $1$ ball.
  • o (lowercase letter "o") represents $6$ balls.
  • R represents $30$ balls.
  • S represents $180$ balls.
  • M represents $360$ balls.
  • C represents $720$ balls.

Among the strings formed by arranging these symbols, each usable multiple times, consider those for which the sum of the numbers of balls represented by the symbols equals $N$. Take the one with the minimum length, sort it in descending order of the number of balls each symbol represents, and output it.

Under these conditions, for any $N$, exactly $1$ string of symbols is the correct answer.

Input

$N$

Constraints

  • $1\leq N \leq 4320$
  • $N$ is an integer

Output

Print a newline at the end.

Sample

Sample 1
Input
10
Output
o....

o represents $6$ balls and . represents $1$ ball, so this string represents $10$ balls.

No string shorter than this one represents $10$ balls, and the symbols are arranged in descending order of the number of balls they represent, so this sample output is valid.

For this input, printing ....o is not valid, because a symbol representing $1$ ball is to the left of a symbol representing $6$ balls.

Sample 2
Input
1
Output
.

This is the only string that represents $1$ ball.

Sample 3
Input
1297
Output
CMSRo.

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