1 / 3

10721:Bar Codes

10721:Bar Codes. ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10721:Bar Codes 解題者: 張雪翔 解題日期: 20 10 年 4 月 12 日 題意: 一組條碼由黑白條碼組成,最左邊的條碼由黑色條碼開始。同色組條碼代表一個單位數目。圖 1 顯示由四組單位組成的一組條碼 1+2+3+1=7 。 一組條碼由 BC(n,k,m) 表示。( n 表示總共有多少條碼, k 表示由幾組條碼組成, m 表示一組條碼最大的數) 例如:圖 1 是表示 BC(7,4,3) 。 圖 1. 輸入 :

Télécharger la présentation

10721:Bar Codes

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. 10721:Bar Codes • ★★★☆☆ • 題組:Problem Set Archive with Online Judge • 題號:10721:Bar Codes • 解題者:張雪翔 • 解題日期:2010年4月12日 • 題意:一組條碼由黑白條碼組成,最左邊的條碼由黑色條碼開始。同色組條碼代表一個單位數目。圖1顯示由四組單位組成的一組條碼1+2+3+1=7。 一組條碼由BC(n,k,m)表示。(n表示總共有多少條碼,k表示由幾組條碼組成,m表示一組條碼最大的數) 例如:圖1是表示BC(7,4,3)。 圖1

  2. 輸入: 每個輸入包含三個正整數n ,k ,m (1 ≦ n ,k ,m ≦ 50) • 輸出: 輸出由n,k,m的組合總數(輸入形態為64bit的正數) • 題意範例: • 解法: BCx+1(n,k,m) = find1≦i≦m{ information[n,k,m] , BCx(n-i,k-1,m )} BC0(n,k,m)= n ≦ m ? 1 : 0

  3. K=2 K=1 K=1 or • 解法範例: 以 742 為範例 • 討論: 時間複雜度為O(nkm2) K=3 K=2 K=1 K=1 or K=4 K=2 K=1 K=1 or K=3 K=2 K=1 K=1 or

More Related