Binlogs
27 subscribers
18 photos
125 links
Download Telegram
Binlogs
https://atcoder.jp/contests/abc419
A.
straight forward. no explanation

B.
there are two operations 1. add a ball to the bag 2. pop out the smallest ball out of the bag.

use priority queue (heap)

C.
the optimal position to be is at the center.
then we just have to find the center and the time it takes to get there.
on the x-coordinate the center can be found using the minimum and maximum values found out of the x-coordinates.
on the y-coordinate, we can just use the same technique.

then which ever coordinate takes the longest to reach their center is the answer.

D.
we are given two same length strings. and we have to swap characters between some segments with the two strings. we have to return the first string after all the swap operations are done.

we can use a prefix sum to accumulate the swaps and do just one swap at the end.
after we have the prefix sum, we will do the swap for the indices that we have to swap and return the first string.

#contest_analysis
I tried nano banana, here are the results.
original
🔥3