1 / 3

10563: Least Squares

10563: Least Squares. ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 1 0563 : Least Squares 解題者: 王耀頡 解題日期: 20 11 年 4 月 13 日 題意: 給一個矩陣大小 m(<=100) 和 n(<=80) 以及一不規則的圖形 (‘?’ 表圖形部分而 ‘.’ 表示非圖形之空白區 ) ,然後用各種大小的正方形完整地覆蓋它,以蠟筆著色的方式, 顏色以 A~Z 表示 並且相鄰兩正方形不得同色, 而輸出所形成的字串能在字序中首次出現。.

alden
Download Presentation

10563: Least Squares

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 10563: Least Squares • ★★★☆☆ • 題組:Problem Set Archive with Online Judge • 題號:10563: Least Squares • 解題者:王耀頡 • 解題日期:2011年4月13日 • 題意:給一個矩陣大小m(<=100)和n(<=80)以及一不規則的圖形 (‘?’表圖形部分而 ‘.’表示非圖形之空白區),然後用各種大小的正方形完整地覆蓋它,以蠟筆著色的方式,顏色以A~Z表示並且相鄰兩正方形不得同色,而輸出所形成的字串能在字序中首次出現。

  2. 題意範例: m=5 n=5            ?????            .???. .???.            .???.            ?????    ABBBA      ABAAB    .BBB.      .CAA.    .BBB.      .ABB.    .AAC.      .CBB.    BAABC      ABACA

  3. 解法:先設為A若有相鄰的與原色相同就+1變成B直到無相鄰同色,再看後一個的最小可能值,若沒有比原位置的字元小,則開始擴張領土,以裹棉被的方式擴張,每加一層,就要判斷一次顏色的重複以及圖形上的?和. 直到碰到不符合者跳出迴圈,繼續尋找未著色區域到圖形最後結束。 • 解法範例:無 • 討論:無

More Related