boj 6198 옥상 정원 꾸미기
-
boj)6198 - 옥상 정원 꾸미기PS/boj 2020. 10. 13. 12:57
import java.io.*; import java.util.*; public class boj_6198 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static Stack stack = new Stack(); public static void main(String[] args) throws IOException { long ans = 0; int N = Integer.parseInt(br.readLine()); for (int i = 0; i < N; i++) { int height = Integer.parseInt(br.readLine()); while (!stack.isEmpty()) { if ..