Do You Want to Build a Snowman?

View as PDF

Submit solution

Points: 12
Time limit: 13.0s
Memory limit: 256M

Authors:
Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig
ECOO Practice 2014 (Round 1)

Anna is trying to get Elsa to come outside and play with her. She reminisces about the days where they used to build their childhood snowman named Olaf (who happens to love warm hugs). Unfortunately, Elsa is too stubborn to come out and play, so you will have to help Anna build Olaf yourself!

Olaf has three twigs on top of his head. He has two circular eyes, a carrot nose, and two arms made from sticks. The following is a depiction of Olaf:

          |
       \  |  /
        \ | /
         \|/
       XXXXXXX
      X       X
     X  O   O  X
    X     V     X
W   X  X     X  X
 \   X  XXXXX  X
  \   X       X
   \   XXXXXXX
    \ X       X---
     X    O    X  \
    X           X  \
     XXXXXXXXXXX    \
     X         X     M
    X     O     X
   X      O      X
  X               X
   XXXXXXXXXXXXXXX
      OOOO OOOO
      OOOO OOOO

While Olaf is classically built with two torso sections (as shown in this example), Anna is bored, and would like to build Olaf with N (1 \le N \le 10) torso sections. The topmost torso section is 7 characters wide at the top, and tapers down to being 11 characters wide at the bottom. In order for the snowman to be balanced when it's standing, the torsos must get larger as they get closer to the ground. Specifically, each torso section should be taller by a total of 1 character than the one above it, and width of the top of each torso section should be equal to the width of the bottom of the torso section above it. Furthermore, the number of buttons on each torso will grow by 1 each time. There will be two feet at the bottom of Olaf, each 2 rows by 4 columns, separated by a vertical gap, and horizontally centered relative to Olaf's body.

Input Specification

The input will contain 5 test cases, one line per test case. Each line will contain the integer N, the number of torsos that you should give to Olaf.

Output Specification

For each test case, you should output Olaf with the specified amount of torsos. Every other aspect except of Olaf for the torsos should be exactly the same as the diagram above (e.g. the position of his eyes/nose/smile, the number of slashes for the arms and hair, etc.). The output should not contain any trailing spaces, and all letters in the output should be capitals. Separate the test cases by an empty line. The first line of output should not be blank.

Sample Input (only 2 examples shown here)

1
3

Sample Output

          |
       \  |  /
        \ | /
         \|/
       XXXXXXX
      X       X
     X  O   O  X
    X     V     X
W   X  X     X  X
 \   X  XXXXX  X
  \   X       X
   \   XXXXXXX
    \ X       X---
     X    O    X  \
    X           X  \
     XXXXXXXXXXX    \
      OOOO OOOO      M
      OOOO OOOO

           |
        \  |  /
         \ | /
          \|/
        XXXXXXX
       X       X
      X  O   O  X
     X     V     X
 W   X  X     X  X
  \   X  XXXXX  X
   \   X       X
    \   XXXXXXX
     \ X       X---
      X    O    X  \
     X           X  \
      XXXXXXXXXXX    \
      X         X     M
     X     O     X
    X      O      X
   X               X
    XXXXXXXXXXXXXXX
    X             X
   X       O       X
  X        O        X
 X         O         X
X                     X
 XXXXXXXXXXXXXXXXXXXXX
       OOOO OOOO
       OOOO OOOO

Comments


  • 12
    corgi  commented on April 7, 2020, 1:22 p.m.

    If CCC '00 J1 - Calendar is the first level then this problem is the boss fight.


  • 3
    Dingledooper  commented on March 20, 2020, 9:20 p.m.

    https://dmoj.ca/submission/1976305 Why am I getting a Presentation Error? I feel like I did everything the output specs said...


    • 6
      Josh  commented on March 20, 2020, 10:12 p.m.

      Do not print a newline character after the final test case.


  • 1
    Tzak  commented on Aug. 29, 2019, 11:19 p.m.

    Separate the test cases by an empty line with one or more spaces.

    I WA when i print " \n" between my test cases, but AC when I use "\n" instead. Does this need to be fixed?


  • 0
    const  commented on May 24, 2019, 11:53 p.m.

    Presentation Error?


  • -5
    wleung_bvg  commented on April 27, 2017, 1:06 a.m. edit 3

    This comment is hidden due to too much negative feedback. Click here to view it.


  • 35
    Daniel_Weintraub  commented on March 1, 2016, 9:56 a.m.

    This question ruined my life. Please remove it.


    • -3
      FatalEagle  commented on April 28, 2015, 12:00 a.m.

      But they said they're going to use an automated judge for the finals! Man, advanced concepts such as file output are such a struggle, will we be ready before ECOO finals?


  • -15
    bobhob314  commented on Feb. 14, 2015, 10:16 a.m.

    This comment is hidden due to too much negative feedback. Click here to view it.