By pikmike, history, 2 weeks ago, translation, In English

Hello Codeforces!

On Sep/14/2020 17:35 (Moscow time) Educational Codeforces Round 95 (Rated for Div. 2) will start.

Series of Educational Rounds continue being held as Harbour.Space University initiative! You can read the details about the cooperation between Harbour.Space University and Codeforces in the blog post.

This round will be rated for the participants with rating lower than 2100. It will be held on extended ICPC rules. The penalty for each incorrect submission until the submission with a full solution is 10 minutes. After the end of the contest you will have 12 hours to hack any solution you want. You will have access to copy any solution and test it locally.

You will be given 6 or 7 problems and 2 hours to solve them.

The problems were invented and prepared by Roman Roms Glazov, Adilbek adedalic Dalabaev, Vladimir vovuh Petrov, Ivan BledDest Androsov, Maksim Ne0n25 Mescheryakov and me. Also huge thanks to Mike MikeMirzayanov Mirzayanov for great systems Polygon and Codeforces.

Good luck to all the participants!

Congratulations to the winners:

Rank Competitor Problems Solved Penalty
1 dzh_loves_mjy 7 204
2 neal 7 231
3 WZYYN 7 250
4 noimi 7 357
5 Um_nik 7 384

And finally people who were the first to solve each problem:

Problem Competitor Penalty
A Kirill22 0:01
B dzh_loves_mjy 0:04
C SSerxhs 0:05
D gleb.astashkin 0:17
E Pigbrain 0:19
F WZYYN 0:54
G OnlyG 0:16

UPD: Due to the issues with problems A and B the round is unrated.

UPD: Editorial is out

 
 
 
 
  • Vote: I like it
  • -539
  • Vote: I do not like it

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

Just 15 points away from specialist!! Hope to cover in this round!!

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

    Good Luck bro!!

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

    lol the rounds unrated. hope you get it next time tho!

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

      My Bad!! either way i was stuck at A for like 10 minutes because of changing statements so, thought of giving up already:(

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

        even I had 1377 was hoping to go back to specialist ,had even solved two questions real quick but never mind

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

          Ohh, so you managed to solve A?

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

            yeah xD knew my logic was right and when they corrected it I confirmed with given output and submitted

            • »
              »
              »
              »
              »
              »
              »
              13 days ago, # ^ |
                Vote: I like it 0 Vote: I do not like it

              can you explain the logic please?

              • »
                »
                »
                »
                »
                »
                »
                »
                13 days ago, # ^ |
                Rev. 2   Vote: I like it +8 Vote: I do not like it

                look at how many sticks there must be, from that you can convert some to coals to have at least $$$k$$$ sticks and $$$k$$$ coals.

                $$$\lceil{\frac{k+yk-1}{(x-1)}}\rceil+k$$$ is the answer

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

                  t = int(input()) for i in range(t): x,y,k = [int(x) for x in input().split()] ans = (k*y) + k count=0 count = m.ceil((ans-1)/(x-1)) count += k print(count)

                  this is the ans i submitted, but i got wa

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

                  I had the same issue. I think the ceil function does not work properly for long long numbers.

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  13 days ago, # ^ |
                    Vote: I like it -38 Vote: I do not like it

                  include<bits/stdc++.h>

                  using namespace std; int main(){ long long int t; cin>>t; while(t--){ long long int x,y,k,c,d; cin>>x>>y>>k;

                  c=(k+y*k-x)/(x-1);
                  d=(k+y*k-x)%(x-1);
                  if(d==0)
                  cout<<c+1+k<<endl;
                  else cout<<c+2+k<<endl;
                  
                  }
                  

                  } whats the prob wid this code?

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  13 days ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  When x>(k+y*k), we need to print k+1 as you will exchange one stick for x sticks and k sticks for k coals.

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  13 days ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  Cuz you have int as input for x,y,k

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  13 days ago, # ^ |
                    Vote: I like it +1 Vote: I do not like it

                  thank you so much. It got accepted

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  13 days ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  yep it got lot of my time too

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

                  Nicely explained

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  13 days ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  NoobM, shaded I had the same issue. And you are right python's inbuilt ceil function and as a matter of fact square root function does not work properly in case of long long numbers.

                  So, to solve this issue I found out a solution on stackoverflow. To find the ceil value of division of a by b you can simply do -(a//(-b)) in python and -(a/(-b)) in C++, i did this and got AC.

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  13 days ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  oh nice! Thanks for the solution!

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  13 days ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  i also do the same very easy and simple logic

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  13 days ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  you are right bro

              • »
                »
                »
                »
                »
                »
                »
                »
                13 days ago, # ^ |
                  Vote: I like it 0 Vote: I do not like it

                look you have 0 coals so you will need k steps for k coals.Now as for the sticks you need k sticks to match the coals for conversion into torch.You also need k*y sticks extra so they can be converted into coals later.So, total you need to add (k*y+k-1) sticks extra(since you already have one stick). Now in every trade for sticks you gain x-1 sticks,so, number of steps required is :- (val/(x-1))+min((int)1,(val%(x-1))) where val is (k*y+k-1). So,total no. of steps is (k+(val/(x-1))+min((int)1,(val%(x-1))))

»
2 weeks ago, # |
Rev. 2   Vote: I like it -46 Vote: I do not like it

deleted

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

Just curious to know, How they have such a large collections of problems?

they are soon going to make century of educational rounds

  • »
    »
    2 weeks ago, # ^ |
      Vote: I like it -14 Vote: I do not like it

    $$$Events\,\, seemingly\,\, repeat \,\,themselves \,\,between \,\,the\,\, years\,\, of\,\, the \,\,time\,\, loop$$$ — Dark

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

    6344 problems as of now. And they are uploading for like 10 years not a single person's job.

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

before: educational so unbearable will again be one math

Now: wow they are doing really interesting rounds of course I will write it

»
2 weeks ago, # |
Rev. 2   Vote: I like it -9 Vote: I do not like it

Hope I will get some increase today...

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

»
2 weeks ago, # |
Rev. 2   Vote: I like it -85 Vote: I do not like it

A

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

    There has been bad incidents in the past( Long queues, round being unrated, pretests weak/wrong) whenever some author didn't thank Mike. So nobody wants to take the risk you see XD

    • »
      »
      »
      2 weeks ago, # ^ |
      Rev. 2   Vote: I like it -59 Vote: I do not like it

      A

    • »
      »
      »
      2 weeks ago, # ^ |
        Vote: I like it -62 Vote: I do not like it

      Maybe Mike was angry that they didn't thank him and cursed the round

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

      There has been bad incidents in the past( Long queues, round being unrated, pretests weak/wrong) whenever some author didn't thank Mike. So nobody wants to take the risk you see XD

      after thanking also, everything happened which you have stated(long queues didn't happened bcz everybody left after this much) lol.

    • »
      »
      »
      13 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Truth !

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

    Mike unlinke Mark doesn't sell your data, maintains ad free site, we get quality problems completely free of cost, and without watching any ads like SPOJ. People thank Mike out of gratitude for him.

»
2 weeks ago, # |
  Vote: I like it -11 Vote: I do not like it

Wish me luck, please!

»
2 weeks ago, # |
  Vote: I like it -22 Vote: I do not like it

Very excited :D

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

Just curious to know, we don't have any problem tester in educational rounds? Or is the same set of people involved in testing the problems?

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

    If only they were less greedy and given free contribution to testers, this round would have been rated

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

I hope it has strong pretest and interesting problems!

»
2 weeks ago, # |
  Vote: I like it -9 Vote: I do not like it

I would like to know which debuging tool are you using? Oh, I suddenly realized that we don't need in cf :D But I still want to hear suggestions

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

Purple Rain

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

Hey, this is my first time participating in the educational round and I have a simple question. I quite can't grasp the idea of the time penalty. (I searched up the rules but I still don't get it.)

To the best of my understandings, is it one of the followings? 1) the final score is directly related to time consumed 2) total time of 2 hrs gets shorter by 10 minutes for each wrong submission

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

    Let's say you submitted 2 source code.
    Submission 1: got the WA at 00:03
    Submission 2: got the AC. at 00:07

    Then you get just the same score who got the AC at 00:17.

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

All the best Guys, noob here hope i will make some score today..

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

    I think you are a famous noob as you are getting upvoted by people :)...otherwise lower rating participants always get downvoted here

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

This contest is a nightmare.

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

so sad that this round will be unrated after all the effort to solve the first few problems

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

Thank God! It got Unrated.
Problem A made me feel so worthless today.

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

Back to UnratedForces...

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

problem A was so irritating before:( now it is good:)

»
2 weeks ago, # |
  Vote: I like it -84 Vote: I do not like it

Please let this round rated back :((. Just a small issue from the problem A right ?

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

    Not a small issue for those whose schedule and timing of the contest is completely ruined.

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

It was obvious that round will be unrated when I saw those wandering trader deals.

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

Problem A strikes again.

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

It's unfortunate that the negativity started in the comment section, in particular this comment has eventually cursed the round and a good problemset. :'(

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

Out of curiosity how did whatever mistake happened slip through on A? It seems to have been a major error considering that all the samples itself were wrong.

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

    Anyone got it right when the data was not changed?

    I made the same mistake and passed all tests when the sample was not changed. Maybe the testers said "Hey, how could there be bugs in A?" and simply let it slip thru.

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

      I submitted within a minute of the change, there were 800 submissions by that point. There were 400-500ish before that.

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

    really wonder how this obvious error can be passed in Polygon...

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

      Yeah, I would expect that there should have been at least a "should TLE" brute force. Moreover how did it pass testing? Did all the testers make the same mistake? Frankly this makes me think that educational rounds don't actually have a testing phase.

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

        literally likely. A previous error make that Problem B can be accepted by almost any way, but nobody noticed that and as a result I got unrated.

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

          Wow, and it gets worse, B's checker today is also wrong.

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

I thought for a long time why the test case came out like this.

»
2 weeks ago, # |
  Vote: I like it -34 Vote: I do not like it

But i was doing so well :((( Screen-Shot-2020-09-14-at-6.05.09-PM.png

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

They should explain the sample test case of first question.

»
2 weeks ago, # |
  Vote: I like it -96 Vote: I do not like it

Damn these unrated rounds. Ruined my first contest.

  • »
    »
    13 days ago, # ^ |
      Vote: I like it -100 Vote: I do not like it

    Does this stepmother have cumshots on her boobs?

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

I feel really sorry for setters. They have make good problemset using a lot of efforts. Contest has been ruined only by A problem.

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

Unrated round because of a simple maths problem. Sad for setters and competitors, there should be a tester in edu rounds

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

This is pretty sad. Even if educational rounds don't have testers (which they should), can't you at least have more than 1 person write model/correct solutions? I know how polygon works and it's not very hard to simply ask someone else to upload another solution and find any mistakes, especially in problem A.

»
2 weeks ago, # |
  Vote: I like it -109 Vote: I do not like it

WHY UNRATED? IT WAS THE EDUCATIONAL ROUND IN WHICH I COULD HAVE IMPROVED MY RATINGS. WHY THIS ALWAYS HAPPENS WITH ME.GOD! AM I THAT BAD?

»
2 weeks ago, # |
Rev. 2   Vote: I like it -8 Vote: I do not like it

Does anyone check the correctness of the problem A??? Bad experience!

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

Im sad because problems B and C were cool, usually I dislike them, but in this contest they were pretty nice :(

»
2 weeks ago, # |
Rev. 3   Vote: I like it -10 Vote: I do not like it

Sorry, looks like its only my problem

DELETED

  • »
    »
    13 days ago, # ^ |
    Rev. 2   Vote: I like it -7 Vote: I do not like it

    this is the problem D screenshot from my screen, just notice to word "piles"

    also i asked some of my friends and they had same problem

    BTW, if you don't have this problem, sorry for unrelated comment

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

Leaving aside A, other problems are very interesting, do give it a try guys :D

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

    But it is no point for me to stay overnight now... I've refrained from staying up for three days in preparation of this contest

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

      wow, that sounds so inspiring, but don't worry your hard work will pay off in the next contest for sure :D

»
2 weeks ago, # |
  Vote: I like it -8 Vote: I do not like it

Damn that was the first time I've solved 2 problems in 20 minutes. But... it's unrated. So sad.

»
2 weeks ago, # |
  Vote: I like it -8 Vote: I do not like it

hello everybody. I'm curious to know how to become a tester of the round. if there is a link or description about becoming a tester of the round please leave it under this comment. thank you.

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

Please don't keep sample tests unexplained even if its problem A.

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

    I think the author could have realized his mistake had he written the explanation of the sample tests once.

»
2 weeks ago, # |
  Vote: I like it -24 Vote: I do not like it

Can we please have a div3 at least until saturday?

»
2 weeks ago, # |
  Vote: I like it -25 Vote: I do not like it

Bad round and not clear statements -_-

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

Can you please explain the test case 3 for problem A,

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

(44wfcm.png)

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

    Tbh, problem A is pretty easy just like normal A's a simple one line formula for AC, only difference is, they messed up the sample test cases which made it a lot confusing, adding on to that they didn't provide any explanations.

»
2 weeks ago, # |
  Vote: I like it -11 Vote: I do not like it

Every other educational round:
me: if I can't solve B I definitely can't solve C.
them: we shall make sure you don't solve B.
me: end up solving just A.
Today:
me: solves A & B in under 20 minutes.
them: unfortunately this round will be unrated.

P.S: I know the frustration is higher for the writers when a round becomes unrated, so feeling sorry for them too.

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

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

I wrote 2 codes for problem B they gives same output to sample but one of them passes the sample one of them don't but they gives same output for output but when i submit it says wrong on this sample input why?

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

Before the samples of problem A were fixed, there were already about 1K submissions. I wonder what solution they submitted?

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

    Can I tell it now? I made the same mistake.

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

    None of them did add the other operation and it was more likely that no one added.

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

    Maybe they did so without seeing the sample testcase and worked it on their own... I have seen many coders do that maybe out of competition or confidence

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

      If the jury's mistake was: the statement says you should count both type of operations or at least is ambiguous so it can be interpreted this way, but model solution counts only one of them, then IMO it's a little weird decision to change the tests rather than just make an announcement like: "you should count only operations of type 1, we have updated the statement to make it clear".

      • »
        »
        »
        »
        13 days ago, # ^ |
        Rev. 3   Vote: I like it +10 Vote: I do not like it

        It was worse than that as far as I understand

        The jury's solution also had a rounding error. So they couldn't just correct the statement the way you suggest

        This was the accepted solution at the time of the round

            need_sticks = (y + 1) * k
            cnt = (need_sticks - 1) // (x - 1)
            print(cnt)
        
  • »
    »
    13 days ago, # ^ |
    Rev. 3   Vote: I like it +22 Vote: I do not like it

    I adjusted my solution to the samples without much thinking when I saw that it does not match the result. Added incorrect rounding and omited the second operation.

    I thought "I don't have time to think about it, will figure out why it has to be this way after the contest"

    And then I had to return everything back...

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

Did a rejudge on B just happen? Some people's Bs got converted from pretests passed to WA on pretest 1.

»
2 weeks ago, # |
  Vote: I like it -10 Vote: I do not like it

I am just curious, How is it happen. Is both setter and tester got the same idea for the solution.

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

    Probably I actually got the wrong solution on my first try which matched their test case.

    • »
      »
      »
      13 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      That's crazy level of coincidence

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

        Well the mistake was not counting the 2nd kind of trades so basiclly we output ans-k instead of ans.

»
2 weeks ago, # |
  Vote: I like it -25 Vote: I do not like it

Problem A like a nightmare:(

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

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

this is what happens when you push code to production without writing unit tests

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

This contest is really cursed.

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

When I found the problems easy and solve them fast, the round became unrated. Bad luck for all :(

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

I accidently submit wrong answer according to the previous test case of A and my rank was under 150 and i am not able to believe that a newbie is under 150 rank initially ,i realised i have become pro for sometime :) :)

»
2 weeks ago, # |
  Vote: I like it -7 Vote: I do not like it

What a stupid contest !

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

there should have been testers for the round , as 2 problems had issues in them.

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

Didn't anyone test this pre-test?

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

is the round unrated?

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

The contest problems were good enough but only problem was with the checker.Enjoyed problem solving

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

Waiting for announcement regarding Problem C

»
2 weeks ago, # |
  Vote: I like it -14 Vote: I do not like it

now as the contest is unrated , will there be a hacking phase or we will go strait up to system testing?

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

Every time I perform little better the contest gets unrated. ;__;

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

BledDest for preparing A & B ? Still remember he writes his checker by casting INT to BOOL.

  • »
    »
    13 days ago, # ^ |
      Vote: I like it +31 Vote: I do not like it

    No, this time I prepared G

    • »
      »
      »
      13 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Great thanks to you for preparing EDU rounds and wish a better experience next time !

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

 ;(

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

I think there is a wrong output in Problem B 4th Case:

Your ouput: -4 0 1 6 3

p=[−4,−4,−3,3,6]

k=3 But i have better Solution:

1 0 -4 6 3

p= 1 1 -3 3 6

k=1.

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

    I think we just don't understand what the problem really want , I have the same case as you in my solution

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

    Let k be the maximum j (1≤j≤n).. k is not negative value count that is index.. but your solution is also correct max index is also 3 as in the test case !!

  • »
    »
    13 days ago, # ^ |
    Rev. 4   Vote: I like it 0 Vote: I do not like it

    You don't have better solution (just a solution) :P...Create prefix array for [1, 1, -3, 3, 6] and you'll get it. P( j ) < 0, j = 3

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

I didn't read comments . Now I got to know the round is unrated.. __

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

Couldn't even solve one complete question. Need a lot of practice for me. Any good resources and motivation to learn more about competitive coding.

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

    It is OK, go to the problem set sort the problems by difficulty and start practicing with the easier ones, you will be able to solve A problems in a short time

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

The contest seemed good enough. Easy A, B and C with correct difficulty gradient. However, D was not clear to me at all. What did it even want to say? What was the approach for it? In fact what did it want us too :|

»
13 days ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it

Problems were outstanding. But, A's sample test ruined it :(

  • »
    »
    13 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    not only the sample test , the whole tests.

»
13 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Very sad to know that the round is unrated after I tried so hard to solve D&E..

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

Rating is just a number. The problems were interesting and instructive. Thank you all problem setters!

Waiting for the editorial.

»
13 days ago, # |
  Vote: I like it +25 Vote: I do not like it

Thanks to GOD that the contest was unrated....... The problems are hard and hard to understand.......

»
13 days ago, # |
  Vote: I like it +320 Vote: I do not like it

I'm really sorry about the issue with the problem A. This was completely my fault. I re-checked the formula yesterday and discussed it with others and nobody found any mistakes.

1) I didn't round up the result of the division.

2) I forgot about $$$k$$$ trades you need to get coals.

So, my solution was completely incorrect. I will not blame anyone else because this was my problem and I failed its preparation. I didn't want this round to be unrated and this issue right at the start of the contest just completely ruined me. Sorry guys.

  • »
    »
    13 days ago, # ^ |
      Vote: I like it +38 Vote: I do not like it

    its ok, human are not perfect

  • »
    »
    13 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    you are talking about taking the ceil right?

  • »
    »
    13 days ago, # ^ |
      Vote: I like it +15 Vote: I do not like it

    aw man

  • »
    »
    13 days ago, # ^ |
      Vote: I like it +51 Vote: I do not like it

    Mistakes happen. You are a great problem setter. I've always liked your problems <3

  • »
    »
    13 days ago, # ^ |
      Vote: I like it +14 Vote: I do not like it

    It is OK man, it is kind of encouraging for us beginners to see that even strong coders sometimes make mistakes in problem A ;-)

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

    wouldn't it be nice idea to extend the time of round by 10 more minutes instead of making it as unrated, because the problems are extremely good , feeling sad for this round becoming unrated

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

      Sadly, if the first problem is wrong, it affects almost anyone. And also this was not the only issue because the checker of the problem B was incorrect. Cursed round. Really cursed.

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

    Well mistakes do happen, but the problem itself was good.Just curious how did it slip away from testers?

  • »
    »
    13 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    So,the outputs for the sample test cases are incorrect?

  • »
    »
    13 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    This is a pretty bad mistake, but you handled it pretty well during the competition and now by admitting to it. I'm surprised that nobody noticed the issue, did anyone actually solve the problem (in code) other than you?

    • »
      »
      »
      13 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      One person solved it before the contest. Sadly, he just tried to find the formula which passes the example. This is fun and sad at the same time.

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

        Well don't you think it's a good idea to have multiple testers on every problem regardless of its difficulty? If testing status were always like this, this situation were bound to happen.

        • »
          »
          »
          »
          »
          13 days ago, # ^ |
            Vote: I like it +1 Vote: I do not like it

          There are reasons Educational Rounds are pretty rarely tested and these reasons almost don't belong to me. Moreover, I'm pretty rare guest in Educational Rounds now because I'm mostly busy with Div.3.

          • »
            »
            »
            »
            »
            »
            13 days ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            That's kinda sad to hear. One might expect sponsored rounds to be more prepared than the regular ones but it sounds like it's not the case.

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

    But i am surprised to see about 700 people solve the problem before correction. Looking at this i thought i might got something wrong.

  • »
    »
    13 days ago, # ^ |
      Vote: I like it +69 Vote: I do not like it

    No rated contest should have problems that are not stress-tested with a naive slow solution.

    But yeah, shit happens.

  • »
    »
    13 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    did you give it to newbies to check?

»
13 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Problem D — For input [1,3], we move 1 to 2 and 3 to 2. This makes both of them together.

Kindly correct me, if I got it wrong !!

Can anyone explain the test case [1,2,4,8,9,100].

How are we moving the piles to make them together?

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

    for [1,3] you just keep each one in its place. The problem says to put all of them in at most 2 piles, not necessarily 1.

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

    For input [1,3] the answer is 0, you can leave them at their original positions because you need at most two piles

    For case [1,2,4,8,9,100], you move all the piles except the one at 100 to position 4, which takes 8 moves

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

It seems C was like 1400 and D 2000

Still, sad that it is unrated

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

    D was simple with set and multiset. It is O(q*log(n))

    • »
      »
      »
      13 days ago, # ^ |
      Rev. 2   Vote: I like it -8 Vote: I do not like it

      I wonder if my solution is overcomplicated or I just suck in c++. I couldn't come up with a solution with datastructures available in python and had to implement it in c++

    • »
      »
      »
      13 days ago, # ^ |
        Vote: I like it -24 Vote: I do not like it

      use

      Spoiler
    • »
      »
      »
      13 days ago, # ^ |
      Rev. 2   Vote: I like it +6 Vote: I do not like it

      In the end my estimate was nearly perfect and off by 100

      Though it maybe affected by the fact that the round ended up unrated

»
13 days ago, # |
  Vote: I like it +3 Vote: I do not like it

The problems were really interesting, so unfortunate it became unrated, just curious, how the problem A thing happen? all samples were wrong.

»
13 days ago, # |
  Vote: I like it -8 Vote: I do not like it

Will this round be unrated?

»
13 days ago, # |
  Vote: I like it +7 Vote: I do not like it

I admit it is fair to unrate the contest because of the issue of problem A but I still feel unhappy because I get a pretty good result.

Anyway, thanks to the problem setters. Bad things happen all the time. Do not worry about it too much.

»
13 days ago, # |
Rev. 3   Vote: I like it -23 Vote: I do not like it

Man, Can't catch a break.

cf.jpg

I do feel bad for Problem Setters though. The problems were definitely good.

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

    Your Graph does not justify this, but Ya, lol

  • »
    »
    13 days ago, # ^ |
      Vote: I like it +19 Vote: I do not like it

    I bet 10 bucks and say if the contest was rated and had no problems, this 46 would be more than 4600.

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

      I'm not denying this. Not at all. Just wanted to post this. It is not meant to be taken seriously.

»
13 days ago, # |
  Vote: I like it +1 Vote: I do not like it

pikmike I know this doesn't come under rules but is it possible for you guys to discard the hacking phase as the round is unrated it won't affect much and we don't have to wait for the editorials.

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

    They could post the editorials if they want to, it does not depend on the hacking phase.

»
13 days ago, # |
  Vote: I like it -57 Vote: I do not like it

Honestly, did not liked the problems much. A, B, C where long and fairly unclear statements. D was long, too, but at least clear.

E, F, G might be to hard, I assume less than 20 rated participants would have solved any of them.

  • »
    »
    13 days ago, # ^ |
      Vote: I like it -25 Vote: I do not like it

    Just noticed that I missunderstood D, it is not that we can move at all positions x, we can move all objects at one position x. So this is is shitty misunderstandable statement, too.

»
13 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Did D have some elegant implementation? There was too much case work in my solution.

»
13 days ago, # |
  Vote: I like it 0 Vote: I do not like it

where did we receive notification regarding making round non rated?

»
13 days ago, # |
  Vote: I like it +5 Vote: I do not like it

Can anyone explain how to solve G because the question was pretty straightforward ??

»
13 days ago, # |
  Vote: I like it +8 Vote: I do not like it

How to solve F and G?

  • »
    »
    13 days ago, # ^ |
    Rev. 5   Vote: I like it +29 Vote: I do not like it

    F: Fix $$$d = gcd(x_1, x_2)$$$ where $$$x_2$$$ is yet to be determined, also the condition $$$l \le x_1y_1 \le r$$$ gives some bounds $$$L \le y_1 \le R$$$.

    If $$$x_1 = dk$$$, $$$x_2 = ds$$$ then we need $$$s \mid y_1$$$ and $$$k < s \le \frac{n}{d}$$$. We have two cases:

    1. If $$$x_1 \le \frac{n}{2}$$$, then consider $$$x_2 = 2x_1$$$. If $$$y_1$$$ has at least two possible values then at least one is even and we win. (Choose $$$x_1, y, 2x_1, y/2$$$). Otherwise, there's only one possible $$$y_1$$$, and it's easy to check if it works.

    2. If $$$x_1 > \frac{n}{2}$$$, then $$$R \le 2m$$$. Keep a BIT over $$$a[i] = \text{ number of multiples of } i \text{ in } [L, R]$$$, you can keep this updated by doing a total of $$$O(m \log m)$$$ updates, and you can find possible choices for $$$s$$$ by querying the interval $$$[k + 1, n / d]$$$. There's a total of $$$O(n \log n)$$$ choices for $$$d$$$ (counting over all possible values of $$$x_1$$$), so there's also this many queries. This gives a $$$\log^2$$$ solution.

  • »
    »
    13 days ago, # ^ |
    Rev. 9   Vote: I like it +36 Vote: I do not like it

    My solution to problem G, AC after 8 minutes of the contest :(

    Let's iterate over all R from left to right, and count how many L such that the subarray [L..R] is good for each fixed R.

    When we are now on a fixed R, we need to know for each number X, what is the range of valid Ls such that the frequency of X in range [L .. R] is 3.

    We can easily do that by storing the indices of number X in a vector V, let's say that the vector size is K, so the valid range of Ls for this X is [V[K-4]+1, v[k-3]], we will use a lazy segment tree to increase / decrease this range each time we see X.

    Let's form an array called can[i], can[i] equals how many distinct numbers in range [i .. R] having frequency equals 3.

    Now our task becomes, for each R, count how many Ls, such that can[L] equals to the number of distinct integers in range [L .. R]. Let's say that distinct[i] = number of distinct integers in range [i..R]. We can easily update distinct[i] while we are iterating over R, when we find a number X we just need to increase distinct[j] by one, such that lastPostition[X] + 1 <= j <= i. We can do that using the same lazy segment tree.

    So we need to count how many (can[i] — distinct[i] == 0). Since (can[i] <= distinct[i]), then (can[i] — distinct[i] <= 0), so we just need to know what is the max number in the lazy segment tree, and if it was 0, we will add the frequency of the max to the answer. So we just need to support querying the max number and its frequency in the segment tree.

    My code: 92841078

»
13 days ago, # |
  Vote: I like it 0 Vote: I do not like it

It does not matter if its unrated but the problems were awesome

  • »
    »
    13 days ago, # ^ |
      Vote: I like it -8 Vote: I do not like it

    Would like to give me some instruction to solve the problem?

»
13 days ago, # |
  Vote: I like it 0 Vote: I do not like it

**After seeing the pretest 1 answer 9 for problem A , i was like time to say goodbye to this round XD. **

»
13 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Can anyone explain the solution of C?

  • »
    »
    13 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    There is two cases.

    1) The first character is 1, then friend have to use the skip(obviously).

    2) There is substring "111". For any other case we can avoid using the skip

  • »
    »
    13 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I used a dp.

    dp[i][pl][isSecond] is min number of skip points to kill ith boss by player pl with isSecondsth move.

    92828592

  • »
    »
    13 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    problem C was basic Dp for every i store the minimum skip point his friend would use from 1 to i in array. and finally print min(dp[n],dp[n-1],dp[n-2]).

    minimum skip points for every i can be stored as follows. dp[i]=min(dp[i-1],dp[i-2],dp[i-3]). because maximum kill that can be done by anyone is 2 and for n<=3 just print a[0].

    • »
      »
      »
      13 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Thanks dude. I had used the same approach but fucked up with the case of n < 4

  • »
    »
    13 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I used greedy: For every turn, if its the friend's turn, kill the current boss and see if the next boss is easy, then kill it as well. If its your turn, then kill the current boss and see if the next boss is difficult, then kill it as well.

    My solution

    • »
      »
      »
      13 days ago, # ^ |
      Rev. 2   Vote: I like it +1 Vote: I do not like it

      sh_maestro I did the same but got WA on test 2.

      my code
      • »
        »
        »
        »
        13 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        funny, same error as mine ;)

        "wrong answer 55th numbers differ — expected: '0', found: '1'"

        • »
          »
          »
          »
          »
          13 days ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          If you figure out that test case , please tell . I am also getting wrong on same test case.

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

            Most probably 55th Test of 2nd test case is-

            5

            0 0 0 1 1

            • »
              »
              »
              »
              »
              »
              »
              13 days ago, # ^ |
                Vote: I like it +1 Vote: I do not like it

              Thanks!

            • »
              »
              »
              »
              »
              »
              »
              13 days ago, # ^ |
                Vote: I like it 0 Vote: I do not like it

              How did you find the testcase?? Amazing!

            • »
              »
              »
              »
              »
              »
              »
              13 days ago, # ^ |
                Vote: I like it 0 Vote: I do not like it

              hey, I also found a similar test case during contest when my similar greedy solution failed on tc-2, but I want to ask that how can we prove the greedy solution wrong by using some mathematical argument or Is finding a counter-example is the only way? as sometime it may be hard to find a counter-example and also takes a lot of time.

        • »
          »
          »
          »
          »
          13 days ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          In the code by sh_maestro, he is skipping the case when it is your turn and a[i]==0 then he is skipping the boss.

                  if(turn) 
                  {
          	    if(a[i]) 
                      {
          	      ret++;
          	    }
          	    i++;
          	    if(i>=n) break;
          	    if(!a[i])
          	    i++;
                  }
          	else {
          	     if(a[i])    //Why adding this line makes this code AC?
          	     i++;
          	     if(i<n && a[i])
          	     i++;
          	}
          	turn = !turn;
          

          I don't understand why does it lead to correct answer?

      • »
        »
        »
        »
        13 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I guess the only difference is that I don't kill a boss every turn (I leave the easy bosses for the friend) — since either of us has to kill 1 or 2 bosses every turn. But if there's a hard boss, I always kill him (and the subsequent one — should that be a hard boss as well).

    • »
      »
      »
      13 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I tried to implement exactly that, but got WA. Can you see where I did wrong? 92817183 thanks

      • »
        »
        »
        »
        13 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        u can look at my submission 92849330

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

        The problem statement is a bit vague and there is room for error — after reading your solution, I re-read it and can see why someone would go with that approach.

        The key difference is that it is not essential for both you and your friend to kill a boss in your turns. So my solution was something like this:

        • The friend starts. He kills the first boss (regardless of hard/easy). Then if the next one is easy, he kills that as well.
        • It's my turn now. If it's a hard boss, I kill it. If there is another one and it's a hard boss, I kill that as well. However, if I had an easy boss, I would just skip my turn, so my friend could kill it in his turn.
        • »
          »
          »
          »
          »
          13 days ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          Sorry, I still do not see the difference.

          The friend uses his second hit if current boss is 0, I use my second hit if the current boss is 1. Where differs your solution from this?

          I did understand that this logic fails for 0 0 0 1 1

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

            "During one session, either you or your friend can kill one or two bosses" — sounds like either my friend or I (or both) have to kill 1 or 2 bosses each round. Though the lines that follow imply that both of us have to alternate and have to kill 1 or 2 bosses in our turn.

            If the statement implies that its mandatory to kill a boss in each turn (as opposed to kill 1-2 bosses in either my friend or my turn), then my solution is wrong (and yours and the other solutions shared here who got WA are correct). The problem writer would need to clarify what the intent was.

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

              I think I just got why your solution works.

              The key realization is when you are skipping, you can actually imagine that as transferring the previous job to me(basically take it away from friend). Then it, doesn't matter whether it was a 1 or 0. It will not affect the answer. The special case is when there is a 0 at the second position. This time you cannot take the previous job, so we imagine that our friend finished the first two bosses. If in the third position, we have a one, "I" will take care and if it is a zero, then we again imagine a redistribution of work in which first job was done by our friend, second one by me and third one by friend again. This way, the solution always yield the optimal answer.

              • »
                »
                »
                »
                »
                »
                »
                »
                13 days ago, # ^ |
                  Vote: I like it 0 Vote: I do not like it

                That's an interesting insight! One thing to think about is what happens when this renegotiation ripples to the beginning (i.e. after the negotiation, the first boss needs to be killed by me, however the solution requires the first boss to be always killed by the friend).

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  13 days ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  We will not have the ripple back effect because we are always alternating turns and each player can at max handle 2 jobs. When you get a 0 in second place, the friend will take care of it, if we get one more 0, we redistribute as follows:-

                  First(it may be 0 or 1) one is done by friend, second by me and third one by friend again.

                  If you have any counterexamples in mind, please share them?

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

                  Not a counterexample, but how would we explain this for 1 0 0 1 1? I.e. what does the friend take first, then us, etc.

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  12 days ago, # ^ |
                  Rev. 3   Vote: I like it +8 Vote: I do not like it

                  Okay, so the working will be as follows:-

                  1. First our friend finishes the first two bosses "1 0".

                  2. When we see a "0", we exchange the last boss finished, i.e. "1" one done by friend, the next "0" is done by me and the third "0" is done by friend.

                  3. This way, in the next turn we get to finish the next two hard bosses "1 1" and we are done.

                  I wrote a code for this idea with comments:-link to submission.

                  Did I explain your question?

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

                Amazing realization, thank you for that, it really did help understand the greedy approach:)

            • »
              »
              »
              »
              »
              »
              »
              13 days ago, # ^ |
              Rev. 4   Vote: I like it 0 Vote: I do not like it

              no comment

        • »
          »
          »
          »
          »
          13 days ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          As far as I understood the problem, it's mandatory to kill at least one boss in any session (friend's turn or my turn). How can you skip "my" turn?

    • »
      »
      »
      13 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      In the code you have provided in the link, if its my turn and the a[i]==0 then, you have skipped the testcase. I can't understand that part.

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

        I think that's because you would like to (greedily) give the 0 values to your friend , to reduce the count. If you yourself use that value 0 ,then next values may be like 1,1 and friend will need 1 more skip in that case.

        • »
          »
          »
          »
          »
          13 days ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          What about this line: During one session, either you or your friend can kill one or two bosses (neither you nor your friend can skip the session, so the minimum number of bosses killed during one session is at least one). After your friend session, your session begins....?

          • »
            »
            »
            »
            »
            »
            13 days ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            I am not sure about his code , but i surely didn't skip anyone's chance. my submission

            • »
              »
              »
              »
              »
              »
              »
              13 days ago, # ^ |
                Vote: I like it 0 Vote: I do not like it

              Exactly! When we don't skip it shows WA at Testcase 55.

    • »
      »
      »
      13 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I think your solution is correct but explanation is slightly wrong bro, Consider the given case : 1 0 0 1 1

      optimal moves -> Friend, Me, Friend, Me, Me

      but according to your explanation your friend will see that second boss is easy and therefore he will kill it and that will result in not being an optimal choice, isn't it?

      • »
        »
        »
        »
        13 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        The way it works right now would be something like ("F" = Friend, "M" = Me) :

        1 0 0 1 1
        F F F M M
        

        In the above example, on the third boss, I see an easy boss and would skip it (so the friend can kill it)

        Some more examples:

        0 0 0 1 1
        F F F M M
        
        0 0 0 1 1 1 0 1 0
        F F F M M F F M F
        

        In the last example, I can only kill 2 bosses at most, so my friend is forced to use a skip point at boss number 6.

  • »
    »
    13 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You have to find islands of 1 starting from index 1 and 2 ,then divide it by 3 my soln

»
13 days ago, # |
  Vote: I like it +8 Vote: I do not like it

I couldn't solve a single problem. I hope editorial will help me.

»
13 days ago, # |
  Vote: I like it 0 Vote: I do not like it

For problem A,I got the first 3 sample test cases right,but got the last two wrong,Can anyone tell me why?

  • »
    »
    13 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Did you use long long int? int might overflow.

    • »
      »
      »
      13 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I used python

      • »
        »
        »
        »
        13 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Ohhh Sorry, I don't use python, maybe someone with python can help :)

    • »
      »
      »
      13 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Also,is my logic correct?I first calculated the required number of sticks,then calculated the number of trades required to get to the number of sticks. Finally I added the number of trades with k.

  • »
    »
    13 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    it's probably because of floating point see that 92843760

    • »
      »
      »
      13 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Aww man. I should have checked it.Thank you.

»
13 days ago, # |
  Vote: I like it +20 Vote: I do not like it

»
13 days ago, # |
  Vote: I like it -26 Vote: I do not like it

ok, what I've found out from the round.

  1. I should not have divided doubles

  2. I should have read the tasks very carefully (super carefully, extremely carefully).

»
13 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Looks like there were no testers for this round.

»
13 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Oh my god, 2 questions with minecraft references, who made those questions dude???

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

Can someone please help me out to find flaw in my logic for question D?

-> At the end for each query we are just interested in dividing the array(sorted array) into two subarrays.

-> Answer would be diff (max element and min element of first subarray) + diff(max element and min element of second subarray).

-> Also dividing subarray would be optimal when we divide around mid value(max element + mid element)/2

Attached my solution(not sure why its failing on test case 3)92839897

It would be great if someone can please provide a counter example so that I can figure out why my algo is incorrect.

Thanks In Advance.

  • »
    »
    13 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    1
    4
    1 1 100 1000000

    • »
      »
      »
      13 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Sorry man, I am not able to understand your test case. What I understood from question, all the pi will be different and in above test case there are two ones.

  • »
    »
    13 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Also dividing subarray would be optimal when we divide around mid value(max element + mid element)/2

    Try 1,3,4,5,6; optimal division point is at 2

    • »
      »
      »
      13 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      What is the expected correct answer? I can see my solution gives answer as 3. Is that incorrect?

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

        The answer is end value — starting value — (maximum distance between any two consecutive elements after sorting ofcourse)

        • »
          »
          »
          »
          »
          13 days ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          I see, thanks.

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

            I made the same mistake :) That is optimal for the 2 sides separately but not combined. Eg: 1, 20, 40, 60, 100. Optimal for 60 to go left.

            • »
              »
              »
              »
              »
              »
              »
              13 days ago, # ^ |
                Vote: I like it 0 Vote: I do not like it

              It was kind of easy to think, but my bad I was just trying to correct my above solution by thinking counter example. I would have thought for a different approach.

»
13 days ago, # |
  Vote: I like it +5 Vote: I do not like it

Can anyone hint me on E?

  • »
    »
    13 days ago, # ^ |
    Rev. 2   Vote: I like it -7 Vote: I do not like it

    $$$O(n*m)$$$ is trivial if you know about linearity of expectation. To optimize it observe that for a fixed shield all $$$d_i$$$ smaller than $$$b_j$$$ have same contribution(number of ways such that we can $$$d_i$$$ damage to $$$j'th$$$ shield) and all $$$d_i$$$ greater than or equal to $$$b_j$$$ have same contribution. Do some counting and prefix sum and binary search and that's it.

    • »
      »
      »
      13 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I can form the expression. Evaluating it takes O(n) for each sample can't see of a way to optimise it further. Would be great if you could check this out —

      If (count of no of d(j) >= b(i)) <= a[i](Let this be a for the moment) then the answer is zero. Else from linearity of expectation the total damage can be expressed as D = D[1] + D[2].... + D[n]. Clearly E[D[k]] = 0 for k <= a. For any other k > a it remains to evaluate E[D[k]], which can be obtained by using the definition of Expectation and the associated probabilities can be