Bob and Sticks
Submit solution
Points:
12 (partial)
Time limit:
1.0s
Python
2.0s
Memory limit:
256M
Author:
Problem type
There are two things Bob loves: sticks and equilateral triangles.
He has \(N\) (\(3 \le N \le 1000\)) sticks of varying lengths. Stick \(i\) (\(1 \le i \le N\)) has integer length \(a_i\) (\(1 \le a_i \le 500\)). The sum of all \(a_i\) is guaranteed to be \(\le 5000\).
Wanting to combine the two things he loves most, he wonders if he can align his sticks to form an equilateral triangle.
In other words, can he split his sticks into three groups such that the sum of lengths of sticks in each group is the same?
Input Specification
The first line has the integer \(N\): the number of sticks Bob has. The second line contains \(N\) space-separated integers \(a_1...a_N\).
Output Specification
Print Yes if Bob can make an equilateral triangle. If not, print No.
Sample Input 1
6
4 1 1 2 3 1
Sample Output 1
Yes
Sample Input 2
4
1 2 3 2
Sample Output 2
No
Comments
Weak bounds
The bounds are fine, I think (assuming bitset solution is intended).
The data is really weak however, here's some hacks:
Should be "Yes" since
Also
Should be "No" since we need to sum to 9 and there's 4
5, forcing one group to have 10.i saw what you did jadenfu
Weak info
Remove clipped output, put new cases, rejudge