No.1880 Many Ways
問題文最終更新日: 2022-03-19 02:08:24
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
yukicoder contest 336
(順位表)
の他の問題:
Problem Statement
Construct a simple undirected graph satisfying the following conditions.
- It consists of vertex $1$, vertex $2$, …, vertex $N$, where $1 \leq N \leq 128$.
- There are exactly $A$ shortest paths from vertex $1$ to vertex $N$.
Input
$A$
- $0 \leq A < 2^{40}$
- $A$ is an integer.
Output
On the first line, output the number of vertices $N$ and the number of edges $M$ of the constructed graph. Then, over the following $M$ lines, output the endpoints of each edge, separated by a space.
If the $i$-th edge you output is $\{a_i, b_i\}$, the output is as follows.
$N$ $M$ $a_1$ $b_1$ $a_2$ $b_2$ $\vdots$ $a_M$ $b_M$
Sample
Sample 1
Input
1
Output
1 0
Sample 2
Input
3
Output
5 6 1 2 1 3 1 4 2 5 3 5 4 5
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
37zigen
keymoon