We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 87e96fd commit f43626dCopy full SHA for f43626d
백준/Silver/2164. 카드2/README.md
@@ -4,15 +4,15 @@
4
5
### 성능 요약
6
7
-메모리: 50960 KB, 시간: 224 ms
+메모리: 48916 KB, 시간: 224 ms
8
9
### 분류
10
11
자료 구조, 큐
12
13
### 제출 일자
14
15
-2024년 5월 19일 21:06:50
+2026년 1월 24일 23:50:24
16
17
### 문제 설명
18
백준/Silver/2164. 카드2/카드2.java
@@ -0,0 +1,19 @@
1
+import java.util.*;
2
+
3
+public class Main {
+ public static void main(String[] args) {
+ Scanner sc = new Scanner(System.in);
+ Queue<Integer> q = new LinkedList<>();
+ int N = sc.nextInt();
+ for(int i=1; i<=N; i++) {
+ q.add(i);
+ }
+ while (q.size() > 1) {
+ q.poll();
+ q.add(q.poll());
+ System.out.println(q.poll());
19
+}
0 commit comments