Hi Codeforces community, can you help me to find the root of run time error in my solution for this problem 1428C - ABBB
Error is status_access_violation, google says it's something about pointers;
Submission link: 180179520
The approach is -> transform string to linked list of chars and when deleting two characters fix the "prev" for "next"; I generated "AB" strings up to 2^7, but it fails somewhere in 2^8, I'm not sure how to debug it; May be it's a memory leak issue?, I'm creating new pointers without deleting them, I tried using "delete pointer" but it did not help;
UPD
This was the solution https://mirror.codeforces.com/blog/entry/108880?#comment-971099
Not deleting pointers is not a good habit, but it won't cause runtime error in CP.
Did you really write 250 lines for a 1100 rated problem that is solvable with one for loop?
Yeah, my bad, I implemented a working solution after not being able to debug pointers based, but could not let it go why it did not work;
Turns out it's default value for pointers;
"I'm not sure how to debug it"
For example, you can just try. If you even tried in Custom Invocations, that you'd see that you've got fail in first testcase of test #2.
Another thing, you must know about C++ (and I hope that you knew that, but just forgot in that code) it is default initialization
Yup, indeed it was that), submitted, thank you;
I believed it was NULL by default; https://mirror.codeforces.com/contest/1428/submission/180191960
Auto comment: topic has been updated by Zealotrahl (previous revision, new revision, compare).