• <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 閱讀(140) 評論(0)  編輯 收藏 引用 所屬分類: ACM

            精品国产91久久久久久久| 人妻少妇精品久久| 亚洲欧美日韩中文久久 | 国内精品免费久久影院| 天天综合久久久网| 欧美黑人激情性久久| 91精品国产91久久久久福利| 久久精品国产99久久久香蕉| 久久精品视频一| 99久久无码一区人妻| 久久久久亚洲AV无码专区首JN| 久久99热国产这有精品| 思思久久99热只有频精品66| 91亚洲国产成人久久精品| 久久天天躁夜夜躁狠狠躁2022| 久久99国产精品一区二区| 久久久久波多野结衣高潮| 国产成人精品综合久久久| 久久夜色精品国产噜噜麻豆| 色综合久久中文字幕综合网| 青青草国产精品久久| 久久人人爽爽爽人久久久| 精品综合久久久久久98| 久久毛片免费看一区二区三区| 国产精品99久久精品| 久久这里的只有是精品23| 久久综合色区| 久久久久这里只有精品| 日本精品久久久中文字幕| 国内精品伊人久久久久| 久久国产乱子伦免费精品| 久久综合给合久久狠狠狠97色| 怡红院日本一道日本久久 | 国产国产成人久久精品| 久久人人爽人人爽人人片AV不 | 久久综合九色综合欧美就去吻| 久久九九全国免费| 久久青青草原精品影院| 久久精品九九亚洲精品天堂 | 亚洲∧v久久久无码精品| 一本一本久久a久久综合精品蜜桃|