Sum of SCC

AtCoder
IDarc163_d
Time2000ms
Memory256MB
Difficulty
Consider a directed graph $G$ with $N$ vertices numbered $1$ to $N$ that satisfies all of the following conditions. * $G$ is a tournament. In other words, $G$ has no multi-edges or self-loops, and for any two vertices $u,v$ of $G$, exactly one of the edges $u \rightarrow v$ and $v \rightarrow u$ exists. * Among the edges of $G$, exactly $M$ are directed from a vertex with a smaller number to a vertex with a larger number. Find the total number of strongly connected components over all such directed graphs $G$, modulo $998244353$. ## Constraints * $1 \le N \le 30$ * $0 \le M \le \frac{N(N-1)}{2}$ ## Input The input is given from Standard Input in the following format: $N$ $M$ [samples]
Samples
Input #1
3 1
Output #1
7

Below are the three directed graphs $G$ that satisfy the conditions. The numbers of their strongly connected components are $3,1,3$ from left to right, so the answer is $7$.
![image](https://img.atcoder.jp/arc163/ee8acabc2a7d48164b3cc568e88f0840.png)
Input #2
6 2
Output #2
300
Input #3
25 156
Output #3
902739687
API Response (JSON)
{
  "problem": {
    "name": "Sum of SCC",
    "description": {
      "content": "Consider a directed graph $G$ with $N$ vertices numbered $1$ to $N$ that satisfies all of the following conditions. *   $G$ is a tournament. In other words, $G$ has no multi-edges or self-loops, and ",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "arc163_d"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Consider a directed graph $G$ with $N$ vertices numbered $1$ to $N$ that satisfies all of the following conditions.\n\n*   $G$ is a tournament. In other words, $G$ has no multi-edges or self-loops, and ...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments