[백준 알고리즘] 10773번 제로 (Python, Java)
언어, 알고리즘 공부/백준2020. 3. 12. 20:40[백준 알고리즘] 10773번 제로 (Python, Java)

K = int(input()) list = [] for _ in range(K): n = int(input()) if n == 0: if len(list)>0: list.pop() else: list.append(n) print(sum(list)) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Stack; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(S..

image