twoplusthree's blog

By twoplusthree, 17 months ago, In English

Hello Codeforces!

We (twoplusthree, VS-Codes, Anupam_Ghosh and om_mittal7) are glad to invite everyone to Replay of JU BitFest Season One 2023 which is scheduled on [contest_time:445869].

BitFest is an annual ICPC-style Programming Contest organised for freshers and sophomores of Jadavpur University. This year marked the very first edition of this contest, which consisted of two rounds — online Prelims and on-site Finals. We hope you like the problems we have created!

You will be offered $$$10 - 15$$$ problems (from the combined problemset of both the rounds), and $$$4$$$ hours to solve them. You may participate alone, or in teams of not more than $$$3$$$ people. The problems vary in difficulty, ranging from Easy to Intermediate. Some of the problems may also require a classical solution. Note that the contest is unrated.

We would also like to thank:

Links:

Good luck, and have fun!

UPD 1: Apart from the Replay problemset, there will be a non-zero number of new problems set by our testers — (Yomapeed, beedle and DrearyJoke), to make the round more interesting :-D. The total number of problems will remain $$$10 - 15$$$.

UPD 2: Registration for the contest is now live.

UPD 3: Contest is live now. Best of luck!

UPD 4: Contest is over. We hope you enjoyed the problems. Feel free to discuss them here. We will release the editorial soon.

UPD 5: Thank you all for participating! Here are the winners:

Rank Contestant(s)
1 kasparovian
2 gupta_nitin
3 Kira_1234
4 Team Badut (floralfield, VincentK, aufannn)
5 Team Kindered_spirits (Coder_Nayak, sloppy_coder, _gyrFalcon_)

First solve for every problem:

Problem Contestant(s)
A benzyl
B Team BhavyaKashyap (bhavya_rajdev, zxy0909)
C gupta_nitin
D1 Team BhavyaKashyap (bhavya_rajdev, zxy0909)
D2 kasparovian
E kasparovian
F kasparovian
G kasparovian
H Team crush ki smile :uwu: (18o3)
I Team skull issu (X-OR, TECHlES, -ZORD)
J Jishudip
K prodipdatta7
L YouKn0wWho

UPD 6: The contest editorial is out! All contest submissions have been made public.

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

| Write comment?
»
17 months ago, # |
  Vote: I like it +26 Vote: I do not like it

As a Setter I need contribution

»
17 months ago, # |
  Vote: I like it +14 Vote: I do not like it
»
17 months ago, # |
  Vote: I like it +19 Vote: I do not like it

Hoping everyone takes part, and finds the problem set interesting!

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

As a setter, I can confirm that Harry Potter fans will like Problem G very much :-D

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

added to calendar

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

Excited to take part in this contest! Great initiative by the setters and testers :) Would recommend everyone to participate in the contest as it will be surely a great one.

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

Can't wait!

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

Excited for this event ✨

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

As a participants i expect good quality of questions :)

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

Hoping the problem set will be interesting

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

It's the first ever contest on this platform hosted by JU- genuinely excited for this landmark event! <3

»
17 months ago, # |
  Vote: I like it +20 Vote: I do not like it

Reminder: Contest starts in less than an hour! Good luck!

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

Can someone tell me how to solve K?

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

    maintain a multiset of all zombie's health. at any point of time sum of x in first query become greater than any element erase it form multiset and subtract it from total sum. and along with that subtract mst.size() times x as well. The main point is how you are going to reduce the total sum at every step. I wrote these line of code I think you can get a idea out of it.

    int n,k;
    cin>>n>>k;
    vector<int> vt(n,0);
    multiset<int> mst;
    int sum = 0;
    for(int i = 0;i<n;i++){
        cin>>vt[i];
        mst.insert(vt[i]);
        sum += vt[i];
    }
    
    int td = 0;
    for(int i = 0;i<k;i++){
        int t;
        cin>>t;
        if(t==1){
           int x;
           cin>>x;
           // td = x;
           while((*mst.begin()<=td+x)&&(mst.size()>0)){
             sum -= (*mst.begin()-td);
             mst.erase(mst.begin());
           }
           td += x;
           sum -= (x*mst.size());
           // cout<<sum<<" "<<x<<" "<<mst.size()<<endl;
        }
        else if(t==2){
           int y;
           cin>>y;
           sum += y;
           mst.insert(y+td);        
        }
        else{
           cout<<sum<<endl;
        }
    }
    • »
      »
      »
      17 months ago, # ^ |
        Vote: I like it +7 Vote: I do not like it

      This is one of the most elegant solutions I have seen! Really nice approach to inserting new elements and also handling the old elements.

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

    Keep a priority queue in max heap containing the health of the zombies and keep a variable denoting total sum.For query type 1 ,add x to total damage and keeping popping elements untill top element <= total damage so far and subtract it from sum as its dead.The sum of health of alive zombies is sum of their initial health — no.of zombies alive * total dmaage so far.While adding a new zombie for query type 2 consider its health to be (y + total damage so far) and push this to priority queue

  • »
    »
    17 months ago, # ^ |
    Rev. 8   Vote: I like it +4 Vote: I do not like it

    Code Link

    Thankyou authors for such a nice problemset.

»
17 months ago, # |
  Vote: I like it +4 Vote: I do not like it

Problemset were good, Is there editorial available for this contest?

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

    Will be released by Sunday. Good to hear you enjoyed the contest.

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

    The editorial has been released now. Hope you like it :-)

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

Really cool problem set!

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

wow. i enjoyed very much. What a problem these are. thank you very much all authers.

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

    Glad to hear that you enjoyed the contest and found the problems interesting

»
17 months ago, # |
Rev. 3   Vote: I like it +17 Vote: I do not like it

Nice Problemset.Enjoyed.
How to solve L / E ?

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

    For E:

    Tutorial
    Implementation
»
17 months ago, # |
  Vote: I like it +3 Vote: I do not like it

can you please make the submissions public

»
17 months ago, # |
  Vote: I like it +5 Vote: I do not like it

twoplusthree can you tell me how you made {You} of LGM colour?

»
17 months ago, # |
  Vote: I like it +7 Vote: I do not like it

I really had fun solving the problems. Short Problem Statements with good logic and implementation. That's what I crave for.

Really Good Initiative.

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

Enjoyed the contest. The problems were really cool as they have short statement with proper informations. Although I could manage to solve only 4 of them. More specifically loved the problem "Fine De" which I manage to solve using binary search. I want to know is it possible to public others submissions?

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

    Great to hear that! We'll be posting the Editorial of the contest quite soon, and all the contest submissions will be made public after that. This is done so that those who wish to can spend a little more time pondering upon the problems :-)

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

Can anyone tell me some hints regarding Problem G : Gringotts. I am thinking in this Direction — Let's suppose there are 'X' gold coins and 'Y' silver coins, then according to question, equation :- X*g + Y*s = n, and my answer is 17*X + Y. So, we have to increase the value of 'X' as much as possible, that is to find smallest value of 'Y', such that, (n - Y*s) % g = 0, what will be this minimum 'Y'. This was the direction I was thinking for, Is it right, If it is, then how to proceed further, as we have also constraints of Test Cases <= 10000

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

    What if the weight of gold is so high that replacing it with silver is not optimal. Think about any such case.

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

    also we can consider that if 17*s>=g, that amount which we can remove (of s) to convert it to g would always need to be a multiple of the lcm of both g and s. So here's an easier way of understanding it (in my opinion).

    then we can easily find the quantity of g and s and compute the answer.

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

      Also it gives a time complexity which can pass all the tests. (logarithmic due to taking the gcd using in-built function)

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

any hints for C ?

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

Contest was really fantastic, and its a humble request to organizers and setters of this contest, That please provide the tutorial and make submissions public. twoplusthree

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

    The editoral is out now, and all contest submissions have been made public. Apologies for the slight delay.