Dvoniz
의견: 0
We say that a sequence of \(2K\) elements is interesting if neither the sum of the first \(K\) elements, nor the sum of the last \(K\) elements, is greater than \(S\).
A sequence \(A\) of length \(N\) is given. For every element, output the length of the longest interesting subsequence starting with that element.
Here, a subsequence means a contiguous block of consecutive elements of \(A\).
The first line contains integers \(N\) and \(S\) (\(2 \le N \le 100\,000\), \(1 \le S \le 2 \cdot 10^9\)).
The following \(N\) lines contain the sequence \(A\), one integer per line. The integers are positive and their sum does not exceed \(2 \cdot 10^9\).
Output must consist of \(N\) lines. The \(i\)-th line must contain one integer, the length of the longest interesting subsequence starting with the \(i\)-th element. If an interesting subsequence at that position doesn't exist, output \(0\) (zero).
| 서브태스크 | 점수 | 설명 |
|---|---|---|
Test 1 | 10점 | None |
Test 2 | 10점 | None |
Test 3 | 10점 | None |
Test 4 | 10점 | None |
Test 5 | 10점 | None |
Test 6 | 10점 | None |
Test 7 | 10점 | None |
Test 8 | 10점 | None |
Test 9 | 10점 | None |
Test 10 | 10점 | None |
5 10000
1
1
1
1
14
4
2
2
05 9
1
1
10
1
92
0
0
2
08 3
1
1
1
1
1
1
1
16
6
6
4
4
2
2
0평가 및 의견
Dvoniz
Log in to rate problems.
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
Dvoniz