Skip to content

Commit 380a484

Browse files
committed
[Silver V] Title: 회사에 있는 사람, Time: 556 ms, Memory: 53440 KB -BaekjoonHub
1 parent a024dbb commit 380a484

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

백준/Silver/7785. 회사에 있는 사람/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
### 성능 요약
66

7-
메모리: 56872 KB, 시간: 716 ms
7+
메모리: 53440 KB, 시간: 556 ms
88

99
### 분류
1010

1111
자료 구조, 집합과 맵, 해시를 사용한 집합과 맵
1212

1313
### 제출 일자
1414

15-
2025년 11월 1일 16:48:19
15+
2025년 11월 1일 16:52:08
1616

1717
### 문제 설명
1818

백준/Silver/7785. 회사에 있는 사람/회사에 있는 사람.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,21 @@ public static void main(String[] args) throws IOException{
88

99
int n = Integer.parseInt(br.readLine());
1010

11-
Set<String> set = new HashSet<>();
11+
Set<String> set = new TreeSet<>(Collections.reverseOrder());
1212

1313
while(n-- > 0){
1414
String[] s = br.readLine().split(" ");
1515
if(s[1].equals("enter")) set.add(s[0]);
1616
else set.remove(s[0]);
1717
}
1818

19-
List<String> al = new ArrayList<>(set);
20-
Collections.sort(al, Collections.reverseOrder());
21-
22-
for(String s : al){
19+
// List<String> al = new ArrayList<>(set);
20+
// Collections.sort(al, Collections.reverseOrder());
21+
//
22+
// for(String s : al){
23+
// sb.append(s).append("\n");
24+
// }
25+
for(String s : set){
2326
sb.append(s).append("\n");
2427
}
2528

0 commit comments

Comments
 (0)