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

            coreBugZJ

            此 blog 已棄。

            KILLER,HUST Monthly 2011.04.09 之 B,1432

            KILLER

            Time Limit: 1 Sec Memory Limit: 128 MB
            Submissions: 519 Solved: 147

            Description

            There are n Killers in a city.Each killer want to kill a killer(maybe a suicide) and if A want to kill B , there will not be another killer want to kill B. Killers kill their aim by turn and we ensure that in the end ,there will be at most one killer still alive. If there is one killer not be killed in the end, he will be the king of killer.Can you tell me the number of killer who can be the king of killer?

             

            Input

             

            The first line is an integer T indicating the number of test cases.

            Next T block, each block is a test case.

            First line of each block is a integer N ( 1 <= N <= 100000 )

            Followed by N lines, each line is two integers A B , indicating that A will kill B.

             

            Output

            The number of killer who can be the king of killer.

             

            Sample Input

            2
            2
            1 2
            2 1
            1
            1 1

            Sample Output

            2
            0
             
             1#include <iostream>
             2#include <cstdio>
             3
             4using namespace std;
             5
             6int main() {
             7        int td, n, ans, a, b;
             8        scanf( "%d"&td );
             9        while ( td-- > 0 ) {
            10                scanf( "%d"&n );
            11                ans = n;
            12                while ( n-- > 0 ) {
            13                        scanf( "%d%d"&a, &b );
            14                        if ( a == b ) {
            15                                --ans;
            16                        }

            17                }

            18                printf( "%d\n", ans );
            19        }

            20        return 0;
            21}

            22

            posted on 2011-04-09 19:07 coreBugZJ 閱讀(137) 評論(0)  編輯 收藏 引用 所屬分類: ACM

            一级做a爱片久久毛片| 久久香蕉超碰97国产精品| 亚洲国产综合久久天堂| 亚洲精品无码久久一线| 亚洲国产成人久久综合一| 模特私拍国产精品久久| 99久久免费国产精精品| yy6080久久| 狠狠精品干练久久久无码中文字幕 | 久久精品免费网站网| 久久人人爽人人爽人人片AV不| 精品人妻久久久久久888| 久久免费大片| 久久久无码精品亚洲日韩按摩| 久久综合久久伊人| 大香网伊人久久综合网2020| 亚洲精品午夜国产VA久久成人| 青青久久精品国产免费看| 久久精品欧美日韩精品| 久久久久久国产精品无码下载| 国产精品美女久久久网AV| 国产V综合V亚洲欧美久久| 国产激情久久久久久熟女老人| 久久国产精品波多野结衣AV| 亚洲国产精品久久久久久| 久久国产色AV免费看| 久久精品国产2020| 伊人色综合久久天天网| 亚洲国产精品综合久久网络| 99久久精品九九亚洲精品| 亚洲国产成人久久精品影视| 久久香蕉国产线看观看乱码| 久久青青草原国产精品免费| 97久久超碰国产精品旧版| 国产综合久久久久久鬼色| 久久成人国产精品| 久久99国产综合精品| av午夜福利一片免费看久久| 99国产欧美精品久久久蜜芽| 精品国产91久久久久久久| 国内精品久久久久影院网站|