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

            一本久道久久综合狠狠躁AV| 久久精品无码一区二区无码| 亚洲日本va午夜中文字幕久久| 久久久久国产精品人妻| 国产欧美一区二区久久| 国产精品亚洲综合久久| 久久国产精品-久久精品| 久久亚洲精品成人无码网站 | 久久久久无码专区亚洲av| 亚洲色欲久久久综合网| 香蕉久久久久久狠狠色| 久久久久女教师免费一区| 性高湖久久久久久久久| 一日本道伊人久久综合影| 国产精品久久久久乳精品爆| 久久人人爽人人爽人人片AV不| 亚洲午夜无码AV毛片久久| 99久久精品免费看国产一区二区三区| 久久亚洲精品中文字幕| 99精品国产综合久久久久五月天| 久久久久国色AV免费观看| 一本一道久久精品综合| 久久久久四虎国产精品| 国产一级做a爰片久久毛片| 久久亚洲精品成人AV| 久久人人爽爽爽人久久久| 久久久一本精品99久久精品66| 久久精品国产亚洲AV蜜臀色欲| 亚洲人成无码网站久久99热国产| 久久天天躁狠狠躁夜夜av浪潮| 久久国产免费| 亚洲国产成人精品91久久久| 污污内射久久一区二区欧美日韩| 久久无码一区二区三区少妇| 久久久青草青青国产亚洲免观| 久久亚洲国产成人精品无码区| 久久男人AV资源网站| 久久久久亚洲AV无码专区首JN| 看久久久久久a级毛片| 久久电影网一区| 亚洲国产精品无码久久久久久曰|