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

            激情五月综合综合久久69| 国产精品成人久久久| 国产午夜福利精品久久2021| 久久久噜噜噜久久中文福利| 久久国产成人精品麻豆| 久久久久国产亚洲AV麻豆| 久久中文字幕人妻熟av女| 久久99国产精品久久99| 要久久爱在线免费观看| 97久久精品国产精品青草| 三级韩国一区久久二区综合| 69SEX久久精品国产麻豆| 欧美午夜A∨大片久久| 久久99久久99小草精品免视看| 国内精品久久国产| 91精品国产91久久久久久蜜臀| 超级碰碰碰碰97久久久久| 成人国内精品久久久久影院VR| 亚洲国产另类久久久精品小说| 久久精品这里只有精99品| 69久久精品无码一区二区| 国产色综合久久无码有码| 久久久久亚洲AV成人网| 久久亚洲国产中v天仙www| 69国产成人综合久久精品| 综合网日日天干夜夜久久 | 精品视频久久久久| 精品久久久久久成人AV| 综合人妻久久一区二区精品| 欧美精品九九99久久在观看| 国产叼嘿久久精品久久| 94久久国产乱子伦精品免费 | 亚洲αv久久久噜噜噜噜噜| 久久精品夜色噜噜亚洲A∨| 国产精品伊人久久伊人电影| 久久亚洲欧美日本精品| 国产午夜久久影院| 国内精品伊人久久久久av一坑| 久久婷婷激情综合色综合俺也去| 久久中文字幕人妻丝袜| 亚洲中文字幕无码久久2017|