QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 1024 MB Total points: 100 Hackable ✓

#18590. Các dãy số cơ bản

Statistics

Để tiếp nối ý chí của ian0704, hãy giúp ibasic tìm một dãy số $A$ có độ dài $3N$ thỏa mãn tất cả các điều kiện sau:

  • $A$ là một hoán vị của các số nguyên từ $1$ đến $3N$.
  • Với mọi $l, r$ thỏa mãn $1\le l< r\le 3N$, trung vị của đoạn $[A_l,A_{l+1},\dots,A_r]$ phải nằm trong khoảng từ $N+1$ đến $2N$ (bao gồm cả hai đầu mút). Trung vị của một dãy số có độ dài $k$ được định nghĩa là số nhỏ thứ $\frac{k+1}{2}$ nếu $k$ lẻ, và là trung bình cộng của số nhỏ thứ $\frac{k}{2}$ và số nhỏ thứ $\frac{k}{2}+1$ nếu $k$ chẵn.

Dữ liệu vào

Dòng đầu tiên chứa số nguyên $N$. $(1\le N\le 10^5)$

Dữ liệu ra

Dòng đầu tiên in ra dãy số $A_1, A_2, \dots, A_{3N}$ thỏa mãn các điều kiện, các số cách nhau bởi dấu cách. Nếu không tồn tại dãy số nào thỏa mãn, hãy in ra -1. Nếu có nhiều dãy số thỏa mãn, bạn có thể in ra bất kỳ dãy nào trong số đó.

Ví dụ

Dữ liệu vào 1

2

Dữ liệu ra 1

1 5 3 4 2 6

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.