CCC '01 S3 - Strategic Bombing

View as PDF

Submit solution

Points: 10
Time limit: 1.0s
Memory limit: 16M

Problem type
Canadian Computing Competition: 2001 Stage 1, Junior #5, Senior #3

The Enemy relies heavily on the transportation of supplies and personnel between the specific points A and B. Points A and B, as well as other points C, D, E, etc. are linked by a network of roads. Your mission, should you accept it, is to identify a single road that may be bombed in order to cut off all traffic between A and B.

In the input, each point is identified by a single upper-case letter (there is a maximum of 26). Each line of input identifies a pair of points connected by a road. The end of input is indicated by a line containing **. All roads are two-way, that is, road AC is the same as road CA. There is at most one road between any pair of points.

Your output should identify all roads such that bombing any one of them would halt all traffic between A and B. Your output should list the roads, one per line, followed by a line stating that There are n disconnecting roads., where nn is the number of such roads. If there is no such road, output There are 0 disconnecting roads..

Sample Input


Sample Output

There are 2 disconnecting roads.


  • 0
    DynamicSquid  commented on March 27, 2021, 2:21 p.m.

    I'm getting WA on test case #3 and #4. Does anyone know why?

  • 3
    OneYearOld  commented on Jan. 10, 2021, 11:59 a.m.

    If you don't put a newline at the end of "There are n disconnecting roads" the program will mark your answer as WA.

  • 0
    Dr_Dabbidy  commented on Nov. 23, 2020, 11:55 a.m. edited

    I'm getting an IR (abnormal termination) error, but every test case I've tried works... I even looked to external sites for test data. What does this error entail? (EDIT: I fixed this error)

    • 8
      Evanhyd  commented on Dec. 17, 2020, 7:21 p.m.

      Do your mind sharing the reason for that? So other people may avoid similar problems

  • 9
    luke3359767  commented on Aug. 19, 2020, 4:48 p.m.

    I got all AC although my code has problems

  • 1
    devnarula  commented on June 26, 2020, 11:15 p.m. edit 2

    Can anyone tell whats the issue with my code? I am getting WA on test case #2 and test case #5.

    (Edit: Nvm I figured it out, it was an issue with my loop and repetition)

  • 3
    d3story  commented on June 5, 2020, 7:57 p.m.

    I forgot one period lmao...

  • 16
    milan3sa  commented on May 31, 2020, 2:42 p.m.

    I love it how this was a 2001 problem

  • 23
    Aaeria  commented on Oct. 20, 2019, 2:46 p.m.

    The last sentence must end with a new line. Otherwise, you will get WA and not presentation error.

  • 1
    31501357  commented on March 20, 2019, 11:06 a.m.

    If I print FC instead of CF. Would that still be correct?

    • 2
      p1geon  commented on March 20, 2019, 1:52 p.m.

      road AC is the same as road CA.

      • 46
        Rimuru  commented on March 22, 2019, 9:19 a.m.

        But the road to AC involves WA, TLE, IR, MLE, and last but not least, IE!

        • 8
          p1geon  commented on March 22, 2019, 9:43 a.m.

          I'm in the same room as you.

  • 6
    SananR  commented on Oct. 3, 2018, 4:21 p.m.

    Keep getting test case #2 and #5 wrong, help please

  • 4
    MasterIlluminati  commented on Aug. 2, 2018, 6:02 p.m.

    What are the limits on the lines of input?

  • 7
    isoffline  commented on Dec. 21, 2017, 12:08 p.m.

    No judge is available for this problem. When will it be fixed?

    • 20
      Kirito  commented on Dec. 21, 2017, 3:12 p.m.

      Issue is resolved.

      • -21
        Dordor1218  commented on March 23, 2018, 5:58 p.m. edited

        This comment is hidden due to too much negative feedback. Click here to view it.

  • 21
    Kirito  commented on Oct. 2, 2016, 10:20 p.m. edit 2

    Checker has been fixed, and solutions have been rejudged.

    • 1
      Chensta  commented on Dec. 21, 2017, 10:13 p.m.

      Why is Kirito being downvoted? Mistakes happen