Skip to content

Commit f43626d

Browse files
committed
[Silver IV] Title: 카드2, Time: 224 ms, Memory: 48916 KB -BaekjoonHub
1 parent 87e96fd commit f43626d

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

백준/Silver/2164. 카드2/README.md

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

55
### 성능 요약
66

7-
메모리: 50960 KB, 시간: 224 ms
7+
메모리: 48916 KB, 시간: 224 ms
88

99
### 분류
1010

1111
자료 구조, 큐
1212

1313
### 제출 일자
1414

15-
2024년 5월 19일 21:06:50
15+
2026년 1월 24일 23:50:24
1616

1717
### 문제 설명
1818

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import java.util.*;
2+
3+
public class Main {
4+
public static void main(String[] args) {
5+
Scanner sc = new Scanner(System.in);
6+
Queue<Integer> q = new LinkedList<>();
7+
int N = sc.nextInt();
8+
for(int i=1; i<=N; i++) {
9+
q.add(i);
10+
}
11+
12+
while (q.size() > 1) {
13+
q.poll();
14+
q.add(q.poll());
15+
}
16+
17+
System.out.println(q.poll());
18+
}
19+
}

0 commit comments

Comments
 (0)