Skip to content

Commit 99a5e7d

Browse files
committed
[D1] Title: 간단한 N 의 약수, Time: 78 ms, Memory: 24,704 KB -BaekjoonHub
1 parent 69a23d5 commit 99a5e7d

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# [D1] 간단한 N 의 약수 - 1933
2+
3+
[문제 링크](https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PhcWaAKIDFAUq)
4+
5+
### 성능 요약
6+
7+
메모리: 24,704 KB, 시간: 78 ms, 코드길이: 711 Bytes
8+
9+
### 제출 일자
10+
11+
2025-09-25 15:00
12+
13+
14+
15+
> 출처: SW Expert Academy, https://swexpertacademy.com/main/code/problem/problemList.do
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import java.io.*;
2+
import java.util.*;
3+
4+
class Solution
5+
{
6+
public static void main(String args[]) throws Exception
7+
{
8+
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
9+
int N = Integer.parseInt(br.readLine());
10+
11+
if(N==1){
12+
System.out.println("1");
13+
}
14+
15+
List<Integer> list = new ArrayList<>();
16+
17+
for(int i=1; i<=N/2; i++){
18+
if(N%i==0){
19+
list.add(i);
20+
}
21+
}
22+
23+
list.add(N);
24+
//Collections.sort(list);
25+
StringBuilder sb = new StringBuilder();
26+
for(int ele : list){
27+
sb.append(ele + " ");
28+
}
29+
System.out.println(sb);
30+
}
31+
}

0 commit comments

Comments
 (0)