From 6db33b085ad9baa56ac5f7c42eb49e6b8638876d Mon Sep 17 00:00:00 2001 From: songyc macbook Date: Fri, 25 Jul 2025 22:02:47 +0900 Subject: [PATCH] 20250725 baekjoon --- code_study/Baekjoon/c/2805.c | 41 ++++++++++++++++++++++++++++ code_study/Baekjoon/java/_11279.java | 20 ++++++++++++++ code_study/Baekjoon/python/2630.py | 32 ++++++++++++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 code_study/Baekjoon/c/2805.c create mode 100644 code_study/Baekjoon/java/_11279.java create mode 100644 code_study/Baekjoon/python/2630.py diff --git a/code_study/Baekjoon/c/2805.c b/code_study/Baekjoon/c/2805.c new file mode 100644 index 0000000..c82b01f --- /dev/null +++ b/code_study/Baekjoon/c/2805.c @@ -0,0 +1,41 @@ +#include +#include + +long long cutTree(const int* tree, int treeNum, int cuttingHeight); + +int main(){ + int N, M; + scanf("%d %d",&N, &M); + int* tree = (int*)malloc(sizeof(int)*N); + int maxHeight = 0; + for(int i=0; i cuttingHeight) { + totalCut += tree[i] - cuttingHeight; + } + } + return totalCut; +} diff --git a/code_study/Baekjoon/java/_11279.java b/code_study/Baekjoon/java/_11279.java new file mode 100644 index 0000000..6597cd4 --- /dev/null +++ b/code_study/Baekjoon/java/_11279.java @@ -0,0 +1,20 @@ +import java.util.*; + +public class _11279{ + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + int N = sc.nextInt(); + PriorityQueue maxHeap = new PriorityQueue<>(Comparator.reverseOrder()); + for(int i=0; i