https://www.acmicpc.net/problem/15439
문제
Vera owns N tops and N pants. The i-th top and i-th pants have colour i, for 1 ≤ i ≤ N, where all N colours are different from each other.
An outfit consists of one top and one pants. Vera likes outfits where the top and pants are not the same colour.
How many different outfits does she like?
(i개의 색상을 가지고 있는 N개의 상의와 N개의 바지를 소유하고 있을 때 서로 다른 색상의 상하의를 입는 경우의 수를 구하는 문제이다)
입력
The input will be in the format:
N
Constraints:
- 1 ≤ N ≤ 2017
- N is integer
출력
Output one line with the number of different outfits Vera likes.
예제 입력
1. 1
2. 2
3. 5
예제 출력
1. 0
2. 2
3. 20
* 풀이
N = int(input())
print(N*(N-1))
'Algorithm > etc' 카테고리의 다른 글
[Python] 백준 브론즈5 14928번 : 큰 수 (BIG) (0) | 2021.09.08 |
---|---|
[Python] 백준 브론즈5 14652번 : 나는 행복합니다~ (0) | 2021.09.08 |
[Python] 백준 브론즈5 14654번 : 와이버스 부릉부릉 (0) | 2021.09.07 |
[Python] 백준 브론즈 5 13277번 : 큰 수 곱셈 (0) | 2021.09.07 |
[Python] 백준 브론즈5 11942번 : 고려대는 사랑입니다 (0) | 2021.09.07 |
댓글