• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            Network of Schools

            Description

            A number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it distributes software (the “receiving schools”). Note that if B is in the distribution list of school A, then A does not necessarily appear in the list of school B
            You are to write a program that computes the minimal number of schools that must receive a copy of the new software in order for the software to reach all schools in the network according to the agreement (Subtask A). As a further task, we want to ensure that by sending the copy of new software to an arbitrary school, this software will reach all schools in the network. To achieve this goal we may have to extend the lists of receivers by new members. Compute the minimal number of extensions that have to be made so that whatever school we send the new software to, it will reach all other schools (Subtask B). One extension means introducing one new member into the list of receivers of one school.

            Input

            The first line contains an integer N: the number of schools in the network (2 <= N <= 100). The schools are identified by the first N positive integers. Each of the next N lines describes a list of receivers. The line i+1 contains the identifiers of the receivers of school i. Each list ends with a 0. An empty list contains a 0 alone in the line.

            Output

            Your program should write two lines to the standard output. The first line should contain one positive integer: the solution of subtask A. The second line should contain the solution of subtask B.

            Sample Input

            5 2 4 3 0 4 5 0 0 0 1 0 

            Sample Output

            1 2 

            Source


            adjacnet Matric

            posts - 3, comments - 1, trackbacks - 0, articles - 16

            Copyright © lenohoo

            青草影院天堂男人久久| 久久经典免费视频| 久久综合九色综合97_久久久| 嫩草伊人久久精品少妇AV| 国产99久久精品一区二区| 久久久WWW成人免费精品| 国产亚洲精品久久久久秋霞| 国产婷婷成人久久Av免费高清| 久久久久国产亚洲AV麻豆| 亚洲国产精品无码久久一区二区| 久久亚洲国产中v天仙www| 久久久这里有精品| 国产精品无码久久四虎| 午夜精品久久久久久99热| 久久久噜噜噜久久| 香港aa三级久久三级| 日韩乱码人妻无码中文字幕久久| 久久涩综合| 精品综合久久久久久88小说| 99久久99久久精品免费看蜜桃| 性做久久久久久久久久久| 丁香久久婷婷国产午夜视频| 亚洲AV无码1区2区久久 | 久久99精品久久久久久久久久| 91精品无码久久久久久五月天| 无码精品久久久久久人妻中字| 亚洲精品国产自在久久| 久久久久99精品成人片三人毛片| 97精品国产91久久久久久| 日韩精品久久无码中文字幕| 久久久久久久久久久精品尤物| 久久久久亚洲av毛片大| 久久久99精品成人片中文字幕| 激情伊人五月天久久综合| 亚洲AV无码一区东京热久久 | 色综合久久精品中文字幕首页| 奇米影视7777久久精品| 久久精品天天中文字幕人妻 | 99国产欧美久久久精品蜜芽| 人妻无码中文久久久久专区| 蜜臀av性久久久久蜜臀aⅴ麻豆 |