CWAY - Đếm số đường đi trên đồ thị đầy đủ

Tác giả: happyboy99x

Ngôn ngữ: Java

import java.util.Scanner;
import java.math.BigInteger;

public class Main {
	public static void main(String argv[]) {
		int n = new Scanner(System.in).nextInt();
		BigInteger res = new BigInteger("1");
		BigInteger mul = BigInteger.ONE;
		for(int i = 3; i <= n; ++i) {
			res = res.multiply(mul).add(BigInteger.ONE);
			mul = mul.add(BigInteger.ONE);
		}
		System.out.println(res);
	}
}

Download