ArkaAndAI

All submissions for this problem are available.
###Notification 1) $2\leq n \leq 150$ ###Problem description. Help Arka Arka went to Planet AI, which is occupied by bloodthirsty aliens .The aliens plan to enslave Arka but they are compassionate,hence they give Arka a chance to escape . They give him q queries . If Arka answers each query correctly , they will let him go . Now ,in each query Arka is asked to find the number of different paths of length k between given 2 vertices x and y of a directed graph . The graph consists of n vertices and m edges. Help arka by answering the queries. The number of paths of length k can be very large. So , print the number of paths modulo 1000000007 ###Input The first line consists of n(The number of vertices) , q(Number of queries) ,k , m(Number of edges). Each of the next m lines consists of 2 integers a and b, which denotes that a path exists from a to b . Each of the following q lines consist of 2 integers : x y ###Output It consists of q lines . On each line print a single integer which will denote the number of paths of length k between x and y . ###Constraints  $2\leq n \leq 150$  $1\leq m \leq 5000$  $1\leq q \leq 50000$  $1\leq k \leq 10000000000$ ###Sample Input: 4 5 2 5 1 4 3 2 2 3 1 2 1 3 1 4 1 3 2 2 1 2 3 4 ###Sample Output: 0 1 1 1 0Author:  indraneelp1997 
Tags  indraneelp1997 
Date Added:  1032019 
Time Limit:  2 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, COB, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions