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

            久久这里只有精品久久| 久久精品国产影库免费看 | 奇米综合四色77777久久| 中文字幕久久亚洲一区| 久久久人妻精品无码一区| 久久r热这里有精品视频| 亚洲国产另类久久久精品黑人| 亚洲国产成人久久精品99| 日本高清无卡码一区二区久久| 久久久精品波多野结衣| 久久久久无码精品国产app| 久久精品综合一区二区三区| 日日狠狠久久偷偷色综合免费| 久久精品国产只有精品66 | 日日躁夜夜躁狠狠久久AV| 久久久久亚洲Av无码专| 久久夜色精品国产噜噜麻豆 | 色欲综合久久中文字幕网| 欧美噜噜久久久XXX| 99久久99久久精品国产片果冻| 精品久久国产一区二区三区香蕉| 国内精品久久久久久久涩爱| 色播久久人人爽人人爽人人片aV| 亚洲人成无码www久久久| 亚洲欧美成人综合久久久 | 99久久精品费精品国产一区二区| 97超级碰碰碰碰久久久久| 青春久久| 久久99国产精品尤物| 国产视频久久| 久久久久亚洲AV片无码下载蜜桃| 久久久久成人精品无码中文字幕| 国产亚洲欧美精品久久久| 岛国搬运www久久| 久久精品国产男包| 国内精品久久久久久久亚洲| 伊人久久久AV老熟妇色| 国产精品gz久久久| 精品熟女少妇a∨免费久久| 国产亚洲色婷婷久久99精品91| 99久久香蕉国产线看观香|