ÉèΪÊ×Ò³ ¼ÓÈëÊÕ²Ø

TOP

ZOJ3864:Quiz for EXO-L(BFS)(Ò»)
2015-11-21 01:05:00 À´Ô´: ×÷Õß: ¡¾´ó ÖРС¡¿ ä¯ÀÀ:5´Î
Tags£ºZOJ3864:Quiz for EXO-L BFS

Exo (Korean: ??; Chinese:°®¿ÈËÔ; often stylized as EXO) is a Chinese-South Korean boy band based in Seoul, South Korea. Formed by SM Entertainment in 2011, the group consists of twelve members separated into two subgroups, EXO-K and EXO-M, performing music in Korean and Mandarin, respectively. The group officially debuted on April 8, 2012, with Suho, Baekhyun, Chanyeol, D.O, Kai, and Sehun under the Korean subgroup while Xiumin, Luhan, Kris, Lay, Chen, and Tao are under the Mandarin group. Kris filed a lawsuit against S.M. to be removed from the group, and Luhan followed suit in October 2014. The band now promotes with 10 members since mid-October 2014, which consists of 8 Korean and 2 Chinese members.

In their first album, each member of EXO has a kind of super power. For example, Tao can control time and Lay has a super power of healing. The badges are the symbols of their super powers. Each member of EXO has an unique badge. The following table shows the shapes of their badges.

Baekhyun - light Chanyeol - flame Chen - lightning D.O - earth
Baekhyun Chanyeol Chen D.O
Kai - telepZ??http://www.2cto.com/kf/ware/vc/vcnRhdGlvbg==" src="https://www.cppentry.com/upload_files/article/49/1_fpewp__.png" width="200" /> Kris - flight Lay - healing Luhan - telekinesis
Kai Kris Lay Luhan
Sehun - wind Suho - water Tao - time control Xiumin - frost
Sehun Suho Tao Xiumin

EXO¡¯s official fanclub name has been announced to be EXO-L. EXO-L is short for EXO-LOVE, L being the letter between M and K in the alphabet, signifying all the fans' love for both EXO-K and EXO-M of EXO, and also holds the meaning of 'EXO and the fans are one' like their team slogan 'WE ARE ONE.'

You should help an EXO-L pass a quiz about image recognition. The quiz requires a program to recognize the badges. The input is one of the above 12 images with rotation, and the output should be the owner of the badge in the image. The badge is rotated at an unknown angle. And each image is a square matrix. The badges will never touch or exceed the boundary of the image.

Since the images are large, we will compress the images. Each pixel in the image is either 1(white) or 0(black) after binarization. The compress method is simple:

  • Concatenate the pixels in the row first order to a string.Split the string to some runs with same characters, and two adjacent runs have different characters.Output the length of each run.

    ?

    For example, an image in size 6¡Á6:

    111111
    100101
    100011
    110111
    101001
    111111
    
    We can compress it as the following:
    • Concatenate the pixels in the row first order, then we can get
      111111100101100011110111101001111111
      
      The runs are
      1111111 00 1 0 11 000 1111 0 1111 0 1 00 1111111
      
      So the result of compressed images is
      7 2 1 1 2 3 4 1 4 1 1 2 7
      
      Note that in this task the first run and the last run is always in white.

      ?

      Input

      There are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:

      The first line contains 2 integers n and m. n is the size of the square image. m is the number of the runs in the compressed images. (100¡Ü n ¡Ü 900)

      The second line contains m positive integers, indicating the length of the each runs in the compressed image. (The sum of the integers is n2).

      Output

      For each case, output the owner of the badge in one line. Your output should be formated as one of following words: "Suho", "Baekhyun", "Chanyeol", "D.O", "Kai", "Sehun", "Xiumin", "Luhan", "Kris", "Lay", "Chen", and "Tao".

      Sample Input

      2
      100 443
      1445 1 99 2 97 3 97 4 6 1 88 5 5 2 88 5 4 4 86 6 4 4 73 1 12 6 3 6 72 4 8 6 5 5 72 6 6 6 5 6 72 7 3 6 6 6 12 1 59 16 7 6 9 3 60 14 8 6 6 6 61 13 9 6 3 7 65 12 7 16 8 1 45 3 10 12 5 15 6 4 45 5 9 14 3 12 6 6 45 6 8 15 2 9 9 5 47 5 7 17 1 7 10 6 47 6 6 17 2 3 13 5 48 6 5 18 17 6 49 5 5 8 1 10 5 3 8 5 50 6 3 8 5 7 3 7 6 5 50 6 3 8 7 18 2 5 52 5 3 7 10 23 52 6 2 7 13 2

Ê×Ò³ ÉÏÒ»Ò³ 1 2 ÏÂÒ»Ò³ βҳ 1/2/2
¡¾´ó ÖРС¡¿¡¾´òÓ¡¡¿ ¡¾·±Ìå¡¿¡¾Í¶¸å¡¿¡¾Êղء¿ ¡¾ÍƼö¡¿¡¾¾Ù±¨¡¿¡¾ÆÀÂÛ¡¿ ¡¾¹Ø±Õ¡¿ ¡¾·µ»Ø¶¥²¿¡¿
·ÖÏíµ½: 
ÉÏһƪ£ºLeetCode¨DReverse Bits £¬1 Bitº.. ÏÂһƪ£ºleetcode-18 4Sum

ÆÀÂÛ

ÕÊ¡¡¡¡ºÅ: ÃÜÂë: (ÐÂÓû§×¢²á)
Ñé Ö¤ Âë:
±í¡¡¡¡Çé:
ÄÚ¡¡¡¡ÈÝ: