When submitting a solution in C++, please select either C++14 (GCC 6-32) or C++17 (GCC 7-32) as your compiler. ×

pritishn's blog

By pritishn, 3 years ago, In English

CodeAgon is on 27th September 2020 at 20:00IST.
And I'm sure almost all Indian coders will participate in CodeAgon rather than CF Div1,Div2.

Please change the date for round #673. Otherwise many people will have to skip this round.

Please look into this, MikeMirzayanov .

  • Vote: I like it
  • +169
  • Vote: I do not like it

| Write comment?
»
3 years ago, # |
  Vote: I like it +33 Vote: I do not like it

antontrygubO_o , if you are the coordinator for the round. Please look into this matter.

»
3 years ago, # |
  Vote: I like it -68 Vote: I do not like it

for beginners it is better to participate in DIV2 rather than CodeAgon

PS
  • »
    »
    3 years ago, # ^ |
      Vote: I like it -60 Vote: I do not like it

    Most beginners don't even know about codeagon.

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it -35 Vote: I do not like it

      Right ! So better they give DIV2 and enhance their skills

      • »
        »
        »
        »
        3 years ago, # ^ |
          Vote: I like it -29 Vote: I do not like it

        Well, I can't deny this. But I feel like all expert+ coders should definitely try it out. ¯_(ツ)_/¯

        • »
          »
          »
          »
          »
          3 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          I have never given CodeAgon, should cyans even try it?

          • »
            »
            »
            »
            »
            »
            3 years ago, # ^ |
              Vote: I like it -20 Vote: I do not like it

            Sure try.

            • »
              »
              »
              »
              »
              »
              »
              3 years ago, # ^ |
                Vote: I like it +2 Vote: I do not like it

              Let me rephrase. For a cyan, Div2 or CodeAgon?

          • »
            »
            »
            »
            »
            »
            3 years ago, # ^ |
              Vote: I like it +17 Vote: I do not like it

            i know a coder with rating 1440 (almost) got selected in codeagon and got the job offer

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it -16 Vote: I do not like it

      You are wrong ,instead beginners are the one ,who are sharing codeagon links throughout the WhatsApp, social platforms.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I agree upto some fact, but atleast you will get experience for next time, as there are yearly two contest,

    also this time sadly platform has changed from hackerank to interviewbit, where we cannot use our own editor, so at least participation will get you some experience.

»
3 years ago, # |
  Vote: I like it +12 Vote: I do not like it

I think only 2021/2022 graduates will participate in codeAgon, others are ineligible for prizes and job offers

»
3 years ago, # |
  Vote: I like it +45 Vote: I do not like it

Eventhough its unlikely, I do hope it gets postponed by a day. I hate missing cf rounds lol

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +4 Vote: I do not like it

    I don't think timing will be changed anymore. Guess we'll have to miss it.

»
3 years ago, # |
  Vote: I like it +7 Vote: I do not like it

yea, please do something i have not missed a round in more than two months and I also have to give codeagon. There may be many like me

»
3 years ago, # |
  Vote: I like it -129 Vote: I do not like it

For people wanting link codenation

»
3 years ago, # |
  Vote: I like it -18 Vote: I do not like it

i think you should personally message those officials of codeforces.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it -9 Vote: I do not like it

    Mike don't see my messages. :(

    And I don't know who are the coordinators of the round.

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Please Don't postpone it. just prepone it to today or tomorrow. MikeMirzayanov

»
3 years ago, # |
  Vote: I like it -17 Vote: I do not like it

When CF clashes with a long contest and you really want to do both, do both.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +18 Vote: I do not like it

    It's not a long contest, it's a short contest

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +2 Vote: I do not like it

    It gives opportunity for job/intern at great company Codenation .

    It is super important exam. I know there is going to be a huge cheating scandal in this contest .Hope officials will do whatever possible to stop it . Hope ,Only deserving will get a chance.

»
3 years ago, # |
Rev. 2   Vote: I like it +54 Vote: I do not like it

Someone recently asked to vary Codeforces round times but they were told that Codeforces focuses on the European and Asian users, so I don't think the time should be changed. You only have to skip one round, at least you live in a good time zone. Many people in Japan/North America have to skip rounds all the time because it is so early, and on the weekend at least there won't be school or work for them. Remember Codeforces is international not just India.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it -37 Vote: I do not like it

    Like its a loss from both side, isn't it. Lots of people won't be able to participate and its' a loss for both codeforces and the people. Don't deny the fact that most of the users are from russia and india, so they have customized the time in convinience of both of these countries. Therefore, japan/NA people asking for time change cannot be heard but indian people demanding may be heard. Think practically

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Why not have contests at different times rather than a standard time, this probably won't affect the quality participants(Not me) cause they love cp so much to give contest at any hour, competition is maintained and every nation might get a equal chance.

»
3 years ago, # |
  Vote: I like it +118 Vote: I do not like it

Think positive: there will be much less clarification requests. Help CF coordinators and round authors and participate in CodeAgon!

»
3 years ago, # |
  Vote: I like it +81 Vote: I do not like it

Why not ask to postpone codeagon.

  • »
    »
    3 years ago, # ^ |
    Rev. 3   Vote: I like it -76 Vote: I do not like it

    [Deleted]

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it +12 Vote: I do not like it

      Doesn't mean it has more registers, so it is more important. For example, in IOI, only like top 350-400 qualify to the finals from the whole world. So that is only 350-400 registered users. But in fact, it is a very important contest.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    CF round is for personal improvement and satisfaction mostly, and one can get most of that experience by doing a virtual contest, while this test carries a lot more weigh for a lot of people since it can potentially get them internships and full time roles.

»
3 years ago, # |
  Vote: I like it +32 Vote: I do not like it

Just skip the round and do it as a virtual contest later? Less load on servers, smaller queues and less clarification requests

»
3 years ago, # |
  Vote: I like it +23 Vote: I do not like it

 codeAgon (-_-).

»
3 years ago, # |
  Vote: I like it +26 Vote: I do not like it

Me who rage quit the contest within 10 mins - ![ ](tenor.png) Translation — This is a high-quality insult.

»
3 years ago, # |
  Vote: I like it +5 Vote: I do not like it

Nice Div 1 round .

»
3 years ago, # |
  Vote: I like it +6 Vote: I do not like it

How to solve problems 3, 5, and 6?

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +6 Vote: I do not like it

    Same doubt XD

  • »
    »
    3 years ago, # ^ |
    Rev. 2   Vote: I like it +3 Vote: I do not like it

    5 was dp

    dp[i][1024]

    • »
      »
      »
      3 years ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      what is dp[i][j]?, One observation that I made was that for all k consecutive subsegments to have xor sum of 0, the k subsegment should repeat i.e. 1,2,6,1,2,6,.., where k = 3, somehow we have to choose the first k values such that total cost is minimum.

      • »
        »
        »
        »
        3 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I= guess dp[i][j] is minimum changes required to make the sequence k xor till i if I set value j at index i. Nice thought by someone who wrote this solution.

        • »
          »
          »
          »
          »
          3 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          How will you compute the transitions?

          • »
            »
            »
            »
            »
            »
            3 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            That is the thing Bajrang_Pandey can answer I am thinking over it!

        • »
          »
          »
          »
          »
          3 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          Yes... actually iterate i till B, then if you set j at position i, then calculate the change by subtracting no of numbers equal to j at index i

          here i is effectively i%B

        • »
          »
          »
          »
          »
          3 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          The table is too large. 10^4*10^3 , 10^7 ordered table??!!! And also computing the transitions will timeout I guess?

          • »
            »
            »
            »
            »
            »
            3 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            No it worked ! did you try it?

            • »
              »
              »
              »
              »
              »
              »
              3 years ago, # ^ |
                Vote: I like it 0 Vote: I do not like it

              No, i thought it may time out or show MLE.

          • »
            »
            »
            »
            »
            »
            3 years ago, # ^ |
              Vote: I like it +5 Vote: I do not like it

            I also had the same doubt I don't know were tests weak or memory limits were not more also there were some details hidden in any problem b was becoming y sometimes d was becoming x and also they even can't clear that your solution run on multiple tests . I got confused for hours that Why I was getting WAs on 2nd direct and easy problem. As I was not clearing adjacentcy list thinking of only one Test Case or may be some other error.

            • »
              »
              »
              »
              »
              »
              »
              3 years ago, # ^ |
                Vote: I like it +3 Vote: I do not like it

              Not your fault brother. These problem statements clearly show how they didn't even bother to verify the problems.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Was Q.1 Rerooting on dfs tree or something tricky I wasn't able to approach 1st

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +7 Vote: I do not like it

    Nice to see that everybody is on the same boat

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    How to solve 1 and 2 ? Please 1 first.

    • »
      »
      »
      3 years ago, # ^ |
      Rev. 2   Vote: I like it +3 Vote: I do not like it

      2nd was easy, count nodes with depth < B, say cnt... answer is $$$2^{cnt}$$$ % mod

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      For 2nd all the nodes which are at max distance B from the root can chose their own colour because they have no Bth parent above them. Remaining nodes will just chose the colours based on the rule of alternate colours thus ans wer will be 2^(total number of nodes which are at most B distance from the root )%P;

  • »
    »
    3 years ago, # ^ |
    Rev. 2   Vote: I like it +7 Vote: I do not like it

    For problem 3:

    Let F(n,k) denote the number of distinct necklaces of n beads that can be made with at most k colours.

    Let $$$X_i$$$ be an Indicator Random variable which is equal to 1 if the $$$i^{th}$$$ colour is included in a necklace. So for a given necklace number of distinct colours = $$$\sum_{i=1}^{i=k}{X_i}$$$.

    We need to calculate $$$E[\sum_{i=1}^{i=k}{X_i}] = \sum_{i=1}^{i=k}{E(X_i)} = \sum_{i=1}^{i=k}{P(X_i=1)} = k*P(X_1 = 1)$$$.

    Now $$$P(X_1 = 0) = \frac{F(n,k-1)}{F(n,k)}$$$

    $$$ Ans = k * (1 - \frac{F(n,k-1)}{F(n,k)})$$$

    The value of F(n,k) can be be found here: https://en.wikipedia.org/wiki/Necklace_(combinatorics)