• [1119] Patchouli's Books

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • Patchouli Knowledge(パチュリー·ノーレッジ) is the owner of the Embodiment of Scarlet Devil library. She often shelves books time by time.
    For she is careless, Patchouli treats all the books in the same size in the same way.
    Give you several books and their sizes (you only need to consider the height of the books), you should output all the books formations Patchouli may shelf.

  • 输入
  • This problem may contains several cases.
    The first line is a single integer N (0 < N <= 8), indicates the number of books.
    The next line has N integers, the ith integer Hi (0 < Hi <= 15) indecate the height of the ith book.
  • 输出
  • For each case, you have to output the all the possible formations (According to the height difference). Order by lexicographic order. The height will be outputed in hexadecimal.
  • 样例输入
  • 4
    13 1 3 3
    
  • 样例输出
  • 1 3 3 D
    1 3 D 3
    1 D 3 3
    3 1 3 D
    3 1 D 3
    3 3 1 D
    3 3 D 1
    3 D 1 3
    3 D 3 1
    D 1 3 3
    D 3 1 3
    D 3 3 1
    
  • 提示
  • We're sorry for rejudge.
  • 来源
  • XadillaX
  • 操作

显示春菜