Having trouble in solving segment tree problem.

Revision en1, by NotHandsomeBoizz, 2024-01-11 19:13:40

Hi everyone!

I have just participated in an IT contest in my city recently. And there was a segment tree problem that for now, I cant think of the way to use the segment tree properly. Heres the problem:

  • Given an array a contains only two numbers: 1 and -1, all the elements index from 1 to n
Tags segment tree, math, problem solving, binary search

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en7 English NotHandsomeBoizz 2025-05-29 17:50:54 0 (published)
en6 English NotHandsomeBoizz 2024-01-14 04:48:05 6 Tiny change: 'r x, y (l >= x >= y >= r) such ' -> 'r x, y (l <= x <= y <= r) such ' (saved to drafts)
en5 English NotHandsomeBoizz 2024-01-12 16:40:13 0 (published)
en4 English NotHandsomeBoizz 2024-01-12 16:39:20 20 Tiny change: 'ntegers a1, a2, a3, ' -> 'ntegers a1\n-, a2, a3, '
en3 English NotHandsomeBoizz 2024-01-12 16:37:26 391
en2 English NotHandsomeBoizz 2024-01-12 16:23:39 796 Tiny change: 'nt -1.\n\n\n`hello`\n' -> 'nt -1.\n\n* Example:\n'
en1 English NotHandsomeBoizz 2024-01-11 19:13:40 349 Initial revision (saved to drafts)