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

            日韩精品无码久久久久久| 亚洲成色999久久网站| 久久久这里有精品| 国产美女亚洲精品久久久综合| 久久精品国产亚洲AV久| 狠狠色丁香婷综合久久| 久久久国产视频| 久久综合综合久久97色| 久久精品国产黑森林| 亚洲欧美日韩中文久久| 国产高清美女一级a毛片久久w | 少妇内射兰兰久久| 国产精品无码久久久久| 亚洲精品国精品久久99热一| 久久综合狠狠色综合伊人| 中文字幕无码久久人妻| 久久久精品国产sm调教网站| 午夜精品久久久久9999高清| 精品一区二区久久| 欧美丰满熟妇BBB久久久| 久久综合色区| 91亚洲国产成人久久精品网址| 色诱久久久久综合网ywww| 久久久久99这里有精品10| 久久久久久国产精品免费免费| 国产精品久久久久jk制服| 久久人与动人物a级毛片| 久久国产精品免费| 国产农村妇女毛片精品久久| 久久电影网一区| 久久er国产精品免费观看2| 日本人妻丰满熟妇久久久久久| 久久精品国产清自在天天线| 青青青青久久精品国产h久久精品五福影院1421 | 欧美777精品久久久久网| 一本色综合久久| 久久九九亚洲精品| 国产精品一久久香蕉国产线看观看| 亚洲精品无码久久一线| 午夜人妻久久久久久久久| 熟妇人妻久久中文字幕|