aastik231205's blog

By aastik231205, 5 weeks ago, In English

Greetings, Codeforces Community!

We, the Programming and Algorithms Group, are excited to invite you to our upcoming event, Insomnia 2026! This event is proudly sponsored by IMC.

Insomnia'26 Banner

Format

Insomnia 2026 is an ICPC style team contest where you would be given 10-15 problems in the span of 4 hours, for teams of at most 3 members.

Contest Linkhttps://mirror.codeforces.com/contestInvitation/4dbe34f649efdf387e5ea871d742fb461a3c242d

Please make a team on codeforces with same name as registered on unstop to be eligible for prizes.

The contest will be conducted in a hybrid format. Students from the following institutes are required to participate in offline mode:

  • Indian Institute of Information Technology Hyderabad (IIITH)
  • Indian Institute of Technology (BHU) Varanasi (IIT BHU)
  • Indian Institute of Technology Bombay (IITB)
  • Indian Institute of Technology Delhi (IITD)
  • Indian Institute of Technology Guwahati (IITG)
  • Indian Institute of Technology Kanpur (IITK)
  • Indian Institute of Technology Madras (IITM)
  • Indian Institute of Technology Roorkee (IITR)

Only teams comprising of Indian Undergraduate or Postgraduate students are eligible for prizes, but everyone is welcome to participate. It is compulsory to register on Unstop to be eligible for prizes.

Prize Distribution

Sponsors

This event would not have been possible without the generous support of our sponsor.

  • IMC: IMC is a global trading firm powered by a cutting-edge research environment and a world-class technology backbone. Since 1989, we’ve been a stabilizing force in financial markets, providing essential liquidity upon which market participants depend. Across our offices in the US, Europe, Asia Pacific, and India, our talented quant researchers, engineers, traders, and business operations professionals are united by our uniquely collaborative, high-performance culture, and our commitment to giving back.

Organizing Team

UpdEditorial is out!!!

Upd 2 — Here are the results after careful verification of all entries

Prize Winners

We will reach out to the winners soon to distribute the prizes and Also, Note that all decisions taken are final and binding.

Announcement of Insomnia-26
  • Vote: I like it
  • +195
  • Vote: I do not like it

»
4 weeks ago, hide # |
 
Vote: I like it +27 Vote: I do not like it

CFBR!

»
4 weeks ago, hide # |
 
Vote: I like it +21 Vote: I do not like it

cfbr

»
4 weeks ago, hide # |
 
Vote: I like it +25 Vote: I do not like it

cfbr

»
4 weeks ago, hide # |
 
Vote: I like it +34 Vote: I do not like it

As a Problem Setter, I surely say that the problems are really interesting and fun to solve.

»
4 weeks ago, hide # |
 
Vote: I like it +18 Vote: I do not like it

As a tester, I really liked some of the problems , they were really interesting and fun to solve.

»
4 weeks ago, hide # |
 
Vote: I like it +16 Vote: I do not like it

cfbr

»
4 weeks ago, hide # |
Rev. 2  
Vote: I like it +14 Vote: I do not like it

As a tester, I can guarantee the problems are very nice and fun !

»
4 weeks ago, hide # |
 
Vote: I like it +18 Vote: I do not like it

Cfbr!

»
4 weeks ago, hide # |
 
Vote: I like it +18 Vote: I do not like it

Cfbr!!

»
4 weeks ago, hide # |
 
Vote: I like it +13 Vote: I do not like it

Despite the name Insomnia, it's happening in the evening.

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

As a problem setter, hope you have fun solving the problems!

»
4 weeks ago, hide # |
 
Vote: I like it +11 Vote: I do not like it

cfbr

»
4 weeks ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

As a problem setter, I would really like everyone to try all problems.

»
4 weeks ago, hide # |
 
Vote: I like it +31 Vote: I do not like it

As a tester, I identify myself as a penguin.

»
4 weeks ago, hide # |
 
Vote: I like it +23 Vote: I do not like it

Where can we find link for the codeforces round (we already registered fron unstop)

»
4 weeks ago, hide # |
 
Vote: I like it -30 Vote: I do not like it

H was cute but the other 9 problems I solved were all kind of boring.

»
4 weeks ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

how to solve F?

  • »
    »
    4 weeks ago, hide # ^ |
    Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    n(n-1) D(n-1) + n(n-1)(n-2)D(n-2)....

    D is derangement

    This further simplifies as A(n) = nA(n-1) + n(n-1)D(n-1)

    Precompute both, answer in o(1)

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

      I couldn't optimize my O(n^2) solution

      for (int n = 3; n <= N; ++n) {
              for (int len = 1, x = 1; len < n; ++len) {
                  x = x * (n - len + 1) % mod;
                  (ans[n] += x * dp[n - len] % mod * (n - len) % mod) %= mod;
              }
          }
      

      which is something like that

      • »
        »
        »
        »
        4 weeks ago, hide # ^ |
        Rev. 3  
        Vote: I like it 0 Vote: I do not like it

        what is your logic?

        this was mine

            dr[1]=0;
            for(int i=2;i<=1e6;i++){
                dr[i]=(i*dr[i-1])%mod;
                if(i%2==0){
                    dr[i]=(dr[i]+1)%mod;
                }
                else{
                    dr[i]=(dr[i]-1)%mod;
                }
            }
            for(ll i=2;i<=1e6;i++){
                dp[i]=(i*(i-1)%mod)*dr[i-1]%mod+(i*dp[i-1])%mod;
                dp[i]=(dp[i]%mod+mod)%mod;
            }
        
»
4 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Editorial When?

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

Question B was a bit deceptive for me

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

Why are there 2 different gyms for the same contest?

Official from Gym tab on codeforces: https://mirror.codeforces.com/gym/106439

From invitation Link: https://mirror.codeforces.com/gym/680528

And why the one from Gym tab have the offline standing only? Very confusing.

Otherwise, great problems!

»
2 weeks ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

When will the results be announced?