I need help solving problems about Binary Search

Revision en1, by hanoi11minh_nh, 2024-12-11 19:08:40

Hello Codeforces!

I am facing this problem and don't know how to avoid TLE. Can someone please give me an algorithm hint for this problem? I already know the O(n^2) way.

Here is the problem:

We have n numbers which are the lengths of the sticks. Find the number of unique triangles that can be formed from the given n sticks. Unique triangles are understood as triangles that do not have a pair of 3 identical sides.

Thank you.

Tags math, need help

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English hanoi11minh_nh 2024-12-12 05:57:22 36 Tiny change: 'Thank you.' -> 'Thank you.\nNote: I can solve it know, thanks.'
en2 English hanoi11minh_nh 2024-12-11 19:24:12 53
en1 English hanoi11minh_nh 2024-12-11 19:08:40 524 Initial revision (published)