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