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

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"。這題類似于三維的迷宮問題,對于每個狀態,可以有8種不同的操作,每增加一個操作,對應于多用了一塊管道。有所不同的是:每個狀態除了它的坐標(x,y,z)外,還多了一個方向向量V∈{+x,+y,+z,-x,-y,-z}。將這個因素也考慮到狀態判重里,然后用dfs或者bfs都可解決。還有一個需要注意的是,在進行第一步操作的時候,要根據入口的方向V,對3個坐標x,y,z其中的一個進行+1或者-1操作,由向量V決定。至于為什么,仔細觀察下圖就明白了。

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

<2009年5月>
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456

導航

統計

常用鏈接

留言簿(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>
            亚洲精品之草原avav久久| 亚洲三级国产| 欧美α欧美αv大片| 香蕉久久夜色精品国产| 欧美精品在线免费播放| 亚洲三级免费观看| 亚洲综合色激情五月| 欧美视频手机在线| 欧美亚洲三级| 亚洲高清视频一区二区| 欧美主播一区二区三区美女 久久精品人 | 久久综合久色欧美综合狠狠| 欧美日韩国产一区精品一区| 99国内精品久久| 午夜精品久久久久久| 国产精自产拍久久久久久| 麻豆精品视频在线| 久久综合中文色婷婷| 国产一区亚洲一区| 欧美大片在线影院| 久热国产精品视频| 欧美不卡视频一区| 蜜桃久久av一区| 牛牛国产精品| 亚洲欧美一区二区三区久久 | 欧美国产成人精品| 久久亚洲捆绑美女| 亚洲美女精品成人在线视频| 国内揄拍国内精品少妇国语| 性欧美xxxx视频在线观看| 香蕉av777xxx色综合一区| 在线精品视频免费观看| 亚洲在线一区二区三区| 亚洲欧美精品一区| 男人的天堂成人在线| 久久久一区二区三区| 亚洲图片在线观看| 99re6热在线精品视频播放速度| 一区二区三区高清在线| 国内精品国语自产拍在线观看| 久久一本综合频道| 亚洲另类视频| 你懂的视频欧美| 久久精品亚洲精品| 亚洲综合电影| 亚洲无线视频| 一本色道久久88亚洲综合88| 日韩午夜一区| 亚洲免费在线播放| 亚洲国产精品成人综合| 亚洲第一黄色| 一区二区视频欧美| 亚洲欧美bt| 久久久91精品国产| 亚洲经典三级| 老司机久久99久久精品播放免费| 夜夜夜精品看看| 亚洲美女av黄| 国内精品免费午夜毛片| 午夜性色一区二区三区免费视频| 99国产精品久久| 久久不射2019中文字幕| 亚洲激情网站免费观看| 亚洲精品欧美一区二区三区| 一区二区三区四区五区视频| 国产日韩精品入口| 欧美日韩成人综合在线一区二区| 欧美精品免费看| 欧美色区777第一页| 欧美亚洲在线| 国产精品二区三区四区| 欧美精品手机在线| 毛片精品免费在线观看| 欧美激情中文不卡| 亚洲国产欧美日韩精品| 99视频精品免费观看| 国产原创一区二区| 老司机67194精品线观看| 亚洲少妇在线| 能在线观看的日韩av| 国产精品爱啪在线线免费观看| 国产精品日韩专区| 欧美日韩国产影院| 国产色爱av资源综合区| 99精品免费| 欧美承认网站| 久久久噜噜噜久久| 亚洲精品网址在线观看| 蜜桃精品久久久久久久免费影院| 欧美二区在线观看| 亚洲成人在线| 狠狠色综合播放一区二区| 极品少妇一区二区| 久久裸体艺术| 亚洲人成小说网站色在线| 欧美电影免费观看高清| 亚洲精品乱码久久久久久日本蜜臀| 亚洲人成小说网站色在线| 一区二区三区四区五区精品视频| 免费亚洲一区二区| 久久午夜精品一区二区| 欧美激情一区二区三区蜜桃视频| 日韩西西人体444www| 免费在线观看成人av| 一区二区三区在线不卡| 亚洲夜晚福利在线观看| 久久精品99久久香蕉国产色戒| 亚洲承认在线| 欧美h视频在线| 亚洲视频在线视频| 午夜一区二区三区不卡视频| 欧美特黄视频| 中文亚洲视频在线| 久久永久免费| 亚洲福利视频一区二区| 久久精品1区| 国产在线日韩| 在线中文字幕不卡| 91久久国产综合久久蜜月精品| 久久先锋影音| 欧美高清在线| 欧美激情精品久久久久久大尺度 | 亚洲麻豆av| 欧美日一区二区三区在线观看国产免| 欧美韩国在线| 日韩视频久久| 国外精品视频| 欧美电影免费观看大全| 国产精品萝li| 亚洲精品免费观看| 亚洲福利在线看| 午夜日韩在线| 午夜精品久久久久久久99水蜜桃 | 国产精品99久久久久久久久久久久| 午夜精品久久久99热福利| 亚洲视频在线视频| 欧美日韩国产限制| 亚洲欧洲精品一区| 亚洲精品久久久久久久久久久久| 久久精品女人天堂| 另类av导航| 精品1区2区| 麻豆av福利av久久av| 亚洲盗摄视频| 日韩亚洲国产精品| 欧美精品首页| 日韩特黄影片| 午夜精品国产精品大乳美女| 国产精品美女一区二区| 性欧美暴力猛交69hd| 久久精品欧洲| 亚洲福利视频专区| 欧美日韩三区四区| 亚洲一区二区av电影| 久久精品欧洲| 亚洲第一网站| 欧美日韩美女在线| 亚洲欧美国产va在线影院| 久久久久久久综合日本| 亚洲国产精品t66y| 欧美日韩第一区| 午夜精品一区二区三区在线视 | 亚洲一区二区三区免费在线观看 | 亚洲看片免费| 国产精品久久久久久久7电影| 亚洲一区二区三区精品动漫| 久久久久久网| 一本一本久久a久久精品综合妖精| 国产精品久久午夜| 久久免费99精品久久久久久| 亚洲精品孕妇| 久久久久久综合| 在线中文字幕日韩| 狠狠色综合色区| 国产精品豆花视频| 久久蜜臀精品av| 亚洲一二三区在线观看| 麻豆国产精品777777在线| 亚洲视频在线免费观看| 伊人久久婷婷| 国产精品久久久久永久免费观看 | 牛人盗摄一区二区三区视频| 中文av字幕一区| 欧美成人a视频| 午夜老司机精品| 亚洲人成网站色ww在线| 国产色产综合产在线视频| 欧美精品一区二区三区很污很色的| 欧美亚洲综合在线| 夜夜嗨av一区二区三区网站四季av| 毛片av中文字幕一区二区| 国产精品99久久久久久宅男| 亚洲国产91精品在线观看| 国产欧美日韩免费| 亚洲乱码国产乱码精品精可以看| 久久久久五月天| 欧美专区福利在线| 亚洲一区视频在线| 一本色道久久综合亚洲精品不卡 | 免费成人在线观看视频|