問題一覧 > 通常問題

No.1636 Forest

レベル : / AI推定難易度 : 77 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 378
作問者 : harurun / テスター : magsta serpent
お気に入りにしたユーザー ProblemId : 6665 / 自分の提出
問題文最終更新日: 2021-08-06 20:38:58
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 308 (順位表) の他の問題:

Problem Statement

There are $N-1$ trees, each with $N$ vertices. How many edges are there in total?

Constraints

  • $2≤N≤100$

  • All inputs are integers.

Input

$N$

$N$ is given on line $1$.

Output

Print the answer on $1$ line. Print a newline at the end.

Sample

Sample 1
Input
2
Output
1

There is $1$ tree with vertex $2$, so the answer is $1$.

Sample 2
Input
3
Output
4

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。