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

            欧美黑人激情性久久| 99久久精品国产一区二区 | 99久久er这里只有精品18| 亚洲国产精品久久久天堂 | 亚洲精品乱码久久久久久中文字幕 | 精品久久久久久无码中文野结衣| 精品精品国产自在久久高清 | 亚洲国产另类久久久精品| 色欲av伊人久久大香线蕉影院| 亚洲色欲久久久综合网东京热| 99久久精品国产一区二区| 国内精品久久久久影院一蜜桃| 青青草国产精品久久| 欧美午夜A∨大片久久| 久久精品免费一区二区| 国产V亚洲V天堂无码久久久| 久久青草国产手机看片福利盒子| 久久乐国产精品亚洲综合| 波多野结衣AV无码久久一区| 久久久久久免费一区二区三区 | 久久久久无码中| 狠狠色丁香久久婷婷综合_中| 狠狠色婷婷久久一区二区三区| 国产精品亚洲美女久久久| 亚洲AV日韩精品久久久久久久| 国产激情久久久久影院老熟女免费 | 久久人人爽人爽人人爽av| 久久超乳爆乳中文字幕| 久久人人爽人人爽人人片AV东京热| 久久久久亚洲AV无码永不| 久久久WWW成人免费精品| 久久偷看各类wc女厕嘘嘘| 久久亚洲AV永久无码精品| 久久午夜电影网| 国产一久久香蕉国产线看观看| 久久午夜福利无码1000合集| 精品多毛少妇人妻AV免费久久| 久久久精品国产sm调教网站| 久久精品国产亚洲av麻豆图片| 久久久久99精品成人片三人毛片| 久久久久夜夜夜精品国产|