oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

namemid Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

namemid.html

Description

In ancient Mesopotamia, by the rivers of Tigris and Euphrates, the wise king of Baghdad decided to spare his slaves yet another pyramid made of stone. Instead, he chose to create a pyramid of names, also known as a namemid.

He orders you, his loyal architect/programmer servant, to create a pyramid of his name Unfortunately, the wise king has 999 names and he wants a pyramid for each name. He also likes the undulating landscape of his summer palace by the Red Sea, so he wants each pyramid to be of variable height to his liking.

Fortunately you are from the future, and you intend to save time by writing a computer program that takes in 2 inputs. The first input is a name which is a non-null string not longer than 254 characters. The second input is the height of the pyramid which is a positive integer. The program will then print out the pyramid of names as shown in the sample below. Note that there is an additional space at the end of each line.

If you succeed, you'll be more famous than I M Pei, and the king will ensure that you will be amply rewarded.

Sample Input 1

namemid
12

Sample Output 1

           n 
          a m 
         e m i 
        d n a m 
       e m i d n 
      a m e m i d 
     n a m e m i d 
    n a m e m i d n 
   a m e m i d n a m 
  e m i d n a m e m i 
 d n a m e m i d n a m 
e m i d n a m e m i d n 

Tags

String Processing

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
110061s32MBMinimum
2011s32MBMinimum

Judge Compile Command

g++-8 ans.cpp -o namemid -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.