| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 (추가 시간 없음) | 1024 MB (추가 메모리 없음) | 160 | 102 | 67 | 69.792% |
Consider the following graph in the shape of $n$ equilateral triangles stitched together horizontally:
This graph has $n+2$ vertices and 2ドルn+1$ edges. The vertices are labeled in the order of increasing horizontal position, as in the image above.
In other words, the graph has $n+2$ vertices labeled from 1ドル$ through $n+2,ドル and 2ドルn+1$ edges connecting all pairs of vertices whose labels differ by at most 2ドル$.
A positive integer value is assigned to each vertex. Vertex $i$ has the value of $v_i$. The value of an edge that connects vertices $i$ and $j$ is $|v_i-v_j|$. Find a way to assign values to all vertices so that for every positive integer $k$ up to 2ドルn+1$ inclusive, exactly one edge has the value of $k$. The value of any vertex cannot exceed 10ドル^{18}$.
The first line contains $n,ドル a positive integer.
If a solution exists for the given $n,ドル print the values assigned to the vertices 1,2,ドル\ldots ,n+2$ in one line, separated by spaces. The values must be positive integers not exceeding 10ドル^{18}$. Otherwise, print $-1$.
1
3 1 4
University > KAIST > KAIST ICPC Mock Competition > 2024 KAIST 14th ICPC Mock Competition D번