問題一覧 > 通常問題

No.1880 Many Ways

レベル : / AI推定難易度 : 1600 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / スペシャルジャッジ問題 (複数の解が存在する可能性があります)
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 47
作問者 : 37zigen / テスター : keymoon 👑 cologne
お気に入りにしたユーザー ProblemId : 7599 / 自分の提出
問題文最終更新日: 2022-03-19 02:08:24
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もしくは右上の雲マークをクリックしてアカウントを作成してください。