Comments

As a stupid tester, hope you‘ll have fun with those tasty tasks. QwQ

Well, I think it would be easier to talk about it if I post out my code for checking:

int calc(int v) {
  for (int i(0), l(0), s(0); i != N; ++i) {
    while (s < v) s += arr[(i + l++) % N];
    len[0][i] = l;
    s -= arr[i], --l;
  }
  for (int i(1); (1 << i) <= K; ++i) {
    for (int j(0); j != N; ++j) {
      int m((j + len[i - 1][j]) % N);
      len[i][j] = len[i - 1][j] + len[i - 1][m];
    }
  }
  int cnt(0);
  for (int i(0); i != N; ++i) {
    int x(i), l(0);
    for (int j(0); (1 << j) <= K && l <= N; ++j)
      if (K & (1 << j))
        l += len[j][x], x = (x + len[j][x]) % N;
    if (l <= N) ++cnt;
  }
  return cnt;
}

The logic is a bit different from others, so I wonder if there's a legal piece of input can make a difference.

A question: when doing F, I set the lower bound to do binary search to 0, and that results in WA*1 on testcase55.txt. When I set it to 1, it passed. That's strange to me: not check(1) is obvious impossible, or is it?

On vaavenCodeforces Round 953 (Div. 2), 23 months ago
0

As r-l+1<=5, you can actually use 5(in fact 4) partial sum arrays to solve the problem.

Sometimes I feel like this too. I think that trying to think about "Why is this the solution? How can I get it? Can I think of it next time?" is truly important. While you're solving more problems, thinking more and reviewing more, you are learning and improving. Maybe this should be a long progress. Just go ahead. ;-)