CF1606E.Arena

提高+/省选-

通过率:0%

时间限制:3.00s

内存限制:256MB

AC君温馨提醒

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

题目描述

There are nn heroes fighting in the arena. Initially, the ii-th hero has aia_i health points.

The fight in the arena takes place in several rounds. At the beginning of each round, each alive hero deals 11 damage to all other heroes. Hits of all heroes occur simultaneously. Heroes whose health is less than 11 at the end of the round are considered killed.

If exactly 11 hero remains alive after a certain round, then he is declared the winner. Otherwise, there is no winner.

Your task is to calculate the number of ways to choose the initial health points for each hero aia_i, where 1≤ai≤x1 \le a_i \le x, so that there is no winner of the fight. The number of ways can be very large, so print it modulo 998244353998244353. Two ways are considered different if at least one hero has a different amount of health. For example, [1,2,1][1, 2, 1] and [2,1,1][2, 1, 1] are different.

有 nn 位英雄在竞技场中战斗。初始时,第 ii 位英雄的生命值为 aia_i。

竞技场中的战斗分为若干轮进行。每轮开始时,每位存活的英雄会对其他所有英雄各造成 11 点伤害。所有英雄的攻击同时发生。一轮结束后,生命值小于 11 的英雄被视为阵亡。

若某轮结束后恰好有 11 位英雄存活,则该英雄被宣布为获胜者;否则,本次战斗无获胜者。

你的任务是计算:有多少种方式为每位英雄指定初始生命值 aia_i(满足 1≤ai≤x1 \le a_i \le x),使得整场战斗无获胜者。答案可能非常大,请对 998244353998244353 取模输出。若至少有一位英雄的生命值不同,则认为两种方式不同。例如,[1,2,1][1, 2, 1] 和 [2,1,1][2, 1, 1] 被视为不同的方案。

输入格式

The only line contains two integers nn and xx (2≤n≤500;1≤x≤5002 \le n \le 500; 1 \le x \le 500).

唯一一行包含两个整数 nn 和 xx(2≤n≤5002 \le n \le 500;1≤x≤5001 \le x \le 500)。

输出格式

Print one integer — the number of ways to choose the initial health points for each hero aia_i, where 1≤ai≤x1 \le a_i \le x, so that there is no winner of the fight, taken modulo 998244353998244353.

输出一个整数——即为选择每位英雄的初始生命值 aia_i(其中 1≤ai≤x1 \le a_i \le x)的方式数目,使得战斗没有获胜者,结果对 998244353998244353 取模。

输入输出样例

  • 输入#1

    2 5

    输出#1

    5
  • 输入#2

    3 3

    输出#2

    15
  • 输入#3

    5 4

    输出#3

    1024
  • 输入#4

    13 37

    输出#4

    976890680

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

首页