2805
[실2] 2805 - 나무 자르기
#include #include #include using namespace std; #pragma region 입출력 속도향상 #define FAST_IO() \ {\ ios::sync_with_stdio(false);\ cin.tie(NULL); \ cout.tie(NULL); \ }\ #pragma endregion vector v; int main() { FAST_IO(); long n, m; cin >> n >> m; v.resize(n); for (int i = 0; i > v[i]; sort(v.begin(), v.end()); long l = 0, r = v[n - 1]; long res = 0; while (l mid) sum += v[i] - mid; } if..