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

Problem A : Air Conditioning Machinery

You are a technician for the Air Conditioning Machinery company (ACM). Unfortunately, when you arrive at a customer site to install some air conditioning ducts, you discover that you are running low on supplies. You have only six duct segments, and they are all of the same kind, called an “elbow.”

You must install a duct in a confined space: a rectangular prism whose sides are multiples of a unit length. Think of the confined space as consisting of an array of unit cubes. Each elbow occupies exactly four unit cubes, as shown in Figure 1 below. A unit cube can be occupied by at most one elbow. Each elbow has exactly two openings, as indicated by the gray squares in the elbow shown in Figure 1. You may assemble the elbows into longer ducts, but your duct must be completely contained inside the given space. One way to connect two elbows is shown in Figure 2. Your task is to connect an inflow to an outflow. The inflow and the outflow are located on the exterior surface of the confined space, aligned with the unit cubes, as shown in Figure 3. To keep expenses down, you must accomplish this task while using the minimum number of elbows.
Input
The input consists of several test cases, each of which consists of a single line containing eleven input values separated by blanks. The input values for each test case are as follows.

The first three input values are integers (xBmaxB, yBmaxB, and zBmaxB) that indicate the size of the confined space in the x, y, and z dimensions, respectively. Each unit cube in the confined space can be identified by coordinates (x, y, z) where 1 ≤ x ≤ xBmaxB, 1 ≤ y ≤ yBmaxB, and 1 ≤ z ≤ zBmaxB. xBmaxB, yBmaxB, and zBmaxB are all positive and not greater than 20.

The next three input values are integers that indicate the location of the inflow by identifying the x, y, and z coordinates of the unit cube that connects to the inflow.

The next input value is a two-character string that indicates the direction of the inward flow, using one of the following codes: +x, -x, +y, -y, +z, -z. The inflow connection is on the face of the unit cube that receives this inward flow. For example, if the data specifies an inflow direction of +y, the inflow connection is on the face of the unit cube that faces in the negative y direction. The next three input values are integers that indicate the location of the outflow by identifying the x, y, and z coordinates of the unit cube that connects to the outflow.

The last input value is a two-character string that indicates the direction of the outward flow, using the same codes described above. The outflow connection is on the face of the unit cube that generates this outward flow. For example, if the data specifies an outflow direction of +y, the outflow connection is on the face of the unit cube that faces in the positive y direction.

The last line of the input file consists of a single zero to indicate end of input.

Output
For each test case, print the case number (starting with 1) followed by the minimum number of elbows that are required to connect the inflow to the outflow without going outside the confined space. If the task cannot be accomplished with your supply of six elbow segments, print the word TImpossibleT instead. Use the format in the sample data.

Sample Input
5 4 3 3 1 1 +z 5 4 3 +x
5 4 3 3 1 1 +z 1 2 3 -x
0

Output for the Sample Input
Case 1: 2
Case 2: Impossible 

    題意很簡單:用不超過6塊上述形狀的管道(暫且稱為管道吧),問最少需要幾塊能將出口和入口連通。如果不能,輸出"Impossible"。這題類似于三維的迷宮問題,對于每個狀態(tài),可以有8種不同的操作,每增加一個操作,對應(yīng)于多用了一塊管道。有所不同的是:每個狀態(tài)除了它的坐標(biāo)(x,y,z)外,還多了一個方向向量V∈{+x,+y,+z,-x,-y,-z}。將這個因素也考慮到狀態(tài)判重里,然后用dfs或者bfs都可解決。還有一個需要注意的是,在進(jìn)行第一步操作的時候,要根據(jù)入口的方向V,對3個坐標(biāo)x,y,z其中的一個進(jìn)行+1或者-1操作,由向量V決定。至于為什么,仔細(xì)觀察下圖就明白了。

posted on 2009-04-23 18:14 極限定律 閱讀(967) 評論(0)  編輯 收藏 引用 所屬分類: ACM-ICPC World Final 2008題解

<2009年4月>
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

導(dǎo)航

統(tǒng)計

常用鏈接

留言簿(10)

隨筆分類

隨筆檔案

友情鏈接

搜索

最新評論

閱讀排行榜

評論排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            欧美高清你懂得| 欧美综合77777色婷婷| 欧美久久久久久久| 欧美aⅴ一区二区三区视频| 日韩视频免费看| 狼人社综合社区| 欧美jizzhd精品欧美巨大免费| 亚洲午夜久久久久久久久电影网| 欧美一区日韩一区| 欧美在线观看一二区| 欧美www视频| 久久婷婷国产麻豆91天堂| 亚洲日本视频| 国产精品国产三级国产aⅴ入口| 欧美一区二区高清| 欧美三级第一页| 亚洲日本成人在线观看| 国内精品一区二区三区| 99视频精品| 欧美主播一区二区三区| 在线成人亚洲| 亚洲第一偷拍| 亚洲综合色视频| 久久久精品动漫| 欧美高清日韩| 亚洲视频自拍偷拍| 久久精品盗摄| 国产精品国产精品国产专区不蜜| 国产精品女人网站| 欧美视频中文字幕在线| 韩国美女久久| 欧美一区二区三区日韩视频| 欧美激情第9页| 久久精品人人做人人爽| 国产精品激情偷乱一区二区∴| 亚洲福利视频一区二区| 久久av红桃一区二区小说| 欧美激情一区二区三区在线| 国产欧美一区二区三区沐欲 | 黄色欧美成人| 一本久久a久久免费精品不卡| 久久久综合视频| 欧美在线网址| 亚洲国产欧洲综合997久久| 欧美在线影院在线视频| 日韩一区二区电影网| 欧美国产日产韩国视频| 亚洲电影有码| 日韩亚洲综合在线| 国产精品视频九色porn| 亚洲欧美日韩一区二区三区在线观看| 亚洲欧洲一级| 国产精品美女视频网站| 久久精品国产亚洲5555| 裸体素人女欧美日韩| 亚洲午夜国产成人av电影男同| 亚洲激情欧美| 欧美一区二区视频在线观看| 亚洲午夜高清视频| 国产精品日韩精品| 老司机成人在线视频| 欧美福利精品| 久久一区二区三区超碰国产精品| 欧美成年人视频网站欧美| 亚洲午夜一二三区视频| 久久久99精品免费观看不卡| 99re国产精品| 久久久99精品免费观看不卡| 欧美激情综合五月色丁香小说| 欧美激情精品久久久久久久变态 | 欧美高清视频| 欧美日本免费一区二区三区| 久久久视频精品| 国产精品久久夜| 91久久精品国产91久久性色| 国产嫩草影院久久久久| 日韩一级不卡| 99精品欧美一区| 欧美高清在线视频| 欧美国产亚洲另类动漫| 亚洲黄色视屏| 欧美成年人视频| 嫩草成人www欧美| 国产在线精品自拍| 久久久精品免费视频| 久久9热精品视频| 国产一区日韩二区欧美三区| 欧美在线视频全部完| 麻豆成人在线观看| 亚洲伦理久久| 国产区二精品视| 久久亚洲精品一区| 日韩一级黄色大片| 久久精品99国产精品| 在线精品视频一区二区| 免费av成人在线| 一区二区三区免费观看| 久久精品视频在线免费观看| 国内精品一区二区三区| 欧美日韩91| 亚洲在线成人| 精品成人在线视频| 欧美日韩妖精视频| 久久男人资源视频| 亚洲性感美女99在线| 欧美成人综合| 欧美在线亚洲综合一区| 一二三四社区欧美黄| 亚洲电影视频在线| 国产一级揄自揄精品视频| 欧美日韩综合| 欧美日韩国产综合在线| 美国成人毛片| 欧美中在线观看| 亚洲欧美日韩一区在线观看| 亚洲精品小视频在线观看| 久久久激情视频| 在线中文字幕一区| 亚洲国产精品第一区二区三区| 国产精品红桃| 久久精品国产99| 亚洲精品一线二线三线无人区| 蘑菇福利视频一区播放| 亚洲性图久久| 欧美呦呦网站| 亚洲国产精品一区二区久| 亚洲永久在线| 欧美日韩午夜视频在线观看| 亚洲精品视频在线| 国产精品乱看| 久久久亚洲高清| 亚洲国产日韩欧美综合久久| 亚洲三级影院| 美女国产精品| 亚洲大片在线观看| 亚洲激情成人在线| 亚洲一区美女视频在线观看免费| 国产亚洲精品bv在线观看| 亚洲视频图片小说| 欧美电影免费观看高清完整版| 国产精品久久久久久亚洲毛片| 日韩亚洲欧美一区二区三区| 久久免费99精品久久久久久| 亚洲精品在线观看免费| 亚洲欧美大片| 欧美高清视频一区二区三区在线观看| 欧美99在线视频观看| 黄色成人av网站| 亚洲一区国产| 亚洲第一中文字幕在线观看| 亚洲一区二区三区色| 亚洲六月丁香色婷婷综合久久| 亚洲一区二区三区四区在线观看| 欧美在线综合视频| 99精品视频一区| 欧美午夜无遮挡| 国产一区二区成人| 久久精品国产精品亚洲精品| 一区二区久久久久久| 欧美精品在线免费观看| 亚洲国产欧美一区| 亚洲国产欧美一区二区三区久久| 久久久午夜精品| 亚洲人成毛片在线播放| 亚洲国产精品精华液2区45| 免费成人av在线| 中国成人黄色视屏| 一本大道久久a久久精品综合| 欧美区在线播放| 亚洲欧美日韩中文播放| 亚洲在线黄色| 亚洲国产精品成人va在线观看| 亚洲国产成人久久综合一区| 欧美精品一区二| 欧美在线一二三区| 欧美不卡三区| 午夜精品久久久久久久久久久久久| 亚洲一区二区三区在线| 亚洲国产1区| 欧美制服丝袜第一页| 99精品视频一区二区三区| 欧美一区二区观看视频| 亚洲精品网址在线观看| 一区二区av| 欧美一区二区三区四区视频| 亚洲国产日韩欧美在线动漫| 一区二区免费看| 亚洲国产美女精品久久久久∴| 亚洲欧美不卡| 一区二区三区**美女毛片| 久久九九国产精品| 老司机午夜精品视频在线观看| 国产精品swag| 亚洲一二三四区| 亚洲视频一区二区| 欧美午夜a级限制福利片| 一区二区欧美日韩视频| 一区二区三区日韩在线观看| 欧美精品色综合| 在线视频精品一区|