Time: 5:45pm IST
- Solved A
- Couldn't solve B
- Couldn't think of C
-- Up-solve :
- Read the question wrong for A and started swapping on all elements, should read carefully and remember A is the easiest so the probability of there being a catch is less.
- Started on right track of taking elements on the edge of -1 valleys. Should've added them in a vector more efficiently, instead I made complex vectors which was confusing. Then I did not think of a mathematical proof instead I made a intuitive guess which was wrong. Should try to get a mathematical proof for every question!
- Couldn't even think of going the opposite route of finding subsets of zeros. This mindset of solving something else to get something else always comes with Subset questions, I got one such previously too. Keep this in mind.
What I Learnt
- How to get max_element and min_element directly from arrays. ( cout<< *max_element( arr.begin() , arr.end()) )
- I wonder what is the complexity? O(N)? research ("YES")
- Find mathematical proofs and don't get scared
- Using pop_back() function (similar to push_back) pop_back
- using resize() function resize
- using substr() function, Reaaally helpful! substr
--- New Things to learn:
- Writing LL after a integer constant makes them Long long, good for using max() functions, can I convert into any other format like float to double?
- ANS: Yes I can, by multiplying with typecast of 1.0 . ** eg int x=5.0; x= 1.0*x; ** //now x is double
Maybe there is some list of questions like C. I should search for that!
- Sparse Tables, problem E uses them, will learn and share good resources!
---- Pending :
- Read and try E
EDIT 1: D has been solved really neat how the editorial solves the problem, not the approach but the code. Soo smooth.
----Song of the contest
Sweet Child O' mine by Guns and Roses :)