Skip to content

Commit 02b42aa

Browse files
committed
[20250910] BOJ / G2 / 중앙값 구하기 / 김민진
1 parent 5910a38 commit 02b42aa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

zinnnn37/202509/10 BOJ G2 중앙값 구하기.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public class BJ_2696_중앙값_구하기 {
2626

2727
while (T-- > 0) {
2828
M = Integer.parseInt(br.readLine());
29+
bw.write((M / 2 + 1) + "\n");
2930

3031
s = "";
3132
minq = new PriorityQueue<>();
@@ -47,11 +48,10 @@ public class BJ_2696_중앙값_구하기 {
4748
}
4849

4950
if (i % 2 == 0) {
50-
s += maxq.peek() + (i > 2 && (i + 2) % 20 == 0 ? "\n" : " ");
51+
bw.write(maxq.peek() + (i > 2 && (i + 2) % 20 == 0 ? "\n" : " "));
5152
}
5253
}
53-
bw.write(maxq.size() + "\n");
54-
bw.write(s + "\n");
54+
bw.write("\n");
5555
}
5656
bw.flush();
5757
bw.close();

0 commit comments

Comments
 (0)