Builder Tools 101
All submissions for this problem are available.
Apache **ANT** (Another Neat Tool) is a software tool for automating software build processes. It is similar to Make but is implemented using the Java language, requires the Java platform, and is best suited to building Java projects.
The most immediately noticeable difference between Ant and Make is that Ant uses XML to describe the build process and its dependencies, whereas Make uses Make file format.
Ant is an Apache project. It is open source software, and is released under the Apache License.
Bruce Wayne recently made a press release wherein he told that Wayne Enterprises will be launching its first software product this Christmas. Bruce Wayne hired a very talented Chief Technical Officer (CTO) with an industrial experience of more than two decades for his ambitious project.
CTO with her vast experience of product based industry knows very well that to have a smooth manufacturing they would require a reliable building and deployment system. CTO has decided to build the builder tool upon Apache ANT. To make the building process rapid, she proposed an idea wherein system would only compile and build those files which will get affected due to recent code changes.
Projects in Wayne Enterprises are written in a high level language know as LOS developed by League of Shadows. LOS is way ahead of other programming languages and has some peculiar rules associated with it. In LOS, a program can have direct dependency on at max two files and each file can be a direct dependency of just one file. It is obvious that few files in the package won’t have any dependencies. Like any other programming language cyclic dependencies are not allowed i.e. if A is dependent on B and C then A cannot be dependency of C or B.
Congratulations! You have procured a full time employment for the role of software development engineer at Wayne Enterprises. You have joined the team working on developing the building system and your software development manager (SDM) wants you to write the small module for the builder system that will list the files which will get affected due to recent code changes in a lexicographic order. You will be provided with all the files in the package and their direct dependencies, if any.
First line of the input contains an integer T, the number of test cases. Next line contains N, the number of files in the package. Next N lines contain the description of the dependencies. Each line of these N lines contains the name of the file followed by an integer M – the number of direct dependencies the file has. Rest of the line contains M space separated file names.
Next Q lines contain a query q wherein a file name is provided which recently had a code change.
Your task is for each Q queries, output Q lines listing the files that have to build again due to the recent code changes in lexicographic order.
1<= T <= 10
1<= N <= 50
0<= M <= 2
1<= Q <= 25
1<= |Filename| <= 100, will consist of only lower case English alphabets and (.) sysmbol.
Input: 1 4 com.wayne.global.translations 2 com.los.date com.los.time com.los.unitTestSuite 0 com.los.date 0 com.los.time 0 2 com.los.unitTestSuite com.los.date Output: com.los.unitTestSuite com.los.date com.wayne.global.translations
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, 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, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.