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

            久久精品国产只有精品66| 亚洲国产成人久久精品影视| 国产伊人久久| 国产精品一区二区久久精品涩爱 | 亚洲另类欧美综合久久图片区| 久久久99精品成人片中文字幕| 久久91精品国产91久| 精品久久久久久亚洲精品| 成人午夜精品久久久久久久小说| 久久国产精品偷99| 久久久久久夜精品精品免费啦| 色综合合久久天天综合绕视看| 久久久久久久久66精品片| 俺来也俺去啦久久综合网| 久久久国产亚洲精品| 久久国产精品久久国产精品| 久久夜色精品国产噜噜亚洲a| 久久国产一区二区| 久久99精品久久久久久hb无码| 色综合久久天天综线观看| 国产成年无码久久久久毛片| 日韩欧美亚洲综合久久| 国产香蕉97碰碰久久人人| 精品久久久久久无码中文字幕一区| 伊人久久精品影院| 久久99亚洲综合精品首页| 99久久99久久久精品齐齐| 97香蕉久久夜色精品国产| 国产精品伊人久久伊人电影| 精品久久久久久久| 狠狠色丁香久久综合五月| 国内精品久久久久影院日本| 亚洲AV无码久久精品色欲| 漂亮人妻被中出中文字幕久久| 久久久久亚洲AV成人网| 国产99久久精品一区二区| 精品久久人妻av中文字幕| 狠狠狠色丁香婷婷综合久久俺| 久久91精品国产91久久小草| 久久精品aⅴ无码中文字字幕重口| 7777精品久久久大香线蕉 |