Timeline
timeline
2025-09-28
init
greedy
Problem:
This problem asks for the maximum perimeter. We know that for any triangle, the sum of any two sides must be greater than the third side. In fact, it suffices that the smallest side + the second largest side > the largest side. This problem requires the maximum perimeter. When the largest side is fixed, if the second largest side + the smallest side is less than the largest side, then the largest side is too large, and we need to make it smaller. That is, we just need to sort all the side lengths and traverse from the end to the beginning.
1 |
|
