acm-K steps
来源:互联网 发布:淘宝店铺收藏在哪里 编辑:程序博客网 时间:2024/04/26 13:26
K steps
- 描述
- Here are n beautiful towns and m roads(directional edge). yjxwants to visit these towns for relaxation when hesuddenlygot a question. He wants to know the number of schemes
to walk from town A to town B in exactly ksteps.A road can be visited more then once. It takes exactly one step to walk fromone town to another if they are directly connected by a road.yjx is very entangled with this matter, please help him. - 输入
- First line is a number T, the number of the cases.
Each case is as follows:
First line includes four number: n, m, k, l which means n(1 <= n<= 100)towns, m(1 <= m<=1000)roads,k(1<=k<=1000)steps,
and l (1<=l<=1000) lines test data.
Then there are m lines, and each line is made up of two number u, v(u != v, 1<= u,v <= n) which means one road from u tov.
Then l lines test data, and each line is made up of two number p, q(so you must help yjx to know the number of the scheme that justwalk k steps from town p to town q).
hint: maybe there are more than one road from u to v . - 输出
- For each test data, output the number of the scheme(the number isbig, so you must make the number mod 1991).
- 样例输入
22 2 1 21 22 11 22 13 2 2 11 22 31 3
- 样例输出
111
- 上传者
- 521521
代码:
#include
#include
#define max 101
#define len 1991
using namespace std;
typedef struct numb
{
}MT;
MT ans;
int n,m,k,l;
void mult(numb &x,numb y,numb z)
{
}
int main()
{
}
- acm-K steps
- Steps-ACM
- ACM STEPS
- ACM steps
- hdu ACM Steps 1.1
- hdu ACM Steps 1.2
- hdu ACM Steps 1.3
- hdu ACM Steps 2.1
- hdu ACM Steps 2.2
- hdu ACM Steps 2.3
- hdu ACM Steps 3.1
- hdu ACM Steps 3.2
- hdu ACM Steps 3.3
- 【ACM Steps】N!Again
- 【ACM Steps】 Fibonacci
- [ACM Steps]Cake
- [ACM Steps]七夕节
- ACM steps quicksum
- acm-递推求值
- acm-Matrix Power Series
- acm-Kiki & Little Kiki 2
- scala good code
- acm-星际旅行
- acm-K steps
- hashmap hashtable1
- acm-好多的树
- SharePoint 2013 App 开发 (2) - 建立开发环境
- acm-多边形重心问题
- acm-三点顺序
- acm-圈水池
- acm-寻找最大数
- acm-Color the fence