#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; }