File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ # [ Bronze IV] 베라의 패션 - 15439
2
+
3
+ [ 문제 링크] ( https://www.acmicpc.net/problem/15439 )
4
+
5
+ ### 성능 요약
6
+
7
+ 메모리: 14160 KB, 시간: 104 ms
8
+
9
+ ### 분류
10
+
11
+ 구현, 조합론, 수학
12
+
13
+ ### 제출 일자
14
+
15
+ 2025년 3월 20일 22:45:17
16
+
17
+ ### 문제 설명
18
+
19
+ <p >베라는 상의 N 벌과 하의 N 벌이 있다. i 번째 상의와 i 번째 하의는 모두 색상 i를 가진다. N 개의 색상은 모두 서로 다르다.</p >
20
+
21
+ <p >상의와 하의가 서로 다른 색상인 조합은 총 몇 가지일까?</p >
22
+
23
+ ### 입력
24
+
25
+ <p >입력은 아래와 같이 주어진다.</p >
26
+
27
+ <pre >N</pre >
28
+
29
+ ### 출력
30
+
31
+ <p >상의와 하의가 서로 다른 색상인 조합의 가짓수를 출력한다.</p >
32
+
Original file line number Diff line number Diff line change
1
+ import java .io .*;
2
+
3
+ public class Main {
4
+ public static void main (String [] args ) throws IOException {
5
+ BufferedReader br = new BufferedReader (new InputStreamReader (System .in ));
6
+ BufferedWriter bw = new BufferedWriter (new OutputStreamWriter (System .out ));
7
+ int i = Integer .parseInt (br .readLine ());
8
+ bw .write (String .valueOf (i * (i - 1 )));
9
+ bw .flush ();
10
+ bw .close ();
11
+ br .close ();
12
+ }
13
+ }
You can’t perform that action at this time.
0 commit comments