{"problem":{"name":"Swap Characters","description":{"content":"You are given a string $S$ of length $N$ consisting of the characters `A`, `B`, and `C`. Consider performing the following operation between $0$ and $K$ times, inclusive: *   Freely choose two charac","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc168_c"},"statements":[{"statement_type":"Markdown","content":"You are given a string $S$ of length $N$ consisting of the characters `A`, `B`, and `C`.\nConsider performing the following operation between $0$ and $K$ times, inclusive:\n\n*   Freely choose two characters in $S$ and swap them.\n\nFind the number of strings that $S$ can be after the operations, modulo $998244353$.\n\n## Constraints\n\n*   $1 \\leq N \\leq 250000$\n*   $1 \\leq K \\leq 100$\n*   $S$ is a string of length $N$ consisting of the characters `A`, `B`, and `C`.\n*   All input values are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$ $K$\n$S$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc168_c","tags":[],"sample_group":[["3 1\nABC","4\n\nThe following four strings can be obtained:\n\n*   $S=$`ABC`: No operation is needed.\n*   $S=$`BAC`: Swap the $1$\\-st and $2$\\-nd characters.\n*   $S=$`CBA`: Swap the $1$\\-st and $3$\\-rd characters.\n*   $S=$`ACB`: Swap the $2$\\-nd and $3$\\-rd characters."],["3 2\nABC","6"],["4 5\nAAAA","1"],["30 10\nCACCABAABBABABBCBBCAAACAAACCCA","42981885"]],"created_at":"2026-03-03 11:01:14"}}