Sie sind auf Seite 1von 3

5/9/2014 Code Gladiators Hunt for India' s Best Coders

http://www.techgig.com/codegladiators/openparticipation/question/MzkyQCMkQCMkNTIxMzA3QCMkQCMkMTIyNzE3MUAjJEAjJDEzOTk2NTIwODNAIyRAIy 1/4
&
Brought to you by
Co-Sponsered by
Go to dashboard >>
EASY LEVEL
Harry is playing a mind game called icelands. In this game basically there are some icelands which are connected through bridges. Every
bridge is between two icelands. And he can only move from one Iceland to other through bridges. Figure below is showing an example of
such icelands. All icelands are called connected if he can move from any Iceland to any other by using these bridges. A bridge is called
critical if removing that bridge (but preserving all other bridges) breaks connectedness of the Icelands.
In the example shown above in Figure 1, bridge (B,D) is critical because if it is removed then all icelands will not remain connected (e.g. I can
not go from A to D) but (C,E) is not critical because if this edge is removed then still I can move from any iceland to any other. If icelands are
already not connected then all the bridges are critical. Game asks him to find all the critical bridges.
Input/Output Specifications
Input Specification:
Your program must read two arguments (t, string1) where t is the number of test cases (1 t
100)and string1 is a string that provides you the details of each test case. The test cases are
23:52:19
time remaining
5/9/2014 Code Gladiators Hunt for India' s Best Coders
http://www.techgig.com/codegladiators/openparticipation/question/MzkyQCMkQCMkNTIxMzA3QCMkQCMkMTIyNzE3MUAjJEAjJDEzOTk2NTIwODNAIyRAIy 2/4
separated by a comma(,) as shown below
test_case1, test_case2, test_case3....
The data in each test case starts and end with brackets ( ). Between the braces lies the detail of
icelands, bridges icelands provides the name of all icelands in set form.
Here from example in the question it is
{A,B,C,D,E,F}
bridges provides the name of all bridges in set form.
Here from example in the question it is
{(A,C),(B,C),(C,E),(B,E),(B,D),(E,F)}.
You can assume that each Iceland has a different name.
Note : If Iceland is blank or not exist than read as a NA eg: {(A,C),(B,C),(NA)}.
Output Specification:
Output should be set of all critical bridges.
{(A,C),(B,D),(E,F)}
Note : If output is blank or no solution exist than return NA .
Examples
Example 1:
input1= 1
Input 2 = ({A,B,C,D,E,F},{(A,C),(B,C),(C,E),(B,E),(B,D),(E,F)})
Output = {(A,C),(B,D),(E,F)}
Example 2:
input1= 2
Input 2 = ({A,B,C},{(A,B),(B,C),(C,A)}),({A,B,C,D,E},{(A,B),(B,C),(C,A),(E,D),(D,A)})
Output = {{NA},{(A,D),(D,E)}}
Instructions:
Do not change the function and parameter names given in editor code.
Do not include any new libraries in the code.
You need to return the required output in the given function.
Return type must be the same as mentioned in the problem statement.
Do not print any variables in the code.
See sample problems & answers
5/9/2014 Code Gladiators Hunt for India' s Best Coders
http://www.techgig.com/codegladiators/openparticipation/question/MzkyQCMkQCMkNTIxMzA3QCMkQCMkMTIyNzE3MUAjJEAjJDEzOTk2NTIwODNAIyRAIy 3/4
Own Testcase Compile Submit
Round 1 : Intra Company/ Open round
Date: 1st Week of April to 1st Week of May
Location: Online competition
Duration: 3 Days
Intra Company: Participating companies
will conduct code contests for their
employees & identify the top coders for the
semi finals.
Open Round: Participants from all other
companies battle it out to reach the semi
finals
Round 2: Semi finals
Date: Third Week of May
Location: Online competition
Duration: 1 Day
Participants from various companies battle
it out to prove their technical chops
Top 40 participants move to the finals
Round 3: Finals
Date: First Week of June
Location: New Delhi
Duration: 1 Day
Offline event where nations best coders
compete to find the numero uno
How it Works ?
TBSL Network
Terms & Conditions | Contact Us
How it Works? FAQs Participating Companies Logout Visit Techgig

Das könnte Ihnen auch gefallen