Dragmon's blog

By Dragmon, 6 months ago, In English

Greetings, Codeforces!

We, CodeClub IIT Kharagpur bring to you second edition of CodeNite 2025. a competitive programming contest with individual participation to be held on Codeforces, sponsored by Intercollegiate Informatic and Competitive Programming Camp private limited(IICPC India). This contest is OPEN TO ALL, irrespective of college, year of study, or department. The top performers may get referred to top quants partnered with IICPC India. The problemset is aimed to have difficulty of a Codeforces Div. 2 round.

Details are as follows:

Prizes:

  • 1st — 4000 INR
  • 2nd — 2500 INR
  • 3rd — 1500 INR
  • 4th — 1000 INR
  • 5th — 1000 INR

Testers: Um_nik, picramide, harshith_04, morphinecode, psp_09, pastimeplays, Mehul_05, Praty_sp, its_magic

Contest Link: Link

Register here if you want to take part and be eligible for the prizes: Google form link

Deadline to register: 2 PM IST, 26th October 2025.

NOTE — Though everyone is encouraged to participate, only Indian college students are eligible for prizes.

See you all on the leaderboard!

A word from our sponsor:

IICPC hosts two flagship annual recruiting events — Quantfest and Codefest — both of which have gained immense reach across India.

The upcoming IICPC Codefest 2026, scheduled for January till April 2026, will be conducted offline. Institutions interested in participating are requested to contact us via their institute faculty or club head at codefest-inquiries@iicpc.com.

For context, over 40 students were recruited by leading quant and software firms through Codefest 2025.

UPD1: The contest duration has been updated to $$$2$$$ hrs.

UPD2: Contest registration has begun. You can click on the contest link and register.

UPD3: Editorial

Thank you so much for participating!

Congratulations to the winners(with tie at posititons $$$2$$$ and $$$5$$$, how did you guys manage this xd):

  1. Dominater069
  2. sai-17
  3. VanshRA
  4. jatin123258
  5. Ashwanth.K
  6. kingmessi
  • Vote: I like it
  • +183
  • Vote: I do not like it

»
6 months ago, hide # |
Rev. 2  
Vote: I like it +57 Vote: I do not like it

Hoping for a positive reception from the community for the contest, and that you all enjoy the problems.

»
6 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

a nightmare, part-2

(well this was just a meme, i hope that you write good unpredictable problems this time, and i hope that this time cheaters would'nt ruin the image of iit kgp codenite)

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

Clash with Indian ICPC Camp

»
6 months ago, hide # |
 
Vote: I like it +27 Vote: I do not like it

Please don't repeat what happened with the last contest organized by IIT-KGP!!

»
6 months ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

Super excited for CodeNite 2025! Huge shoutout to CodeClub IIT Kharagpur and IICPC India for organizing such an incredible opportunity for the programming community.

»
6 months ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

Super Excited and Looking Forward for the contest !!

»
6 months ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

IICPC supporting anything would be great only :) , Huge fan of their work particularly Codefest and Quantfest. Keep it up guys.

»
6 months ago, hide # |
Rev. 2  
Vote: I like it -13 Vote: I do not like it

Wtf only 5 testers? EDIT: more were added later

  • »
    »
    6 months ago, hide # ^ |
     
    Vote: I like it +39 Vote: I do not like it

    Hi, this is an unrated codeforces gym contest where we as authors are not receiving any compensation for the problems that have been set. There are significant differences that these have in comparison to rated rounds or championships. People don't tend to agree to test these contests as they don't find it worth their time and effort, which is fine thinking as unrated contests are not of the same significance and don't reach the same level of audience as a rated round. The above contest isn't even accessible if not through the link that has been put up in the blog.

    Also, its the quality of testers that matters more than the numbers. An experiened tester's feedback is quite more extensive and helpful than one who has tested the round for the first time. We do have more testers who will be testing out and whose names we'll be putting up as and when they finish testing.

  • »
    »
    6 months ago, hide # ^ |
     
    Vote: I like it -15 Vote: I do not like it

    Apparently 3 Specialist = 2 Person

    • »
      »
      »
      6 months ago, hide # ^ |
       
      Vote: I like it +12 Vote: I do not like it

      When he commented, there were $$$5$$$ testers. I've added one more and will add some more when they've finished testing.

»
6 months ago, hide # |
 
Vote: I like it +26 Vote: I do not like it

Omg Um_nik is testing in this contest !!

»
6 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Will the format be similar to Div 2 as well?

»
6 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Is this a rated contest?

»
6 months ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

The contest will be starting soon. All the best to all the participants!

»
6 months ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

All the best to everyone participating! Good luck to all ^_^

»
6 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

is the questions in sorted order?

»
6 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

When will we able to see other participants code after the contest or will the code won't be made visible (as, this contest was only accessible through the link)?

»
6 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can someone give some hint for problem c ? (Only hint)

»
6 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

liked the questions, good contest. was E about eulerian tour and then efficient searching using seg tree?

  • »
    »
    6 months ago, hide # ^ |
     
    Vote: I like it +4 Vote: I do not like it

    We'll post editorial soon, but we didn't use seg tree to solve it.

  • »
    »
    6 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it +9 Vote: I do not like it

    You can maintain the paths from top to bottom using DSU (kind of disjoint paths where you go from a node to minimum of its children). Every query just takes one path (the component of node b) removes the leaf and merges it with another path if required.

    • »
      »
      »
      6 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      does the technique used in E have some common name ? , and it would be helpful if someone recommend similar problem to E, for practice. Thanks.

      • »
        »
        »
        »
        6 months ago, hide # ^ |
         
        Vote: I like it +2 Vote: I do not like it

        It's called path compression. You can read more about it at https://cp-algorithms.com/data_structures/disjoint_set_union.html#path-compression-optimization .

        The general idea is to store mappings from a node to some leaf node. And, when a leaf node is removed, we want all the mappings that pointed to this leaf node to point to some other leaf node. In a sense we want a chain/path of redirections, but finding where a node leads to should not be done in $$$O(n)$$$. Path compression will reduce that time complexity to amortized $$$O(1)$$$.

        You can also think of why you need a DSU like this: all the remaining nodes are divided into disjoint subsets such that each node in a subset leads to the same leaf node. Now, when a leaf node corresponding to a subset gets removed, we want this subset to end at some other leaf node. That (some other) leaf node will have its own corresponding subset that lead to it. So, we are merging both the subsets.

        Another common issue with non-trivial DSU problems is where to store information corresponding to a particular set? For example, we want to store the destination leaf node for each set. Each set has a leader node that identifies it (might change on the unite operation). We can maintain a vector of length n as info, and store that set specific information at info[leader].

        • »
          »
          »
          »
          »
          6 months ago, hide # ^ |
           
          Vote: I like it 0 Vote: I do not like it

          thanks , your explanation helped a lot.

        • »
          »
          »
          »
          »
          6 months ago, hide # ^ |
           
          Vote: I like it 0 Vote: I do not like it

          In this approach rank/size compression wont be possible since we need the successor node of a leaf that is removed to be the parent of the sets . Am i right here?

          • »
            »
            »
            »
            »
            »
            6 months ago, hide # ^ |
             
            Vote: I like it +1 Vote: I do not like it

            There is an ambiguity in my response. The chain of redirections/reassignments we are compressing is different from the path in the DSU. We can use any implementation of DSU, with or without path compression, to implement it. All we need is to track which leaf node corresponds to a set of nodes, efficiently.

            One possible sub-problem that can be derived from this problem is: given an array $$$a$$$ of length $$$n$$$, $$$1 \le a_i \le n$$$. You have to process queries of two types. $$$1~i$$$: Answer with the value of $$$a[i]$$$, $$$2~u~v$$$ Assign all the elements with value $$$u$$$ to $$$v$$$, i.e. for all $$$i$$$, set $$$a[i] = v$$$ if $$$a[i] = u$$$. You can try to think of a solution for this problem.

            I have annotated my solution. My implementation is slightly different from the editorial. https://privatebin.net/?b3bc9edeee694c39#B7YoZ5Eow6yuAnWe26syW1V8fNascSbVVBb8WQTVN4uA

  • »
    »
    6 months ago, hide # ^ |
     
    Vote: I like it +4 Vote: I do not like it

    Here is another easy solution: Get the dfs order of the rooted tree where children of each node are sorted by $$$a_i$$$. For any node, the answer would be the nearest leaf to it in this order. So we maintain a set of leaf nodes ordered by tin time. For any query find the lowerbound in this set. When removing this node, check if the parent is now a leaf, if yes just insert in the set.

»
6 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

can any body explain third problem

i thinked like first move from right and try to make a[i] as large as possible with a[i]<=a[i+1] but then i realised that order will matters ? we can not do operation from last

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

Here is the editorial. Hope you guys enjoyed the contest!

»
6 months ago, hide # |
Rev. 3  
Vote: I like it 0 Vote: I do not like it

I hope that the prize money doesnt get split among the tie breakers :)
Good contest.

»
6 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Why am I not able to see the failing test case, now that the contest has ended?

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

    Have fixed, you should now be able to see failed test case for the code that you've submitted.

»
6 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

Nice contest. Thanks for the problems.

»
6 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Dragmon Can you make other people's code visible?

»
4 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

im your son