QOJ.ac

QOJ

時間限制: 2 s 記憶體限制: 1024 MB 總分: 100 可 Hack ✓

#18584. MEXMEX

统计

$\textrm{MEX}$ to funkcja zwracająca najmniejszą nieujemną liczbę całkowitą, która nie należy do zbioru. Na przykład $\textrm{MEX}(\{0,1,3,4\})=2$ oraz $\textrm{MEX}(\{1,2,4\})=0$.

ibasic zdefiniował funkcję $\textrm{MEXMEX}$ dla ciągu $A$ o długości $N$, składającego się z nieujemnych liczb całkowitych, w następujący sposób: $$\textrm{MEXMEX}(A)=\textrm{MEX}(\{\textrm{MEX}(\{A_l,A_{l+1},\dots,A_r\})\mid 1\le l\le r\le N\})$$

Innymi słowy, $\textrm{MEXMEX}(A)$ to wartość funkcji $\textrm{MEX}$ obliczona dla zbioru wszystkich wartości $\textrm{MEX}$ uzyskanych ze wszystkich spójnych podciągów ciągu $A$.

Pomóż ibasicowi znaleźć ciąg $A$ o długości $N$, dla którego $\textrm{MEXMEX}(A)=K$.

Wejście

W pierwszej linii podano dwie liczby całkowite $N$ oraz $K$, oddzielone spacją. $(1\le N\le 2\times 10^5;$ $0\le K\le N+1)$

Wyjście

W pierwszej linii wypisz elementy ciągu $A_1, A_2, \dots, A_N$ oddzielone spacjami. $(0\le A_i\le 2^{31}-1)$

Jeśli ciąg spełniający warunki nie istnieje, wypisz -1. Jeśli istnieje wiele takich ciągów, wypisz dowolny z nich.

Przykład

Wejście 1

6 7

Wyjście 1

0 1 2 3 4 5

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.