青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

ACM___________________________

______________白白の屋
posts - 182, comments - 102, trackbacks - 0, articles - 0
<2010年8月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
2930311234

常用鏈接

留言簿(24)

隨筆分類(332)

隨筆檔案(182)

FRIENDS

搜索

積分與排名

最新隨筆

最新評論

閱讀排行榜

評論排行榜

MiYu原創, 轉帖請注明 : 轉載自 ______________白白の屋    

 

題目地址:

      http://acm.hdu.edu.cn/showproblem.php?pid=1800 

題目描述:

Problem Description

In the year 8888, the Earth is ruled by the PPF Empire . As the population growing , PPF needs to find more land for the newborns . Finally , PPF decides to attack Kscinow who ruling the Mars . Here the problem comes! How can the soldiers reach the Mars ? PPF convokes his soldiers and asks for their suggestions . “Rush … ” one soldier answers. “Shut up ! Do I have to remind you that there isn’t any road to the Mars from here!” PPF replies. “Fly !” another answers. PPF smiles :“Clever guy ! Although we haven’t got wings , I can buy some magic broomsticks from HARRY POTTER to help you .” Now , it’s time to learn to fly on a broomstick ! we assume that one soldier has one level number indicating his degree. The soldier who has a higher level could teach the lower , that is to say the former’s level > the latter’s . But the lower can’t teach the higher. One soldier can have only one teacher at most , certainly , having no teacher is also legal. Similarly one soldier can have only one student at most while having no student is also possible. Teacher can teach his student on the same broomstick .Certainly , all the soldier must have practiced on the broomstick before they fly to the Mars! Magic broomstick is expensive !So , can you help PPF to calculate the minimum number of the broomstick needed .
For example : 
There are 5 soldiers (A B C D E)with level numbers : 2 4 5 6 4;
One method :
C could teach B; B could teach A; So , A B C are eligible to study on the same broomstick.
D could teach E;So D E are eligible to study on the same broomstick;
Using this method , we need 2 broomsticks.
Another method:
D could teach A; So A D are eligible to study on the same broomstick.
C could teach B; So B C are eligible to study on the same broomstick.
E with no teacher or student are eligible to study on one broomstick.
Using the method ,we need 3 broomsticks.
……

After checking up all possible method, we found that 2 is the minimum number of broomsticks needed. 
 

Input
Input file contains multiple test cases. 
In a test case,the first line contains a single positive number N indicating the number of soldiers.(0<=N<=3000)
Next N lines :There is only one nonnegative integer on each line , indicating the level number for each soldier.( less than 30 digits);
 

Output
For each case, output the minimum number of broomsticks on a single line.
 

Sample Input
4 10 20 30 04 5 2 3 4 3 4
 

Sample Output
1 2
 

題目分析:

 

相對來說這題用字典樹的效率比較高些.....遺憾的是我現在只會做一些字典樹的 水題....對字典樹的理解現在還不是很好......所以,呵呵

這題我就直接篩選過了........

 

代碼如下:

 /*

MiYu原創, 轉帖請注明 : 轉載自 ______________白白の屋

          http://www.cnblog.com/MiYu

Author By : MiYu

Test      : 1

Program   : 1800

*/


#include <iostream>

#include <algorithm>

using namespace std;

int num[3002];

bool hash[3002];

bool cmp ( const int &a, const  int &b )

{

     return a > b; 

}

int main ()

{

    int N;

    while ( scanf ( "%d", &N ) != EOF )

    {

           memset ( num, 0, 12008 );

           memset ( hash, 0, 3002 );

           for ( int i = 0; i != N; ++ i )

                 scanf ( "%d",num + i );

           sort ( num, num + N, cmp );

           int nCount = 0;

           for ( int i = 0; i < N; ++ i )

           {

                 if ( !hash[i] )

                 {

                      nCount ++;

                      int j = i ,k = j+1;

                      hash[j] = true;

                      while ( k < N ) 

                      {

                            if ( !hash[k] && num[k] < num[j] )

                            {

                                 hash[k] = true;

                                 j = k;

                            }

                            k++;

                      } 

                 }

           } 

           printf ( "%d\n",nCount );

    }

    return 0;

}


 

 

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            亚洲欧美999| 欧美日韩免费观看一区| 欧美午夜免费影院| 亚洲视频在线观看视频| 99视频一区二区| 国产性色一区二区| 欧美激情亚洲一区| 国产精品毛片高清在线完整版| 欧美一区网站| 欧美成人在线网站| 午夜视频在线观看一区二区| 狂野欧美激情性xxxx欧美| 日韩午夜高潮| 久久久久久尹人网香蕉| 亚洲一区二区视频| 欧美jizz19hd性欧美| 欧美中文在线免费| 欧美日韩一卡| 亚洲国产天堂久久综合| 国产一区二区日韩精品| 99香蕉国产精品偷在线观看| 在线欧美小视频| 亚洲欧美日韩综合aⅴ视频| 久久人人爽人人爽爽久久| 久久精品成人一区二区三区| 亚洲美女视频网| 国产精品青草综合久久久久99| 久久青草久久| 国产欧美日韩视频在线观看| 亚洲精品你懂的| 亚洲欧美日韩综合一区| 亚洲成人在线网| 亚洲一区二区精品视频| 欧美国产一区在线| 国产精品爽爽ⅴa在线观看| 亚洲电影av| 国内偷自视频区视频综合| 一区二区三区日韩欧美精品| 一本色道久久精品| 国产精品欧美激情| 欧美日韩精品免费观看| 亚洲视频电影图片偷拍一区| 夜夜嗨av一区二区三区| 欧美一区二区三区的| 亚洲第一天堂无码专区| 欧美一区影院| 亚洲天堂久久| 欧美成人有码| 欧美黄色网络| 精品不卡在线| 香蕉久久国产| 午夜国产精品视频免费体验区| 欧美成人综合网站| 久久天天综合| 国产欧美日韩精品a在线观看| 一区二区精品在线| 宅男66日本亚洲欧美视频| 欧美成人亚洲成人| 亚洲国产精品激情在线观看| 亚洲高清一二三区| 快播亚洲色图| 亚洲黄色成人| 99热在线精品观看| 欧美久久成人| 亚洲免费观看| 在线亚洲国产精品网站| 欧美日本一道本| 99热这里只有成人精品国产| 亚洲一区制服诱惑| 国产美女精品视频| 久久九九精品99国产精品| 欧美成人免费播放| 一区二区三区欧美在线观看| 国产精品亚洲а∨天堂免在线| 欧美伊人久久久久久午夜久久久久| 亚洲欧美日韩第一区| 国产一区二区电影在线观看| 久久综合伊人77777| 欧美电影在线播放| 亚洲视频一区二区| 国产精品一区视频| 国产精品自拍三区| 亚洲激精日韩激精欧美精品| 亚洲人成网在线播放| 欧美日韩亚洲在线| 香蕉亚洲视频| 亚洲国产精品专区久久| 亚洲专区在线| 国产亚洲综合精品| 免费在线观看成人av| 一区二区三区黄色| 久久综合九色欧美综合狠狠| 亚洲精品你懂的| 国产精品久久影院| 久久蜜桃香蕉精品一区二区三区| 亚洲国产精品福利| 欧美亚洲一区三区| 国内精品嫩模av私拍在线观看| 蜜桃久久av| 午夜欧美电影在线观看| 亚洲激情第一页| 久久综合九色综合欧美狠狠| 亚洲性色视频| 亚洲精品欧美极品| 国内外成人免费激情在线视频| 欧美日韩午夜视频在线观看| 久久亚洲国产成人| 亚洲愉拍自拍另类高清精品| 亚洲电影免费在线观看| 午夜精品一区二区三区在线播放| 伊人一区二区三区久久精品| 欧美激情综合色| 久久久99精品免费观看不卡| 亚洲一区视频在线| 亚洲人久久久| 欧美插天视频在线播放| 久久成人一区| 亚洲一区二区在线播放| 亚洲激情av| 精品二区久久| 91久久一区二区| 欧美成va人片在线观看| 欧美激情自拍| 久久精品日韩欧美| 亚洲综合视频一区| 一本色道88久久加勒比精品| 一区精品在线| 国产在线精品二区| 国产农村妇女精品一二区| 久久一区中文字幕| 欧美一区三区三区高中清蜜桃| 99精品欧美一区二区三区综合在线| 免费成人高清| 久久婷婷国产综合精品青草| 亚洲欧美精品| 亚洲一线二线三线久久久| 这里只有精品电影| 亚洲一区二区伦理| 日韩亚洲在线观看| 亚洲美女精品成人在线视频| 亚洲第一精品夜夜躁人人躁| 在线看欧美日韩| 亚洲电影免费观看高清| 在线欧美视频| 亚洲精品护士| 国产伦精品一区二区三区免费迷| 欧美日韩综合在线免费观看| 欧美激情精品| 欧美日韩免费在线| 欧美日韩免费观看中文| 欧美亚韩一区| 国产精品视频xxxx| 国产一区二区三区高清| 狠狠色狠狠色综合日日91app| 狠狠做深爱婷婷久久综合一区| 一区二区亚洲精品国产| 亚洲国产日韩欧美在线动漫| 久久资源在线| 91久久黄色| 久久高清免费观看| 男同欧美伦乱| 久久aⅴ国产紧身牛仔裤| 在线观看欧美| 国产精品一国产精品k频道56| 精品va天堂亚洲国产| 韩国一区二区三区美女美女秀| 欧美区一区二| 欧美日本国产精品| 免费成人美女女| 亚洲精品欧美一区二区三区| 毛片av中文字幕一区二区| 亚洲尤物在线| 亚洲午夜久久久久久久久电影院| 麻豆乱码国产一区二区三区| 亚洲国产精品va在线观看黑人| 欧美精品午夜| 美日韩免费视频| 亚洲一区二区三区视频| 欧美激情一二三区| 午夜精品福利视频| 激情亚洲成人| 欧美性猛交xxxx乱大交蜜桃| 欧美理论在线播放| 亚洲激情啪啪| 亚洲日本成人| 欧美高清视频www夜色资源网| 亚洲一区三区电影在线观看| 国产精品久久久久999| 国产精品福利影院| 国产精品久久久久国产a级| 久久久久久久欧美精品| 一区二区三区免费看| 欧美一级视频| 国产情人综合久久777777| 欧美在线91| 欧美/亚洲一区| 在线亚洲欧美视频| 久久综合九色欧美综合狠狠| 欧美三级乱人伦电影| 永久免费毛片在线播放不卡|