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

            免费一级做a爰片久久毛片潮 | 国产成人精品久久免费动漫| 日韩人妻无码精品久久免费一| 亚洲乱码精品久久久久..| 色综合久久中文色婷婷| 久久久久九国产精品| 狠狠色丁香久久婷婷综合五月| 久久久久久一区国产精品| 久久无码专区国产精品发布| 色综合久久久久| 久久妇女高潮几次MBA| 日日狠狠久久偷偷色综合96蜜桃| 久久久久亚洲AV无码麻豆| 中文字幕精品久久| 亚洲国产天堂久久久久久| 狠狠色婷婷久久一区二区三区| 久久精品国产一区二区三区| 久久无码人妻一区二区三区 | 久久国产亚洲精品无码| 日本精品久久久久久久久免费| 国产精品青草久久久久婷婷| 久久人妻无码中文字幕| 久久久久亚洲精品天堂久久久久久| 精品999久久久久久中文字幕| 久久国产亚洲高清观看| 久久亚洲精品无码VA大香大香| 999久久久国产精品| 久久精品不卡| 久久精品国产99国产精品| 国产欧美一区二区久久| 久久国产色AV免费看| 99久久国产热无码精品免费| 久久精品一本到99热免费| 天天躁日日躁狠狠久久 | 久久精品夜夜夜夜夜久久| 久久久亚洲欧洲日产国码aⅴ| 久久精品日日躁夜夜躁欧美 | 99久久夜色精品国产网站| 91久久精品电影| 国产亚洲美女精品久久久| 香蕉99久久国产综合精品宅男自|