Editorial for Triangle Area


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.

Submitting an official solution before solving the problem yourself is a bannable offence.

Author: Ninjaclasher

Note that the triangle given is guaranteed to be a right angle triangle, which means the base and height of the triangle is simply the 2 shorter sides of the triangle. The longer side would therefore be the hypotenuse.

In case you do not know, the area of a triangle is \frac{bh}{2}, where b is the base length and h is the height of the triangle.

Time Complexity: \mathcal{O}(1)


Comments

There are no comments at the moment.