Binlogs
27 subscribers
18 photos
125 links
Download Telegram
There's a difference between knowing the perfect recipe for a roast chicken and having the skill to debone one in sixty seconds.
comments
Binlogs pinned «https://odinwhereswaldo.netlify.app #myprojects»
AKS algorithm, that is used to test the primality of a number in O(log(n)^7.5)

#YIL
I regularly participate in Competitive Programming contests, so from now on I will be giving contest analysis for the questions I solved in those contests here.
Binlogs
https://atcoder.jp/contests/abc412
A.
It was just implementation.

B.
It wanted us to check if every character that comes before an uppercase letter in the first character list, exists also on the second character list.

approach: Store the second character list in set. and check in constant time if the character exists or not.

C.
The question wants us to find a domino list with the minimum number of elements as possible from the provided number list. but there is one condition which is the first element in the domino list should be the first element from the number list and the last element in the domino list should be the last element from the number list.

domino list: its a special list where the current element * 2 is greater than or equal to the next element.

approach: take the first then sort the other elements from the number list except the last element in a new list. then for each element on the output list ( which currently have the first element) find the maximum possible value in which the domino list condition holds up for, then add this new element to the output list and continue. we can find elements in a sorted list with O(logn) time by using binary search. So we do this until we find a case in which the current element * 2 is greater than the last element on the number list.

D.
It was Combination + graph.
Couldn't solve it in time.

#contest_analysis