luogu#P1498. 南蛮图腾

    ID: 489 远端评测题 1000ms 125MiB 尝试: 3 已通过: 3 难度: 5 上传者: 标签>字符串递归湖南分治深度优先搜索 DFS

南蛮图腾

Background

Since arriving in the land of the Nanman, Kongming not only subdued Meng Huo, but also discovered much wisdom among the ethnic minorities. He noticed that their totems often exhibit a fractal effect. After learning from the chieftain, he mastered many drawing techniques, but still could not draw their totem. So he sought help from your grandpa’s grandpa’s grandpa’s grandpa… As the grandchild’s grandchild’s grandchild’s grandchild…, can you do it?

Problem Description

Given a positive integer nn, refer to the sample output and print the pattern.

Input Format

Each test contains a single positive integer nn, representing the totem’s size.

Output Format

Output the totem of size nn.

2
   /\
  /__\
 /\  /\
/__\/__\

3
       /\
      /__\
     /\  /\
    /__\/__\
   /\      /\
  /__\    /__\
 /\  /\  /\  /\
/__\/__\/__\/__\

Hint

Constraints: 1n101 \leq n \leq 10.

Translated by ChatGPT 5