Dobri
의견: 0
\(6^{th}\) round, March \(9^{th}\), 2013
Authors: Ivan Mandura
You are given a sequence A consisting of N integers (not to be confused with the sequence from the
previous task). We will call the i^{th} sequence element good if it equals the sum of some three elements
in positions strictly smaller than i (an element can be used more than once in the sum).
How many good elements does the sequence contain?
In test data worth at least 40% of total points, \(N \le 50\).
In test data worth at least 70% of total points, \(N \le 500\).
The first line of input contains the positive integer N (\(1 \le N \le 5000\)), the length of the sequence A.
The second line of input contains N spa\(ce-se\)parated integers representing the sequence A (-100 000 ≤
\(A_{i} \le 100\,000\)).
The first and only line of output must contain the number of good elements in the sequence.
2
1 316
1 2 3 5 7 1043
-1 2 01평가 및 의견
Dobri
Log in to rate problems.
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
Dobri