ABC 373 - Problem A, B, C, D, E Editorial
What an interesting round! I made an explanation for each of the problems. Be sure to check it out! Below are my thoughts on the problem during the contest.
As usual, let’s dive right into Problem A first. Problem A was just iteration and if/else conditional statement usage, nothing much to say honestly.
Next up is Problem B, which is pretty simple as well. However, the only thing to note about is you should disregard the “find the minimum distance” part of the statement, since there’s really only one way to type out the letters on keyboard (not a circular keyboard or something),
Problem C was extremely free in this round compared to some of the others, since its statement explicitly tells you what to do without incorporating wordy story in it. Just find max(A) + max(B).
The difficulty hops onto the next level starting from Problem D. But I quickly noticed you just have to use array W to figure out the weights on the given graph. Here’s how: for a fixed value on node A, and it has an edge connecting to another node B, you can figure out the value of node B by manipulating the following two types of equations: If X[A] - X[B] = W[j] then an edge from A to B is just -W[j], otherwise X[B] - X[A] = W[j] is just W[j] from A to B.
Next up is Problem E, which was fairly difficult in this round, and it was the most time-consuming problem for me (I didn’t do Problem F and G). It didn’t take me long to figure out you have to perform binary search on the desired X value, but the hard part is how to check if it is a valid answer. It turns out you have to use another binary search, which took me a while to get there. I wasn’t able to AC this problem before the contest ended as the implementation has a lot of details to take care of, but I could’ve done it if the contest was extended by 10 minutes or so because there’s only a small bug in my code.
In short, I think I did average in this round, and the only pity is I didn’t get to AC Problem E, but indeed I did right after the contest ended so I guess that’s fine.