Binlogs
27 subscribers
18 photos
125 links
Download Telegram
Binlogs
https://codeforces.com/contests/2123
A.
Alice and Bob are here, and there are n numbers, starting from 0 to n - 1. They take turns taking a number out of the listed ones, alice can choose any of the unchosen numbers and bob can choose any of the unchosen numbers but also the chosen number + what alice chose, must give 3 when doing modulo with 4. They go at it until one them is unable to choose a number.

approach: if n is divisible by 4, then there is always a way for bob to choose a number that satisfies the condition, otherwise alice can win it.

B.
approach: since we choose two elements every time and take the larger one and delete the smaller one, we can delete all the elements except ( the largest number and the value at the index we want), by choosing the largest number and some element to delete. by this technique as long as k > 1, we can retain the number we want.

if k == 1, then our index must be the largest element.

C.
approach: if for the current index, there is a minimum element to its left and there is a maximum element to its right, then its impossible to retain the current index. otherwise, it is always possible.
so we can create a prefix array which stores the current minimum among the current prefixes and create a suffix array which stores the current maximum among the current suffixes. then for each index we can check the condition in constant time and output the result.

D.
approach: the key thing to notice here is that bob can only choose a substring.
if the current number of ones on the string is less than k, then alice can win by choosing them all.
for bob to win there should be more than half number of ones, else alice wins.

E.
approach: find the first index of a 0, even if there are numbers after that they don't matter to the answer.
create a prefix array using the values up to the index. then populate the answer. and that's it.

F.
didn't start it , 'cause of time.

#contest_analysis
Since the contests were many, no #contest_analysis, but here is a recap.
Binlogs
https://atcoder.jp/contests/abc413
was able to solve 4 during contest and finished the 3 that were left after the contest.
Binlogs
https://codeforces.com/contests/2119
I was only able to solve 2 during contest. didn't try it after the contest.
the issue was question B, which I tried but couldn't solve.
Binlogs
https://codeforces.com/contests/2124
I solved 4 during the contest. which is good considering the previous one.
Binlogs
https://atcoder.jp/contests/abc414
A.
check if the current range encapsulates the initial range, and if it does increment the count.

B.
check if the current length of the string plus that is going to be added is greater than 100 or not, if it is stop there and output "Too Long", else put the new characters in to the answer string.

C.
(I couldn't solve it during the contest, one issue was that the code I run on my machine says TLE, but I know that it shouldn't say that, despite knowing that I was trying to come up with a new solution that doesn't say TLE. And It turns out it passes on the site)

Generate all the palindromes up to the given number, then for each number check if it is also a palindrome in the given base, if it is add it to the current sum. finally output the answer.

D.

Sort the list first. we want to add a signal strength such that the total sum of signal strengths is as small as possible. To solve this, we can utilize the gap that exists between the numbers. So if the gap is larger, it is a sign that we should divide the array into two on that point, therefore allowing us to minimize what we have to add. There is an "m" that is given which can be understood as the number of maximum gaps, we have to discard; if we do that the only values that are left are all the minimums and we can just add them and output the result.

E.
Time was not enough. Didn't even read it properly.


#contest_analysis
👍1
Binlogs
https://codeforces.com/contests/2125
A.
the question wants to order the string such that "FFT" or "NTT", don't appear as a substring in the string.
approach: take 'F' and 'N' characters to the end of the string.

B.
we're given a, b, and k.
since it only costs us once, when we use a pair of numbers. we can try to find the optimal numbers such that we just have to choose once.
we can get those values by just dividing a and b by their gcd.
then if max(the values we found) is less than or equal to k. we can reach (0, 0) by the cost of 1. else it will take 2.

C.

good integers: integers whose prime factorization only contains numbers that are at least 2 digits.

we are asked to find the number of good integers between l and r.

approach: we can substract the integers that are not good from the total numbers until a particular number.

if we found those numbers for r it means that we found all upto that point. to get the numbers between l and r, we can just substract ("the r one we found from l-1, (because we want the answer that includes l), numbers) and that will be the answer.

How can find the integers that are not good?
since prime factors that are not at least two digits are: 2, 3, 5, 7
we can just find numbers that are divisible by them.
To do that we can use, The inclusion-exclusion principle from mathematics
and that's it.

D.
I read it, but I couldn't understand how the output for the sample testcases were reached.

E.
Understood it, but couldn't come up with an approach.

#contest_analysis