QOJ.ac

QOJ

実行時間制限: 2.0 s メモリ制限: 1024 MB 満点: 100 ハック可能 ✓

#17877. 优美三角形

統計

考虑以下由 $n$ 个水平拼接的正三角形组成的图:

该图有 $n+2$ 个顶点和 $2n+1$ 条边。顶点按照水平位置递增的顺序进行编号,如上图所示。

换句话说,该图有 $n+2$ 个顶点,编号为 $1$ 到 $n+2$,并且有 $2n+1$ 条边连接所有编号之差最多为 $2$ 的顶点对。

每个顶点都被赋予一个正整数值。顶点 $i$ 的值为 $v_i$。连接顶点 $i$ 和 $j$ 的边的值为 $|v_i - v_j|$。请找到一种为所有顶点赋值的方法,使得对于每个不超过 $2n+1$ 的正整数 $k$,都恰好有一条边的值为 $k$。任何顶点的值都不能超过 $10^{18}$。

输入格式

第一行包含一个正整数 $n$。

输出格式

如果对于给定的 $n$ 存在解,则在同一行中输出赋予顶点 $1, 2, \dots, n+2$ 的值,用空格隔开。这些值必须是不超过 $10^{18}$ 的正整数。否则,输出 $-1$。

数据范围

  • $1 \le n \le 200\,000$

样例

输入样例 1

1

输出样例 1

3 1 4

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.