|
||||||||||
PermutationTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1289 Accepted Submission(s): 419 Problem Description bobo has a permutation p1,p2,¡,pn of 1,2,¡,n. Knowing m extra constraints of form pai<pbi, bobo wanna count the number of different permutations modulo (109+7). It is guaranteed that there is at least one such permutation. Input The input consists of several tests. For each tests: The first line contains n,m (1¡Ün¡Ü40,0¡Üm¡Ü20). Each of the following m lines contain 2 integers ai,bi(1¡Üai,bi¡Ün). Output For each tests: A single number denotes the number of permutations. Sample Input
Sample Output
Author Xiaoxu Guo (ftiasch) Source | ||||||||||
|