• <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

            国产精品亚洲综合专区片高清久久久| 99久久99久久精品国产片果冻| 久久亚洲精品国产精品婷婷| 99久久国产综合精品女同图片| 麻豆亚洲AV永久无码精品久久| 国产A级毛片久久久精品毛片| 久久亚洲国产最新网站| 精品久久久久久亚洲| 久久久久亚洲av成人网人人软件| 国产精品99久久精品| 亚洲精品成人久久久| 久久99精品国产99久久| 国产精品一区二区久久精品涩爱| 久久综合九色综合97_久久久| 亚洲日本va中文字幕久久| 久久国产三级无码一区二区| 一本色道久久综合狠狠躁| 亚洲国产成人久久精品99 | 久久久婷婷五月亚洲97号色 | 99国产精品久久| 久久久久精品国产亚洲AV无码| 观看 国产综合久久久久鬼色 欧美 亚洲 一区二区 | 亚洲日本va午夜中文字幕久久 | 日本精品久久久久影院日本| 久久国产精品一国产精品金尊| 日产久久强奸免费的看| 久久久久国产精品麻豆AR影院| 91久久精品无码一区二区毛片| 国内精品久久久人妻中文字幕| 久久久久国产精品熟女影院 | 亚洲国产成人久久一区久久| 久久精品国产亚洲麻豆| 国产精品久久永久免费| 久久av无码专区亚洲av桃花岛| 亚洲AV日韩精品久久久久久| 久久久久亚洲国产| 精品久久久无码人妻中文字幕 | 亚洲国产精品无码久久一线| 日产精品久久久一区二区| 久久精品亚洲中文字幕无码麻豆 | 蜜桃麻豆www久久国产精品|