問題一覧 > 通常問題

No.3589 Make Ends Meet (Hard)

レベル : / AI推定難易度 : 2275 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 1024 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 11
作問者 : marc2825 / テスター : siganai
お気に入りにしたユーザー ProblemId : 13248 / 自分の提出
問題文最終更新日: 2026-08-29 01:01:08
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 504 (順位表) の他の問題:

Problem Statement

There is an undirected complete graph† with vertices $1,2,\dots,N$.
Remove exactly $M$ edges from this graph to create a new undirected graph $G$.
In the remaining graph $G$, we want the shortest distance (number of edges traversed) from vertex $1$ to vertex $N$ to be exactly $K$‡.

Find the number of ways to remove edges that satisfy this condition, modulo $998244353$.
Two ways of removal are considered different if the sets of removed edges are different.


† An "undirected complete graph" is an undirected graph without self-loops or multiple edges in which exactly $1$ edge exists between any $2$ distinct vertices.
‡ If vertex $N$ cannot be reached from vertex $1$, the condition is considered not satisfied.

Constraints

  • $2 \leq N \leq {\mathbf{35}}$
  • $0 \leq M \leq \dfrac{N(N-1)}{2}$
  • $1 \leq K \leq N-1$
  • All input values are integers.

Input

The input is given from standard input in the following format.

$N\ M\ K$

Output

Print the answer modulo $998244353$ on 1 line.

Sample

Sample 1
Input
4 2 2
Output
5

First, edge $(1,4)$ must always be removed.
Whichever $1$ of the remaining $5$ edges is removed, the shortest distance from vertex $1$ to vertex $4$ is exactly $2$.

Sample 2
Input
5 5 4
Output
0

There is no way to remove edges such that the shortest distance from vertex $1$ to vertex $5$ is $4$.

Sample 3
Input
35 520 25
Output
843751679

The answer can be very large, so print it modulo $998244353$.

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