Weird issue with my solution for problem H of Codeforces Round 966

Revision en1, by ajit, 2024-08-15 03:10:37

Hi,

While solving problem H of the recent Codeforces Div3 round (link), I came across the following issue:

In my solution, I had to clear up the segment tree after every test case, so I kept track of all the elements I interacted with in an STL container. The issue is that if I use std::set for keeping track of changed elements in the segment tree, I have no issues, but if I use std::vector, I get a weird runtime error on test 4. Here are my two solutions:

  • Accepted solution (using std::set variable called changed_elements in segtree structure) link
  • Runtime error solution (using std::vector variable called changed_elements in segtree structure) link

Can anyone tell me what's causing this runtime error?

Tags runtime error

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English ajit 2024-08-15 03:23:28 27 Tiny change: 'wing issue: \n\nIn m' -> 'wing issue (after hours of debugging): \n\nIn m'
en1 English ajit 2024-08-15 03:10:37 972 Initial revision (published)