11471 arrange the tiles
This presentation is the property of its rightful owner.
Sponsored Links
1 / 3

11471: Arrange the Tiles PowerPoint PPT Presentation


  • 68 Views
  • Uploaded on
  • Presentation posted in: General

11471: Arrange the Tiles. ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 11471: Arrange the Tiles 解題者: 鄭凱原 解題日期: 200 8 年 8 月 20 日 題意: 某 如題目的圖,給你12個方塊,請問能順利拼進圖中的組合數有幾種。 方塊有四種顏色 (R G B Y) 測資的順序表是顏色方向,舉例:RGGY表示此方塊上右下左的顏色分別是RGGY。若圖中兩個方塊相臨,則兩條疊合的邊要同色。. 題意範例: Sample Input 2

Download Presentation

11471: Arrange the Tiles

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


11471 arrange the tiles

11471: Arrange the Tiles

  • ★★★★☆

  • 題組:Problem Set Archive with Online Judge

  • 題號:11471: Arrange the Tiles

  • 解題者:鄭凱原

  • 解題日期:2008年8月20日

  • 題意:某如題目的圖,給你12個方塊,請問能順利拼進圖中的組合數有幾種。

    方塊有四種顏色 (R G B Y) 測資的順序表是顏色方向,舉例:RGGY表示此方塊上右下左的顏色分別是RGGY。若圖中兩個方塊相臨,則兩條疊合的邊要同色。


11471 arrange the tiles

  • 題意範例:

    Sample Input

    2

    BBBB BBBB BBBB BBBB

    BBBB BBBB BBBB BBBB

    BBBB BBBB BBBB YYYY

    GGGG GGGG GGGG GGGG

    GGGG GGGG GGGG GGGG

    GGGG GGGG GGGG GGGG

    Sample Output

    Case 1: 0

    Case 2: 479001600


11471 arrange the tiles

  • 解法:分堆

    將12個方塊分成兩部份,分別計算上半部可以成立的圖形,和下半部可以成立的圖形。

    再將兩部分中,可以相連的圖形計算出來,即為答案。

  • 解法範例:無

  • 討論:

    時間複雜度:每個case花費

    1.分割成兩部分的時間( )

    2.兩部份各自計算可成立圖形的時間 (6! + 6!)

    3.計算相連的時間(可忽略)

    總結時間複雜度為 * 6! * 2 = 924 * 720 * 2 = 1330560

C

12

6

C

12

6


  • Login