QOJ.ac

QOJ

時間限制: 1 s 記憶體限制: 256 MB 總分: 100

#5572. 网格大陆

统计

Gridlandia 大陆是一个边长为 $n$ 的正方形,被划分为 $n^2$ 个边长为 $1$ 的正方形国家。每个国家有资源选择其四个边中的至多一条边,并建造一堵覆盖该整条边的“墙”。然而,由于所有国家都处于战争状态,没有任何两个国家愿意让它们的墙接触,即使是在墙的端点处也不行。

请找出在 Gridlandia 中可以建造的墙的最大数量,并构造出一种建造了最大数量墙的方案。

输入格式

输入仅包含一行,为一个整数 $n$ ($1 \le n \le 10^3$),表示网格每一边的正方形数量。

输出格式

输出应包含 $n$ 行。

每一行应包含 $n$ 个字符,每个字符要么是空白(用 '.' 表示),要么是 'UDLR' 中的一个。

点号 '.' 表示没有墙的国家,而字符 'UDLR' 分别表示在该国家的“上”、“下”、“左”、“右”侧建造墙的国家。

样例

样例输入 1

1

样例输出 1

U

样例输入 2

2

样例输出 2

LU
DR

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.