日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

Flying to the Mars

發(fā)布時(shí)間:2025/3/16 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Flying to the Mars 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

題目描述


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 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);

輸出

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

樣例輸入

4 10 20 30 04 5 2 3 4 3 4

樣例輸出

1 2

AC代碼:

#include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> #include<map>using namespace std; int main() {int n,i,j,k;map<int ,int>m;while(~scanf("%d",&n)){m.clear();k=INT_MIN;for(i=0;i<n;i++){scanf("%d",&j);m[j]++;k=max(m[j],k);}printf("%d\n",k);}return 0; }


與50位技術(shù)專家面對(duì)面20年技術(shù)見證,附贈(zèng)技術(shù)全景圖

總結(jié)

以上是生活随笔為你收集整理的Flying to the Mars的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 超碰成人在线免费观看 | 日韩激情视频网站 | 久久情趣视频 | 免费黄色短片 | 欧美乱大交xxxxx潮喷l头像 | 九九爱精品 | 亚洲人 女学生 打屁股 得到 | 亚洲图片在线播放 | 日日射日日操 | 欧美激情一区二区三级高清视频 | 内射一区二区 | 久久国产精品国语对白 | 玖玖999| www国产在线 | 欧美另类一区 | 成人免费xxxxx在线观看 | 护士的小嫩嫩好紧好爽 | 国产一区二区三区四区五区美女 | 五月婷婷导航 | 精品少妇爆乳无码av无码专区 | 日韩视频一二三区 | 综合婷婷| 亲子乱aⅴ一区二区三区 | 久久91精品国产 | 麻豆91精品 | 中文字幕色哟哟 | 五月天婷婷爱 | 黄色一级大片在线观看 | 中国一区二区视频 | 中文字幕日本一区二区 | 国产99在线 | 成年人av在线播放 | 亚洲中文字幕无码爆乳av | 黑人精品一区二区三区不 | 精品人妻无码一区二区三区换脸 | av影视在线观看 | 神马久久香蕉 | av在线官网 | 激情五月视频 | 亚洲第十页 | 国内三级在线 | 草逼视频网 | 香蕉综合视频 | 一区二区在线播放视频 | 韩国av免费在线观看 | 久久精品电影 | 伊人久久大香线蕉综合网站 | 日本电影大尺度免费观看 | avtt久久 | 亚洲综合成人在线 | 青青成人在线 | 俺来也av | 黄色一级片免费看 | 精品国产区 | 风流少妇一区二区三区91 | 国产农村妇女毛片精品久久麻豆 | 99热这里只有精品7 青青草社区 | 在线观看欧美成人 | 人人干人人搞 | 男男受被啪到高潮自述 | av黄色国产 | 美女野外找人搭讪啪啪 | 国产伦精品一区二区三区妓女下载 | 天天干狠狠操 | 五月婷婷视频在线 | 天天干夜夜怕 | 加勒比日韩 | 在线观看亚洲一区 | 蜜桃网av| 日韩另类视频 | av av片在线看 | 男人添女人下部高潮全视频 | 在线亚洲区 | 国产第20页 | 日本黄色网页 | 神马午夜888 | 番号动态图 | 国产影视一区二区 | 日韩欧美精品中文字幕 | 狠狠干2022 | 香蕉网在线 | 天天爱天天插 | 中文字字幕一区二区三区四区五区 | 尤物在线 | 精品人妻少妇AV无码专区 | 日本电影一区二区三区 | 国产亲伦免费视频播放 | 久久综合亚洲色hezyo国产 | 国内精品视频在线播放 | 久久久久久久久久久久久女过产乱 | 国产不卡视频在线播放 | 性a视频 | 中文成人无字幕乱码精品区 | 亚洲网站在线观看 | 一级黄色伦理片 | 在线视频一区二区三区 | 成人a级网站| 欧美一级不卡视频 | 免费观看视频一区二区 |