No.2997 Making YuzuKizu
レベル :
/ AI推定難易度 : 151
/ 実行時間制限 : 1ケース 2.000秒 / メモリ制限
: 512 MB / 標準ジャッジ問題
タグ : / 解いたユーザー数 58
作問者 :
Apollo@Kuro
/ テスター :
ルク
👑
loop0919
lif4635
タグ : / 解いたユーザー数 58
作問者 :
問題文最終更新日: 2024-12-22 12:02:24
English (AI translation)
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
Advent Calendar Contest 2024
(順位表)
の他の問題:
Problem Statement
When the characters of a string $S$ are freely rearranged, find the maximum possible value of each of the following: the number $Y$ of occurrences of yukari, the number $A$ of occurrences of akari, and the number $X$ of occurrences of yuzukizu, appearing as (contiguous) substrings.
Here, the values of $Y, A, X$ are to be determined independently of each other.
Constraints
- All input consists of lowercase English letters
- $1 \leq |S| \leq 10^6$ ($|S|$ is the length of $S$)
- $S$ consists of lowercase English letters
Input
The input is given from Standard Input in the following format.
$S$
Output
Output the answer as follows.
$Y\ A\ X$
Sample
Sample 1
Input
yuzukizuari
Output
1 0 1
By rearranging this string appropriately, $1$ occurrence each of yukari and yuzukizu can be made.
- Rearrange $S$ into
yukarizuzui. The number of occurrences ofyukarias a substring is then $1$. - Rearrange $S$ into
yuzukizuari. The number of occurrences ofyuzukizuas a substring is then $1$.
On the other hand, akari cannot be made no matter how the characters of $S$ are rearranged.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。