Skip to content

Commit 68ac548

Browse files
committed
[level 0] Title: 순서쌍의 개수, Time: 7.43 ms, Memory: 78 MB -BaekjoonHub
1 parent 9803aba commit 68ac548

2 files changed

Lines changed: 80 additions & 0 deletions

File tree

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# [level 0] 순서쌍의 개수 - 120836
2+
3+
[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/120836)
4+
5+
### 성능 요약
6+
7+
메모리: 78 MB, 시간: 7.43 ms
8+
9+
### 구분
10+
11+
코딩테스트 연습 > 코딩테스트 입문
12+
13+
### 채점결과
14+
15+
정확성: 100.0<br/>합계: 100.0 / 100.0
16+
17+
### 제출 일자
18+
19+
2026년 04월 21일 13:30:39
20+
21+
### 문제 설명
22+
23+
<p>순서쌍이란 두 개의 숫자를 순서를 정하여 짝지어 나타낸 쌍으로 (a, b)로 표기합니다. 자연수 <code>n</code>이 매개변수로 주어질 때 두 숫자의 곱이 <code>n</code>인 자연수 순서쌍의 개수를 return하도록 solution 함수를 완성해주세요.</p>
24+
25+
<hr>
26+
27+
<h5>제한사항</h5>
28+
29+
<ul>
30+
<li>1 ≤ n ≤ 1,000,000</li>
31+
</ul>
32+
33+
<hr>
34+
35+
<h5>입출력 예</h5>
36+
<table class="table">
37+
<thead><tr>
38+
<th>n</th>
39+
<th>result</th>
40+
</tr>
41+
</thead>
42+
<tbody><tr>
43+
<td>20</td>
44+
<td>6</td>
45+
</tr>
46+
<tr>
47+
<td>100</td>
48+
<td>9</td>
49+
</tr>
50+
</tbody>
51+
</table>
52+
<hr>
53+
54+
<h5>입출력 예 설명</h5>
55+
56+
<p>입출력 예 #1</p>
57+
58+
<ul>
59+
<li><code>n</code>이 20 이므로 곱이 20인 순서쌍은 (1, 20), (2, 10), (4, 5), (5, 4), (10, 2), (20, 1) 이므로 6을 return합니다.</li>
60+
</ul>
61+
62+
<p>입출력 예 #2</p>
63+
64+
<ul>
65+
<li><code>n</code>이 100 이므로 곱이 100인 순서쌍은 (1, 100), (2, 50), (4, 25), (5, 20), (10, 10), (20, 5), (25, 4), (50, 2), (100, 1) 이므로 9를 return합니다.</li>
66+
</ul>
67+
68+
69+
> 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/challenges
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution {
2+
public int solution(int n) {
3+
int answer = 0;
4+
5+
for(int i=1; i<= n; i++){
6+
if(n%i==0) answer++;
7+
}
8+
9+
return answer;
10+
}
11+
}

0 commit comments

Comments
 (0)