Zju 2726 Constellation 解题分析与测试输出

终于把Zju 2726搞定了,哈哈哈!!!

本题的主要注意点是题目中的Notice。

Notice: the histogram should show out the exact proportions, however, the height of each bar should be as short as possible (see the samples).

例如有10个人,两个星座,人数分别为6,4,则XX长度应为3,2。即要约去各个人数的最大公约数。

另外注意,每行末不能有多余的空格。这个可以先把每行要输出的内容放到一个串中,然后去除尾部空格后再输出。

练习STL的string,stringstream,vector等容器的好习题。可以看看下面的Sample Input和Sample Output。

Sample Input:

1

March 19

12

March 19

March 20

March 20

March 19

March 19

March 19

October 22

October 22

October 22

October 22

October 22

October 22

11

March 19

March 20

March 20

March 19

March 19

October 22

October 22

October 22

October 22

October 22

October 22

5

March 20

March 20

March 20

October 22

October 22

0
Sample Output:

                                              1

                                             XX

------------------------------------------------

 Ar  Ta  Ge  Ca  Le  Vi  Li  Sc  Sa  Ca  Aq  Pi



                          6

                         XX                   4

  2                      XX                  XX

 XX                      XX                  XX

------------------------------------------------

 Ar  Ta  Ge  Ca  Le  Vi  Li  Sc  Sa  Ca  Aq  Pi



                          6

                         XX

                         XX

                         XX                   3

  2                      XX                  XX

 XX                      XX                  XX

 XX                      XX                  XX

------------------------------------------------

 Ar  Ta  Ge  Ca  Le  Vi  Li  Sc  Sa  Ca  Aq  Pi



  3

 XX                       2

 XX                      XX

 XX                      XX

------------------------------------------------

 Ar  Ta  Ge  Ca  Le  Vi  Li  Sc  Sa  Ca  Aq  Pi



阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页