10:54 PM
Weekend was pretty great. Took the atcoder on Saturday, was pretty nice. Had to sort out a bunch of stuff for most of the rest of the day, cant say here, kinda confidential. Today had ARML practice :D :D then did a pretty quick half cycle and kinda bricked on ioi18p5 :skull: oops
Atcoder breakdown:
- A - lots of ways to do this one. I just did smth where I treated the arrows as directed edges, and kept counts of indegree/outdegree. Middle number was guaranteed to have both indeg + outdeg 1.
- B - trivial by any sort of fast insert/check structure; I used std::set
- C - bash all possible permutations of the graph, efficiently find cost for each. Again just used set. Took way too long debugging a 1 letter typo in my solution (g1 instead of g2), and so this took around 20m to implement instead of 10.. so cooked
- D - really standard range query. Coord compress into single array, then do the queries somehow. I know I could've used binary search + psum, but std::lower_bound kinda always trips me up and so I decided to... build a simple recursive segtree over the array and range query it. Overkill? It wasn't actually that bad...
- E - basically just CSES distinct value queries but without queries. Used a really similar idea to my solution to that task, but avoided using a segment tree entirely by noticing that we only need to mantain the total sum of the active segment... code here, pretty clean I think?
- F - realized that transforming each position p_i to p_i - i would make it such that any "adjacent" ranges of people would have equal position. Then it would be some mess of lazy segment tree or something that supports range sum & range set.. Really didn't feel like writing up in contest, will probably upsolve at some later date when I get bored.
- G - messed around with some sort of cycle extraction + minimal cyclic shift solution, seems like it would be even more complicated than that b/c of modulus and gcd and other stuff idk. Might revisit sometime in the relatively far future, but no idea.
Lowkey the tasks felt very standard, A-E in particular. I think last contest was more fun.
ARML practice was great! Topic was inequalities, ironically it seems that though we've covered such no less than five times over the past few years, I still don't entirely know how to apply anything more complicated than basic AM-GM in a contest setting. Usually I end up just calc bashing or something.. not optimal lol
Worked on ioi18p5 for a decent portion of the afternoon, I think I have the tree case figured out (and MAYBE the graph case as well) but implementation is not one of my strong points.. still do not have a bug-free solution to tree case.
Got most of my schoolwork out of the way (note) and will be able to do virtual contests over the next week, planning on either mon+tue or mon+wed, leaning towards tue tho because of stuff on thursday. Also, Vivian moves into college next weekend, so will be out of town - will miss next ARML, sorry andrew
anyway, I have my chill classes tomorrow. A couple club meetings I think? idk. gn pittsburgh!