QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 128 MB Total points: 100

#4178. HH 去散步

统计

HH 有个一成不变的习惯,喜欢饭后百步走。所谓百步走,就是散步,就是在一定的时间内,走过一定的距离。 但是同时 HH 又是个喜欢变化的人,所以他不会立刻沿着刚刚走来的路走回。 又因为 HH 是个喜欢变化的人,所以他每天走过的路径都不完全一样,他想知道他究竟有多少种散步的方法。 现在给你学校的地图(假设每条路的长度都 是一样的都是 $1$),问长度为 $t$,从给定地点 $A$ 走到给定地点 $B$ 共有多少条符合条件的路径。

输入格式

第一行:五个整数 $N$,$M$,$t$,$A$,$B$。

  • $N$ 表示学校里的路口的个数
  • $M$ 表示学校里的路的条数
  • $t$ 表示 HH 想要散步的距离
  • $A$ 表示散步的出发点
  • $B$ 则表示散步的终点。

接下来 $M$ 行:

  • 每行一组 $A_i$,$B_i$,表示从路口 $A_i$ 到路口 $B_i$ 有一条路。
  • 数据保证 $A_i \ne B_i$,但不保证任意两个路口之间至多只有一条路相连接。
  • 路口编号从 $0$ 到 $N-1$。
  • 同一行内所有数据均由一个空格隔开,行首行尾没有多余空格。没有多余空行。

答案取模 $45989$。

输出格式

一行,表示答案。

样例数据

样例输入

4 5 3 0 0
0 1
0 2
0 3
2 1
3 2

样例输出

4

数据范围

对于 $20\%$ 的数据,$n \leq 4, m \leq 10, A = B = 0$。

另有 $10\%$ 的数据,$n \leq 3, m \leq 3$。

另有 $10\%$ 的数据,$m = 0$。

另有 $10\%$ 的数据,$n \leq 10, m \leq 40$。

另有 $10\%$ 的数据,$n \leq 10$。

另有 $10\%$ 的数据,$A_i = 0$。

对于 $100\%$ 的数据,$1 \leq N \leq 20, 1 \leq M \leq 60, 0 \leq t \leq 2^{30}, 0 \leq A,B < N$。

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.