Skip to content

Commit 0e04ad0

Browse files
committed
[Silver IV] Title: 제로, Time: 208 ms, Memory: 22944 KB -BaekjoonHub
1 parent 6ffb0a1 commit 0e04ad0

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

백준/Silver/10773. 제로/README.md

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

55
### 성능 요약
66

7-
메모리: 104944 KB, 시간: 720 ms
7+
메모리: 22944 KB, 시간: 208 ms
88

99
### 분류
1010

1111
구현, 자료 구조, 스택
1212

1313
### 제출 일자
1414

15-
2025년 11월 1일 00:32:07
15+
2025년 11월 1일 00:34:59
1616

1717
### 문제 설명
1818

백준/Silver/10773. 제로/제로.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
import java.util.*;
2+
import java.io.*;
23

34
public class Main {
4-
public static void main(String[] args) {
5+
public static void main(String[] args) throws IOException{
56
Stack<Integer> stack = new Stack<>();
6-
Scanner sc = new Scanner(System.in);
7-
int k = sc.nextInt();
7+
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
8+
int k = Integer.parseInt(br.readLine());
9+
// Scanner sc = new Scanner(System.in);
10+
// int k = sc.nextInt();
811
int sum = 0;
912

1013
while(k-- > 0){
11-
int num = sc.nextInt();
14+
// int num = sc.nextInt();
15+
int num = Integer.parseInt(br.readLine());
1216
if(num==0){
1317
sum-=stack.pop();
1418
}else{

0 commit comments

Comments
 (0)