多多色-多人伦交性欧美在线观看-多人伦精品一区二区三区视频-多色视频-免费黄色视屏网站-免费黄色在线

國(guó)內(nèi)最全I(xiàn)T社區(qū)平臺(tái) 聯(lián)系我們 | 收藏本站
阿里云優(yōu)惠2
您當(dāng)前位置:首頁(yè) > 互聯(lián)網(wǎng) > UVA 6662 The Last Ant(模擬退火)

UVA 6662 The Last Ant(模擬退火)

來(lái)源:程序員人生   發(fā)布時(shí)間:2014-10-04 08:00:01 閱讀次數(shù):2953次
A straight tunnel without branches is crowded with busy ants coming and going. Some ants walk left
to right and others right to left. All ants walk at a constant speed of 1 cm/s. When two ants meet, they
try to pass each other. However, some sections of the tunnel are narrow and two ants cannot pass each
other. When two ants meet at a narrow section, they turn around and start walking in the opposite
directions. When an ant reaches either end of the tunnel, it leaves the tunnel.
The tunnel has an integer length in centimeters. Every narrow section of the tunnel is integer
centimeters distant from the both ends. Except for these sections, the tunnel is wide enough for ants to
pass each other. All ants start walking at distinct narrow sections. No ants will newly enter the tunnel.
Consequently, all the ants in the tunnel will eventually leave it. Your task is to write a program that
tells which is the last ant to leave the tunnel and when it will.
Figure B.1 shows the movements of the ants during the first two seconds in a tunnel 6 centimeters
long. Initially, three ants, numbered 1, 2, and 3, start walking at narrow sections, 1, 2, and 5 centimeters
distant from the left end, respectively. After 0.5 seconds, the ants 1 and 2 meet at a wide section, and
they pass each other. Two seconds after the start, the ants 1 and 3 meet at a narrow section, and they
turn around.
Figure B.1 corresponds to the first dataset of the sample input.
Figure B.1. Movements of ants
Input
The input consists of one or more datasets. Each dataset is formatted as follows.
n l
d1 p1
d2 p2
.
.
.
dn pnACM-ICPC Live Archive: 6662
生活不易,碼農(nóng)辛苦
如果您覺(jué)得本網(wǎng)站對(duì)您的學(xué)習(xí)有所幫助,可以手機(jī)掃描二維碼進(jìn)行捐贈(zèng)
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關(guān)閉
程序員人生
主站蜘蛛池模板: 亚洲视频在线观看不卡 | 亚洲成人偷拍 | 国产中的精品一区的 | 欧美一区二区三区精品国产 | 伊人99| 日本性一级 | 亚洲日本天堂 | 亚洲黄色免费网站 | 国产高清精品一区 | 日本护士xxxx18.19 | 久久ri精品高清一区二区三区 | 操久| 亚洲第一页在线观看 | 国产精品视频一区二区三区w | 亚洲精品国产第一区第二区国 | 久久精品国产福利国产琪琪 | 中文乱码字幕午夜无线观看 | 手机看片福利国产 | 美国毛片免费看 | 欧美成人一区二区三区在线视频 | 欧美视频在线一区二区三区 | 黑人性xx| 中文字幕在线永久在线视频2020 | 日本特黄特色大片免费播放视频 | 精品一区二区久久久久久久网站 | 亚洲三级图 | 伊人久久大香线蕉精品哪里 | 最新国产一区二区精品久久 | 激情在线观看视频 | 久久天天躁夜夜躁狠狠躁2020 | 亚洲综合视频 | 日本xxxwww色视频 | 在线人成精品免费视频 | 国产欧美日韩第一页 | 免费一级毛片在级播放 | 老司机精品视频午夜免费视频 | 爱爱小视频在线观看网站 | 久久久男人天堂 | 成年人视频在线观看免费 | 国产日韩不卡免费精品视频 | 欧美在线看欧美视频免费网站 |