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

Автор IgorI, история, 3 года назад, По-русски

Hi, Codeforces!

Я рад пригласить Вас на Codeforces Round #696, который состоится во 19.01.2021 17:35 (Московское время). Раунд будет рейтинговым для всех участников с рейтингом меньше $$$2100$$$. Участники из первого дивизиона могут принять участие вне конкурса.

Вам будет предложено $$$6$$$ задач на $$$2$$$ часа. Все задачи раунда придуманы мной. Спасибо adedalic за замечательную координацию раунда и MikeMirzayanov за системы Codeforces и Polygon.

Также благодарю тестеров awoo, errorgorn, RetiredPlayer, kalki411, AmShZ, IaMaNanBord, Osama_Alkhodairy, Prakash11, HIS_GRACE, Gauravvv, Dragnoid99 за тестирование раунда и полезные комментарии к задачам.

Разбалловка: $$$500-1000-1500-2000-2250-3000$$$.

Всем удачи!

UPD: Разбор

UPD: Поздравляем победителей!

Обоих дивизионов:

  1. neal

  2. antontrygubO_o

  3. HIR180

  4. fuppy

  5. Thienu

Второго дивизиона:

  1. EzioAuditoreDaFirenze

  2. Ishtar

  3. God_Of_Blunder

  4. Shivam_18

  5. AlphaAurigae

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

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

Удачи участникам! — Участник

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

I have a naive question: Why setters take too much time on selecting the scoring distribution?

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

Good Luck Participants! — a participant

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

When you see some common testers and started thinking how can this be a coincidence?

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

    As a tester I feel bad that you didn't tag me :-(

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

      As a future participant I feel bad that you didn't help me being one of the tester :P

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

        1) I try my best to help problem setters.

        2) I try my best to help you and other participants.

        It is guaranteed that the above two statements are equivalent.

        Still you can verify that through some algorithm ( if there exist any :-).

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

    it's a trap!

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

this set is nice :3

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

we should be thankful to HIS_GRACE for testing this round

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

Problems are very interesting! Good Luck!

»
3 года назад, # |
  Проголосовать: нравится -10 Проголосовать: не нравится

I wish the Problems have some bold words. Guess that serves me right for trying too hard to speedsolve.

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

Hoping that my performance will be at least same as my previous performance in your contest.

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

    Bro you are trying since 6 years on codeforces why you still a Specialist. Is there any mistake you are making, please give some experience advice also mistake you have made i'm a beginner here want to learn from you :).

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

      At least he is enjoying what he is doing without worrying much about ratings.

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

        But bro In india geting high rating means high placement, The company would not ask you enjoying or not :( It's reality brother. So I only ask for suggestion that the mistake we could not repeat.

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

          That is so not true! I think it is this misconception that is leading to the alarming rise in cheating cases. Companies do not ask for a high rating on competitive programming platforms when they hire. They don't even care for it, in most cases.

          Recruiters only expect candidates to have a good knowledge of Data Structures and Algorithms, and programming problems on platforms like Codeforces and Codechef sometimes require the use of those topics. As a result, being good at DSA is wrongly correlated with having a high rating on these platforms, and a lot of people end up focussing on rating rather than improving their knowledge and problem-solving skills!

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

          Competitive programming is a sport and it is never meant to be considered as a parameter for getting placements. Read this article for more clarification. https://www.freecodecamp.org/news/mythbusting-competitive-programming/

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

    Sorry drifter_kabir Mridul323, If you taken it in negative i'm worried as i wasted my 2 years in college and started cp too late would i get job or not :( does not have any right direction how to improve in that less time.

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

      itiswhatitizChiyu_0_O It is never late to do anything,but bro I let u know 5 star or candidate master will give negative image on your resume if u have not that true level ,So instead of focussing on rating focus on making ur data structure and algorithm stronger and also create a good dev project side by side.Also most of the guys which are here for more than year or two is doing cp for dopamine rush which they got when they have good contests or even seeing an accepted solution. AND AND NO ONE CARE FOR YOUR RATING NOT EVEN UR BEST BUDDIES OF COLLEGE.

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

        Please don't compare 5 stars on codechef with candidate master on codeforces.

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

          It's actually Expert in Codeforces

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

          viwreck U know the feeling right,I just wanted to let itiswhatitizChiyu_0_O know that rating or star shouldnt be your priority ,It will not matter if u are really good in dsa...And I know candidate master should never be compared to codechef any star ,cause I have even seen many people with 6 and 7 star by doing only long challenge(U can see India's no 1 on codechef right now for reference)/

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

I was wondering how they choose the testers , is it a complicated proccess?!

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

Hoping for shorter problem descriptions just like the announcement.

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

As a tester, I request some contribution.

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

    What was that, and who are you? :D

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

      To all you downvoting — do you realize that this was in response to the first revision of the comment?

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

It's just me or someone also felt that Codeforces rounds per month, are less nowadays?

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

    I also thinks so. Might be Mike and his team are planning to do something against cheaters, because from past 3-4 months everyone knows what is happening...

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

      Or maybe, because there are lesser contest proposals these days.

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

        I think the proposal queue is quite long and there are still many writers waiting. From my personal experience, I finally get KAN's review exactly 4 months after I propose my friends' and my contest. Moreover, our contest doesn't even have a coordinator to assign to. Coordinators are so busy and committed to their work. We should thank them for their devotion.

        Anyway, in the period of less contests, don't forget there are considerable amount of nice problem in GYM and previous contests. Go and solve them!

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

As a tester, I can confirm that the problems are awesome and you guys will enjoy the contest.

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

Wish you all luck ^^

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

Great round id

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

Since this is a palindromic round ( 696 ). Hoping to see one question on Palindrome :D

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

anyone waiting for round #700?

»
3 года назад, # |
  Проголосовать: нравится -10 Проголосовать: не нравится

anyone waiting for round #700?

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

I will try to solve solve A,B,C. Good Luck Every One, Keep Practicing and keep shining.

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

поставь + пж

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

Thank you lgorl for this contest! Good luck to everyone!

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

Hopefully this round lives up to its ID.

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

Good luck to everyone!!

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

IgorI orz

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

Out of the given 5 or 6, solving how many statements within the 2 hours of the contest would be considered 'reasonable' for a relative novice?

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

    I couldn't solve one for this round :(. It's damn tough.

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

      I still don't get what was to be done in the second one... Sending the first two primes after 1, each at least d apart from one another, did not always seem to produce the minimum number and checking for every number was a bit too resource intensive.

      Am curious about the solution...

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

        The number has atlest 4 divisors if it's a multiple of 2 primes. The least first prime is $$$a >= 1 + d$$$, and second $$$b >= a + d$$$. As soon as any number is a multiple of some primes, if we choose only two primes, which are the smallest possible, the result a * b will be the smallest.

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

          Yeah, I did just that but weirdly, it was showing 'wrong answer for test case 2'.

          Eg. outputs of my program:

          234 -> 114481, 10000 -> 200250077, 1 -> 6, 2 -> 15,

          Don't know what went wrong...

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

            Your ansewer for 3 is 28 somewhy. But 2 and 1 is 28's divisors. So, I would assume function findPrime() is not correct

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

Please make short statements for hard problems so we can switch another problem easily if we can't solve

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

    Short statements are good but I think in contests like ICPC one can struggle if he doesn't have the habit of reading long statements and find the real problem out of it.

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

Hope a good result for all

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

Am I the only one who don't see English Statements?

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

    sometimes when you open this site , the Russian version is displayed, select the English option in right top corner.

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

Auto comment: topic has been updated by IgorI (previous revision, new revision, compare).

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

I'm just new here..... wish me luck..

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

Hello today i do late comment ..you guys miss me? So i want to say that its been a great journey at codeforces with you all.Such a nice community of coders and mathematicians. Good luck to all div2 participants along with me..lets binge solve tonight wohooo XD

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

Hope this round to be a DIV 2 and not DIV 1.5. All the best everyone!

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

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

I am not able to register this contest. It says it is closed. I did't saw register button at the beginning and directly started solving first question. Plz help me out.

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

    You must register at least 5 minutes before the start of the round

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

      Not actually must , for example I missed to register beforehand today . There's something called extra registration which starts ten minutes into the contest , and probably lasts for half an hour .Use that to register if you forget to register beforehand . The only bad little disadvantage is that you cannot submit any solution in the first ten minutes.

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

че за говно?

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

Please? doing this contest unrated

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

Problem E's name describe exactly my thought on pretest 2 of E :)

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

I ruined it. Great Round very good C after a long time ig:/

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

Who all fall for the trap in problem B?

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

Nice round! Thank you, IgorI!

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

some body please tell me about B

I was try to find two prime number where first one is greater then or equal to 1+d and second one is a prime number which is greater then first one and difference between two prime number is greater than or equal d

but my this process get wrong answer verdict

please some one tell me about the approach of B

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

    the answer is LCM of 2-th and 3-th primary numbers, and diff between each prime numbers should be >= than d

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

      lcm of 2 primes is basically multiplication

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

        thanks, I observed this connection but couldn't prove it during the contest

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

          lcm of two numbers $$$a$$$ and $$$b = (a*b)/gcd(a,b)$$$

          so lcm of two primes $$$p1$$$ and $$$p2$$$

          $$$= (p1 * p2) / gcd(p1, p2)$$$

          obviously the $$$gcd$$$ of two distinct primes is $$$1$$$ since they are relatively prime to each other

          $$$lcm = (p1 * p2) / 1$$$

          $$$= p1 * p2$$$

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

    find next prime number for 1+d and then next prime number for (previous prime number)+d.

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

    i guess your approach is correct ..you are missing somewhere else i think

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

Is C a graph problem or DSU?

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

    I did brute force , because when we fix the first two numbers , the whole process becomes fixed . I don't know if it will pass system test.

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

      For what i undestand your solution works in $$$O(n^3)$$$, if you notice that in the first two numbers, one of them should be the maximum value of the array, so the complexity become $$$O(n^2)$$$

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

        Yup , I considered that . But i also used set in c++ to find the biggest number and the other number faster . So mine is $$$O(n^2logn)$$$ . Since 2*n was around 2000 i thought it might work .

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

contest not gut!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

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

Very unbalanced problemset, sucks to say it, but it's what it is.

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

How to solve D?

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

    Let dp1[i] means if you only consider the piles in [1,i] and make every piles in [1,i-1] empty, the number of stones in i. Specially, dp1[i] = -1 if you can't make every piles in [1,i-1] empty.

    Similarly, let dp2[i] means if you only consider the piles in [i,n] and make every piles in [i+1,n] empty......

    So, not considering the swap opertion, we can see that if for some i, dp1[i]=dp2[i+1]&&dp1[i]!=-1, the answer is YES.

    For swap operation, just iterate for the position you swap and get the new dp value near the swapped positions, which is O(1).

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

Interesting problems! Could D be solved using Segment Trees? I tried but got WA on pretest 2.

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

Can I know the approach for div A?

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

    If you do not have two consecutive digits equal, you get the maximum length number. Going from left to right the first integer, you try to have in d the largest possible number, different from the previous one

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

can anyone explain how to solve question 3?

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

    Here comes the key observation. let max(array) = M.

    1. M should consist in the first pair. if we don't choose the biggest element, (next 'x') <= M, since all elements are positive, we can't eliminate M since M+1 > x

    2. If the first pair is chosen, choosing the rest automatically completes. Let's choose the first pair arbitrary. Eliminate the pair from the array. Then the next 'x' is M. by 1., we should choose the biggest element from the remaining array. But this time we know the sum of the pairs. Now, the pair automatically completes since we know one element and the sum of two elements.

    After choosing the first pair by brute force, we can complete all the steps in N log N using multiset. The number of possible 'first pair' is N-1. So we can complete the algorithm in O(N^2 log N).

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

что то на пендосском

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

How to solve C ?

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

    Hint: For a particular x you must select two integers where one of them is the max of remaining elements.

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

Apparently multiple people solved C the same way i did, can anyone explain how i got TLE? my code's complexity should be fine...?

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

Stuck on figuring out C for more than 1.5 hrs. Approach anyone?

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

What is the intended complexity for C? I think N^2LogN should pass. Or maybe I am calculating it wrongly. Can somebody see? https://pastebin.com/5GypBk22

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

D is amazing, but C... kinda strange problem :/

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

For Div2 C, I implemented brute force graphs , but it gave me TLE , its complexity is probably O(T*(N^2)) or O(T*(N^3)) . I am not sure.

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

After solving A and C in like 25 minutes , I gave 1.5 hours on B and still I have absolutey no idea how to do it, LOL dont have any maths background ,I am always unable to do these kinds of maths problem.

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

    how to solve C can u please elaborate your approach thanks in advance !!

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

    Just find the prime numbers upto 10^7 and select the prime numbers at minimum possible distance from d.

    First divisor = 1

    Second divisor = (nearest prime number to 1+d)

    Third divisor = (nearest prime number to Second divisor + d)

    Fourth Divisor = The number itself

    Answer = Second Divisor * Third Divisor

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

    You have to just find the product of first two prime numbers such that the difference between (1,p1) and (p1,p2) is atleast d where p1<p2.

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

    Problem B was more logic than maths.

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

Thanks for the contest!

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

I found C TL to be pretty strict. I'm not sure what the intended is but $$$O(n^2 \log n)$$$ in C++ passed comfortably while the same code in Java TLEd.

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

    Same here. It doesn't even go past pretest 2 in Java using TreeMap.

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

    You could avoid the logn factor by using a count array instead of a map(as A[i]<1e6) and after each iteration instead of resetting the entire array you could only reset the values which occurred during that iteration. This solution has a bit more implementation but you would have to worry less about about fst.

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

      I can see the $$$O(n^2)$$$ solution now. However simply because you can spend extra effort to find a faster solution in order to pass in a certain language doesn't justify the tight TL. Unless if the TL was intended to block log solutions (which it did a bad job of), I think it would've been better to make it looser.

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

        Yeah, maybe if n was 2000 it would have blocked even the C++ solutions with extra logn but I'm not sure.

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

Some test cases for D that I have caught and resolved

2
8
2 2 2 2 1 3 2 2
7
1 2 3 5 4 6 3
  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    can you please tell how you resolved it, i'm trying and it's still giving WA on pretest 2.

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

Cool contest. I particularly like C, although I wasn't able to solve it in-contest.

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

Could someone pls tell why my solution TLEd for problem B? https://codeforces.com/contest/1474/submission/104805897

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

Couldn't solve D but loved the problems.

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

Couldn't solve D but loved the problem set and enjoyed a lot.

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

In Problem B, if d =3 what will be the divisors of the answer ?

»
3 года назад, # |
  Проголосовать: нравится -38 Проголосовать: не нравится

Probably the simplest solution of C 104805814

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

I solved problem E 1 minute after contest ended... :(

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

What is the greedy soln to D (if there is ..)? Solely greedy based and no dp ....

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

    There is n't much dp other than prefix sum calculation.My solution:- if we have to remove all piles lets start from 1st one as it has only one neighbour.so a[0]<=a[1] similarily a[2]>=a[1]-a[0],a[3]>=(a[2]-(a[1]-a[0])) so on.so our problem reduces to finding an array with atmost one swap such that after swap for each position if position is even sum of even indexed number(after swap) >=sum of odd indexed number(after swap).and at final position odd_sum[n-1]=even_sum[n-1] to ensure there is no piles remain at last.Now it is an well known prefix sum implementation problem.If any doubt plz comment.

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

I am seeing codeforces's upcoming contests list empty for the first time.

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

I think D was leaked today.

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

Can Someone Pls Explain why my code gives a TLE with complexity O(n^2logn) and some codes with the same complexity pass easily

My Submission = https://codeforces.com/contest/1474/submission/104812694

Other Submission — https://codeforces.com/contest/1474/submission/104801893

Any Help will be appreciated.. I am clueless

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

    I believe it because erase(int) will erase all of that number in the set, so then you may erase the begin() of an empty set, which will cause TLE.

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

    You shouldn't do s.erase(a[i]). In this case all a[i] are getting removed while only one should get removed. Now if all elements are same, doing this makes the multiset empty and s.erase() will give TLE.

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

My 10 months-long fuckups-streak finally broke today. From writing buggy codes, to missing submiting the solutions to difficult problems by a few seconds, many times, and missed reaching the Master as consequences.

It all will end today, once the ratings get updated :D

Thanks for the contest, I'll finally become master today :) :) :)

»
3 года назад, # |
  Проголосовать: нравится -27 Проголосовать: не нравится

constructive-adhoc-forces... ... -50 rating ...

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

I misread D ( realized after an hour) and thought you can swap any pair(not necessarily neighboring).Does anyone know how to solve this version?

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

    Same situation... Realized only when 20 minutes left

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

    Edit: wrong solution.

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

      I solved D using those two condition but I don't know how to prove they are sufficient. Can you help me out?

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

      Hey, I was working on it and I think I found a counter-case.

      counter-case : n = 8, 3 4 6 4 4 6 4 3

      This array follows the two condition but it is not a good array. I think the tests were a little weak and I was able to pass through.

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

        Thanks. During contest I thought I can prove this by induction. Now I've found a mistake in the proof.

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

          Same here. I thought I had it in the contest. I actually came up with this solution because of the same misreading mistake XD

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

      I uphacked your solution ^^

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

Thanks for this contest. I'm very excited that I will reach Master tomorrow morning!

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

.

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

I think the amount of code in question c is a bit large, maybe it is enough to output yes or no?-

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

Can some one tell me what is the difference between g++11 and g++17 that I got WA for my solution for C with g++17 and got accepted with the same code with g++11?!

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

Does someone happen to know when the next round is going to be? (guess now I'm into cf)

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

I am wondering about the reason behind no new upcoming contest. Is it the case that there are no new problems proposals to pick up? Or, it is just a bit of breathing time for the admins since they have been working so hard continuously.

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

Looking at the empty upcoming contest section , feels sad .

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

    There is one upcoming AtCoder Beginner Contest this weekend :)

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

      Yeah I know there is atcoder round , codechef cookoff etc. But i don't know why codeforces rounds hits me differently :')

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

    You don't have to be sad anymore! A div3 is scheduled

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

Why there is no upcomming contest ??

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

Give me a round, or give me death!

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

B. Different Divisors for input d=381 four divisors should be (1, 1+d, 1+2d, (1+d)*(1+2d)) i.e (1, 382, 763, 291466). So answer should be 291466. but given answer is 294527. I think (1, 1+d, 1+2d, 1+3d) this should 4 divisors instead of (1, p, q, pq) or (1, p, p^2, p^3) please anyone explain this :( Correct me if I am wrong

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

      Well, you can't generalize the solution in this case. You are correct the answer in be of the form (1, p, q, pq) where a = pq. Moreover, according to question constraints, p-1>=d, q-p>=d, pq-p>=d. You can read the editorial for the rest of the solution. Your assumption of (1, 1+d, 1+2d, (1+d)*(1+2d)) is wrong because you can't say for sure that 1+d and 1+2d are prime numbers.