Блог пользователя malachi_toney_goat

Автор malachi_toney_goat, 5 лет назад, По-английски

Hello Codeforces!

We, the disciples of Omkar (qlf9, Tlatoani, gotexans, malachi_toney_goat, and Omkar's newest disciple, rabaiBomkarBittalBang), have written our third contest: Codeforces Round 724 (Div. 2)Omkar 3. It will be held on Jun/06/2021 17:35 (Moscow time) and will be rated for users in Division 2 (rating lower than 2100). As usual participants with rating >= 2100 are allowed to compete too, but the contest will be unrated for them.

You will be given 2 hours to solve 6 problems. There may or may not be an interactive problem, so it would behoove you to read the guide for interactive problems. There also may or may not be competitive programming problems, so you should be sure to thoroughly understand everything here.

We would like to thank:

The scoring distribution is 500 — 1000 — 1500 — 2000 — 2250 — 2500.

May Omkar be with you!

Update: Thank you for participating in our contest! The editorial is here. We have video editorials for every problem there!

Update:

The winners in official standings:

  1. xin_chen

  2. adc-s11-sadge

  3. conqueror_of_rainboy

  4. XOXOX

  5. TwTwTwTwT

The winners in unofficial standings:

  1. neal

  2. Maksim1744

  3. dlalswp25

  4. hank55663

  5. fanache99

Congrats!

  • Проголосовать: нравится
  • +537
  • Проголосовать: не нравится

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +85 Проголосовать: не нравится

As a tester, Omkar orz!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +48 Проголосовать: не нравится

Hope you all enjoy our problems :)

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +50 Проголосовать: не нравится

As a tester, I must say problems are really interesting !! All the Best :)

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +86 Проголосовать: не нравится

Interesting problems.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +48 Проголосовать: не нравится

everyone click the Omkar 3 link

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +22 Проголосовать: не нравится

I'm still thinking that you all guys know Hindi ?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

Very quick scoring announcement!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

Scoring looks pretty balanced, gonna be a nice round!!!

»
5 лет назад, скрыть # |
Rev. 5  
Проголосовать: нравится -32 Проголосовать: не нравится

When i see there are a lot rounds comming in codeforces :

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +7 Проголосовать: не нравится

It's time that these posts should use the word "Bugaboo" instead of "problem".

»
5 лет назад, скрыть # |
Rev. 4  
Проголосовать: нравится +20 Проголосовать: не нравится

I was hoping for becoming Expert but now I might get demoted to pupil :(

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I like this scoring distribution

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +21 Проголосовать: не нравится

Wow , another contest this week. If codechef could conduct as many contest as they launch new courses for cp then I would have become 4 star on cc xDD.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +31 Проголосовать: не нравится
Problem / Bugaboo Names of this Contest
»
5 лет назад, скрыть # |
 
Проголосовать: нравится -38 Проголосовать: не нравится

Brother,just curious to know Omkar means what? The link you provided Omkar3 is youtube link that's the hinduism. From my perspective, Here all contestant are not hindu. But you are spreading your religion by Omkar?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Why the organisers are obsessed with Omkar. I don't think they even know Hindi.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Hope so I will be able to solve B this time

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

Just curious how to become tester

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +14 Проголосовать: не нравится

    You should be personally familiar with some problem setter, so (s)he could personally kick the s**t out of you if you leak some problems beforehand, spoiling the contest and efforts of many people )

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится -59 Проголосовать: не нравится

I love CF

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

I don't have much sense of humour, can someone explain what's going on?

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +8 Проголосовать: не нравится

The good' ol 6 problem 2 hr div2 is back finally!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

"There also may or may not be competitive programming problems" yeah like why would you include competitive programming problems in a competitive programming contest, that would be very weird.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Scoring looks encouraging!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -11 Проголосовать: не нравится

malachi_toney_goat, you made a mistake. This should be BUGABOOS, not Problems.

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится -38 Проголосовать: не нравится

God for creating the world and the human race.

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +11 Проголосовать: не нравится

after looking at a few comments up here, I would like to imagine a Latin American guy named Jesus creating a round, then they put his name on all problems and thanked him in the announcement blog

»
5 лет назад, скрыть # |
Rev. 7  
Проголосовать: нравится -85 Проголосовать: не нравится

.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

Omkar orz... Om Namah Shivay!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Will Omkar inspire the authors to release the Editorial eventually?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

there also may or may not be rated contest so you should read all of the rules about unrated contest.

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится -38 Проголосовать: не нравится

ok

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +25 Проголосовать: не нравится

What is the Meaning of Omkar ?

The word OM came from Hindu mythology.

OMKAR ओंकार —

OM + KAR = Om is a indeclinable .It is a sacred syllable and is Uttered as a holy exclamation at the beginning and end of a reading of the Vedas or previous to the commencement of a prayer or sacred work.

KAR is from kri कृ root word , which means doing , making , performing.

It is a term, denoting a sound or word which is not inflected.

OMKAR is a SACRED syllable OM itself.

The exclamation OM. It is a Supreme Brahm.

OMKAR is a powerful word when chanting gives physical and mental health. One can feel certain vibrations in the body and so it controls anger, increases patience and tolerance levels.

Chanting of Omkar improves concentration, brings down stress, anxiety, and tension.

It is a meditation. It reduces negativity.

So the meaning of the name has powerful meanings.

I think this will help you.

Sources: What is the meaning of the name Onkar?, What is Meaning of Omkar

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +1 Проголосовать: не нравится

    Yes, True that. Only I would like to add-

    . "Om" is considered to be the cosmic sound. It originates back when nothing existed and space was empty & quiet, the creation of universe brought with itself the vibrations of Om. And hence it was the first sound that ever originated.

    . Proper chanting of "OM" has remedial effects on any mental or physical stress because "om" is considered to be made up of every possible frequencies of sound and when chanted, it tunes with the frequencies of self and provides relief.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

malachi_toney_goat, Is there any way to become disciple of Omkar?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -17 Проголосовать: не нравится

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Good Luck everyone!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +25 Проголосовать: не нравится

Hail Omkar

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +10 Проголосовать: не нравится

When a problem score is 2000, does it mean its difficulty is 2000?

I am new to codeforces. Pardon me.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

The Marking system feels shit, if you submit first in just 3 min with one error, gives less marks compared to someone who solved it after 25 minutes.

ughhhh

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I personally wouldn't be surprised if someone said: "Anton did NOT reject problems for this contest!"

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Was Div2 A always this hard?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

The problem statements should rather be considered as riddles.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +21 Проголосовать: не нравится

i still don't have Diluc and Fischl..ehe..maybe that's why i still fail to solve their problems

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +7 Проголосовать: не нравится
There also may or may not be competitive programming problems 

Very true, now my tongue has well-defined six-pack abs after going through these tongue twisters.

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +17 Проголосовать: не нравится

me on A: 31 minutes B: 28 C: 24 I'm not saying it's not balanced but WTF is wrong with me why do I start like an idiot then focus more and more

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

Thanks problem B for negative Delta :)

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

First task was pretty hard for div.2 ( Thanks for your time spent for making a contest)

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

participating today was a bad idea

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

I see a huge gap between C and D, but on the other hand there where still a lot of people solving D.

Maybe I missed some more or less obvious observation.

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    Yeah, you missed a small observation. Let's build array a based on array b from the beginning. So for every operation, we can add at most 2 elements into a. So for the current move, if the previous median is not equal to the new median then there cannot be an element in the array we build (a) whose value is in between the new median and the old median. Because if you add two unknown elements into array [1,2,3,4,5,6,7] then the median can be one of 3,4 and 5.

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +5 Проголосовать: не нравится

Can someone please help me where I went wrong for bugaboo C? I was getting correct answer on test cases and I am pretty sure about the logic too. 118652416

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Many E's will fail today (at least 2 in my room itself) because they will print $$$-1$$$ instead of $$$10^{9}+6$$$ but I was too lazy to hack lol.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +12 Проголосовать: не нравится

Can't believe 3k people solved C

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится -10 Проголосовать: не нравится

    It was easy. Just needed to notice then ratio of D/K remains same as the total. After that its just binary search.

    C
    • »
      »
      »
      5 лет назад, скрыть # ^ |
       
      Проголосовать: нравится +10 Проголосовать: не нравится

      A safer approach than doubles is to store a pair <x, y> representing x / y. However be careful to store it in its reduced form, that is, where gcd(x, y) = 1.

      Also instead of binary search, we can just store the number of times we have encountered this reduced fraction when iterating from left to right.

      Implementation: 118610628

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    Its a pretty common idea that has appeared a lot (especially at the start of this year on Codechef) — having a map storing some property which becomes the same (or similar) for all valid ranges then checking for each right end. So I don't think its that surprising that a lot of people solved it.

  • »
    »
    5 лет назад, скрыть # ^ |
    Rev. 5  
    Проголосовать: нравится 0 Проголосовать: не нравится

    C was easier than B. I think we have to just maintain the simplified ratio of D and K we got till now.

    Like 1:2 is same as 2:4 and which is same as 4:8 so, just divide D and K by gcd for that. As ratio of one part of the string must of equal to the ratio of complete prefix.

    But i feel B more harder than C. Although there was not much difference.

    BTW problem similar to B was also on HackerEarth Link

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +10 Проголосовать: не нравится

    I don't think that C was 3k easy. Something else is going on.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Hello,bro,may i ask how to solve Problem C ? Actually, i don't know the reason why i get wrong answer , :(

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +4 Проголосовать: не нравится
    Hint
»
5 лет назад, скрыть # |
 
Проголосовать: нравится +12 Проголосовать: не нравится

Out of curiosity, is there a way to solve D by sort of simulating the valid ranges $$$a_i$$$ could lie in using coordinate compression on $$$b_i$$$ plus something like a fenwick tree?

Something like when you initially place a new element we constrain it to lie between (-INF, $$$b_{i} - 1$$$] or [$$$b_{i} + 1$$$, INF), assume they initially lie at the left end and use a fenwick tree to count how many we can move to the right.

I know the intended solution using upper and lower value stacks is easier and more elegant but I'm just curious if such an approach is feasible.

  • »
    »
    5 лет назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится 0 Проголосовать: не нравится

    segment tree is very indian

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    I thought of following approach but could not implement, could someone tell if how to implement if their solution was similar :

    Spoiler
  • »
    »
    5 лет назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится 0 Проголосовать: не нравится

    Yes, that is more or less what I did. Compress coordinates. Use a binary indexed tree to keep track of values that are fixed. All values from the input need to be fixed, and if values are repeating, it is enough to fix each value once. Values that are not fixed are either minus or plus infinity, and we keep track of the counts. So, iterate over the input array. The first value goes to the Fenwick tree directly.After that, for each value, check how many values so far were strictly larger (including values from BIT and plus infinities), strictly smaller (including values from BIT and minus infinities) and equal to the new intended median. If the value of the median was not fixed before, fix it. The remaining values (1 or 2 depending on whether we had to fix a new value in this iteration) become minus or plus infinity, depending which category is less numerous. After the assignment, check if the supposed median is actually a median.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

How to solve C ? I tried to iterate on divisors of count of 'D' and then finding the value for possible count for 'K' and then check if the ratio existed somewhere. But I kept wrong answer on Pretest2. my submission. What is the correct procedure to solve this sum ?

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    Even I tried to do the same but got WA on Pretest 2. :(

    118652416

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    The key observation is, that if we remove a prefix of given ratio, the remaining part has same ratio.

    So foreach position, we need to find the number of positions left of it with same ratio.

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +1 Проголосовать: не нравится

    Create a map<pair<int,int>,int> where the key is the ratio, seen as a pair of ints instead of a double. Iterate through the string and keep two counters, current numbers of D (currD) and current numbers of K (currK), for every position in the string call x=gcd(currD,currK) and add one to map[{currD/x,currK/x}] and thats the answer for that position. You are counting how many segments are with the same ratio than your current position.

  • »
    »
    5 лет назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится 0 Проголосовать: не нравится

    **if A/B = C/D = E/F then A/B = C/D = E/F = ... = (A+B+E+...)/(C+D+F...) ** Thus a prefix can be divided into Components if The count ratio of D and K in all the partitions is same as that of Prefix . How to Store Fraction in Their Simplest Form : simple form of x/y is X/Y = (x/G)/(y/G) where G=__gcd(x,y) . We Can use map to store the position of Last index where the ratio was {X,Y} if the ratio at any index is i {a,b} the ans[i] = 1 + ans[pos[{a,b}]]; pos is a map.

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    Move along the array from left to right and for each prefix, find the ratio of D/K (rounded down to simplest form). Maintain a map to count the number of occurrences of this ratio and then the answer for index i is simply mp[ratio] + 1. It is always better to store the ratio as a pair of numerator and denominator to avoid division by 0.

  • »
    »
    5 лет назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится 0 Проголосовать: не нравится

    Suppose when iterating from left to right, at index $$$i$$$, we have $$$cnt_D$$$ occurances of $$$D$$$ and $$$cnt_k$$$ occurances of $$$K$$$.

    Now let us note that for a given string, if all the components have the same ratio $$$x:y$$$, then the total string will also have the ratio $$$x:y$$$. So it is sufficient to check for only this ratio.

    Now the answer is just many prefixes till index $$$i$$$ has a ratio $$$x:y$$$ occurred. This works as if for some $$$j \lt i$$$ $$$x_{j}:y_{j}$$$ and $$$x_{i}:y_{i}$$$ have the same ratio, then $$$x_{i}-x_{j}:y_{i}-y_{j}$$$ must have the same ratio. So we can just count this using a map of pairs $$$(x, y)$$$

    However we must also take care of the fact that $$$x:y$$$ and $$$kx:ky$$$ are the same ratio. To do so we can just reduce the ratio to its lowest form by dividing both terms by $$$gcd(numerator, denominator)$$$.

    Code: 118610628

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Thank you for the contest!

I kinda feel like C and D should be swapped, but then again it's kind of my fault I didn't start reading D after getting stuck on C I guess.

Anyway, it's not really much of a problem, the bugaboos were IMHO still good!

»
5 лет назад, скрыть # |
Rev. 4  
Проголосовать: нравится +45 Проголосовать: не нравится

Well, Problem E seemed really difficult at first. But the solution is merely two lines!

Solution
»
5 лет назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

How to solve E ?

  • »
    »
    5 лет назад, скрыть # ^ |
    Rev. 3  
    Проголосовать: нравится +16 Проголосовать: не нравится

    I didn't submit since I was too late, but my solution got the samples correct.

    Spoiler

    UPD: Idea got AC post-contest

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +13 Проголосовать: не нравится

    So, basically, you fix each hash to be 0 or non-zero. Now, which elements in matrix are zero and which are non-zero. Now, suppose you fix the hash at position (i,j) in the matrix to be non-zero, then the value of (i,j) will be the manhattan distance to the nearest zero. My proof is quite tedious but try proving it by contradiction.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I just want to know , whether i will have any rating change , if i didn't submit a single line of code, no right no wrong??

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

too many redudant statement, can't understand problem C :(

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +21 Проголосовать: не нравится

segment tree is very indian

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +16 Проголосовать: не нравится

My submission to A is totally not legit (TLE), but I managed to pass system tests anyway. Here's my video of the round: https://www.youtube.com/watch?v=dXS6nNiYeZs

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +53 Проголосовать: не нравится

meet a new cheater This is how Master_Jiraya bypasses Plagiarism testing.

I am watching him from so many contest , He has done this today and in previous contest, and I am sure he must have done it multiple times before as well. People like Master_Jiraya are spoiling the sport. I don't understand where would cheating take them in life. They will never get anywhere in life but always remain what they are i.e cheater. He should be banned from the platform as soon as possible . MikeMirzayanov sir pls ban him and skip his solutions .

todays submission 118639631 118614794 saw his submission time , he is that much pro that he can solved problems in 2 minutes .

kedos++;kedos++;kedos++;kedos++;kedos++;kedos++;kedos++;kedos++;kedos++;kedos++;kedos++;kedos++;kedos++;kedos++; jai++;jai++;jai++;jai++;jai++;jai++;jai++;jai++;jai++;jai++;jai++;jai++;jai++;jai++;jai++;jai++;jai++;jai++;jai++; jai++;kedos++;jai++;jai--;kedos--;kedos++;kedos++;jai--;jai++;kedos++;jai++;jai--;kedos--;kedos++;kedos++;jai--;

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +41 Проголосовать: не нравится

How the hell was B approved?! Such an annoying to code problem. The average problem-A on CF requires more thinking than that. I liked C, A today and have almost no clue why my D or E passed. Seemingly dumb guesses that I can't prove.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

Can anyone give some hints for D?

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +22 Проголосовать: не нравится

    Whenever you add the two new integers, you have three options.

    1. Add them to the left of the previous median. This results in shifting the median one to left.
    2. Add them to the right of the previous median. This results in shifting the median one to the right.
    3. Add one on either side. Same as previous median.

    Try to think of the situation where the answer would be "NO".

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How can https://codeforces.me/contest/1536/submission/118604068 solution pass if the question doesn't say we can remove the element?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

stories (short or big) in problems are good if they can somehow help in imagining. In A,B,C,D if problems were without stories then it would have been good.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

In C I somehow thought I should split the prefix evenly which waste a lot of time of mine :(

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

Strong Pretests !! :|

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

My opinion about C:

WTF is this explanation ?!! if someone couldn't understand the explanation then he'll see the samples, that's what I did but the sample explain another problem !! I (and I think a lot of peoble) understood it like every segment should have the same number of 'K's and 'D's.

question for the authors: couldn't put a good sample to explain another cases ??!!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +24 Проголосовать: не нравится

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Did anyone tried to solve C using sieve? My Attempt — 118650015

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

118650415 why TLE? Problem -: B

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

EBACDF

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -6 Проголосовать: не нравится

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +37 Проголосовать: не нравится

Random fact: B can be solved in $$$O(n*|\Sigma|)$$$ using dp on suffix automaton (code). This approach can solve the problem even if $$$n\leq 10^6$$$.

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

My code for B. It is most likely to get MLE in SysTests. Can somebody say, why the memory usage has skyrocketed?

UPD: It passed :'). Still, can somebody tell why the memory usage has skyrocketed? I have used simple brute force.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +12 Проголосовать: не нравится

While I'm practicing problems with difficulty 2500, it's very sad that I couldn't solve even C. I didn't have a good observation to solve D either. Not sure what's wrong with me...

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -11 Проголосовать: не нравится

Problem A and C are hard to implement :)

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

118650415 why TLE? Problem -: B

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

How to approach slightly modified problem C, if it is asked to find the number of ways to split such that the ratio (D/K) should be the same?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +10 Проголосовать: не нравится

very nice problems! E was unfortunately very proof-by-AC-able, but the actual induction proof is super clever

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Dang, I feel like an idiot. When solving A, I didn't realize that the version of Python 3 on the server only supports the 2-argument version of math.gcd(). It took me 17 minutes and 7 wrong submissions to debug this simple error.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

Idea for E:

Fix which #s turn into 0s.

All other numbers are uniquely determined. Imagine a multisource BFS from every 0. The value of a certain cell is simply its distance to the closest 0.

Answer is 2^X, where X is the number of #s (Edge case if there are no 0s in the original matrix. Then the answer is 2^X-1).

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -8 Проголосовать: не нравится

I had written correct logic for Problem C during the contest but it was exceeding time limit just because standard print method of Java was not fast enough for the given constraints. Isn't it unfair for non-C++ coders !! The constraint of 2 * 10^5 is carefully chosen to avoid these language specific problems and is widely used. I wonder why it was not considered during the testing phase!! :( malachi_toney_goat

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

how can the last output for this test

test

be 2 ? you cannot even divide a string of length 9 in 2 equal chunks .

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +20 Проголосовать: не нравится

Problem E is virtually equivalent to 2013 USAJMO Problem 2: https://artofproblemsolving.com/community/c5h532231p3041818

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +24 Проголосовать: не нравится

To not keep you waiting, the ratings updated preliminarily. We will remove cheaters and update the ratings again soon!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

I will be green again once cheaters are removed :) . Just 1 point away from being green again .

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

road to purple!!!

first milestone reached, feeling fucking A. Lets go !!!!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Isn't "aaa" lexicographically smaller than "ac" according to rule 2 from Problem B. Can anyone explain why this is not correct?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Can anyone tell what is the best method to generate strings like a,b,c.....z,aa,ab,ab.....az,ba,bb..... and so on in problem B and store in a vector? What is the easiest method? Please share your piece of code.

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится
  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +3 Проголосовать: не нравится

    wasn't able to solve this problem during the contest but after the contest I search for this and luckily found this beautiful way to generate all substring and solve this problem

    string MEX(string s,int n){

    vector<string>substrings;// will store all substring in sorted order
    substrings.push_back("");
    while(true){
        vector<string>temp;// stores all substrings generated in this iteration 
        for(auto c: substrings){// iterating over all subtring 
            for(char i='a';i<='z';i++){
                string str = c;
                str.push_back(i);// adding a,b,c one by one to generate new subtring
                temp.push_back(str);// pushing in temp to use it on next iteration
                if(s.find(str) == string::npos){
                    return str;
                }
            }
    
        }
        substrings.swap(temp);    
    }
    return "";

    }

    Example to understand clearly

    initially, substring contains an empty string we are adding a,b,c...z, one by one to "" and pushing back to temp so temp contains {a,b,c,d.....z} now swap temp and substring Now substring contain {a,b,c,.....z} here the magic happens Now you will extract a (first element) and again add a,b,c...z, one by one so the new substring becomes aa,ab,ac...az you will do the same thing for b,c,d....z so Now temp contains all subtring possible with two char

    Hope you understood it

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    I use recursion: 118607108

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Can anyone tell me the rating of each problem and the best time complexity to solve the problem New to CP, was able to solve only 1st problem also what kind of contest should I give as a beginner?

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится -6 Проголосовать: не нравится

Спасибо!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Please check these two Submissions for Problem 'C' :-
1.) https://codeforces.me/contest/1536/submission/118643260
2.) https://codeforces.me/contest/1536/submission/118699081
Logic is same in both but in 1st submission, I used ratio (in double) as key and in 2nd, I used pair as key of unordered map.
1st one got accepted but 2nd one is giving TLE.
Please Check them ...

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

This contest's sytle is so strange than others.Almost every problem I had to find the law behind the title ,it's very easy if we find the law ,but if we cann't find the law ,it's very puzzling!...

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Attention!

Your solution 118628482 for the problem 1536B significantly coincides with solutions Foundnt_Alice/118625677, Believeu_us/118628482. Such a coincidence is a clear rules violation. Note that unintentional leakage is also a violation. For example, do not use ideone.com with the default settings (public access to your code). If you have conclusive evidence that a coincidence has occurred due to the use of a common source published before the competition, write a comment to post about the round with all the details. More information can be found at http://codeforces.me/blog/entry/8790. Such violation of the rules may be the reason for blocking your account or other penalties. In case of repeated violations, your account may be blocked.

I have not cheated at all and two or more person can have same approach for the above problem as it was just about bruteforcing.Neither I have used any public code or ideone.com.You can also check my other codes.Please dont skip the solutions As it is a clear coincidence.MikeMirzayanov Please look into it.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Won't the cheaters be eliminated in this round ?