Vovuh's blog

By Vovuh, history, 4 months ago, In English,

<almost-copy-pasted-part>

Hello! Codeforces Round #570 (Div. 3) will start at Jun/26/2019 17:35 (Moscow time). You will be offered 6 or 7 problems (or 8) with expected difficulties to compose an interesting competition for participants with ratings up to 1600. However, all of you who wish to take part and have rating 1600 or higher, can register for the round unofficially.

The round will be hosted by rules of educational rounds (extended ACM-ICPC). Thus, during the round, solutions will be judged on preliminary tests, and after the round it will be a 12-hour phase of open hacks. I tried to make strong tests — just like you will be upset if many solutions fail after the contest is over.

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

Note that the penalty for the wrong submission in this round (and the following Div. 3 rounds) is 10 minutes.

Remember that only the trusted participants of the third division will be included in the official standings table. As it is written by link, this is a compulsory measure for combating unsporting behavior. To qualify as a trusted participants of the third division, you must:

  • take part in at least two rated rounds (and solve at least one problem in each of them),
  • do not have a point of 1900 or higher in the rating.

Regardless of whether you are a trusted participant of the third division or not, if your rating is less than 1600, then the round will be rated for you.

Thanks to MikeMirzayanov for the platform, help with ideas for problems and for coordination of my work. Thanks to my good friends Mikhail PikMike Piklyaev, Maksim Ne0n25 Mescheryakov and Ivan BledDest Androsov for help in round preparation and testing the round.

Good luck!

I also would like to say that participants who will submit wrong solutions on purpose and hack them afterwards (example) will not be shown in the hacking leaders table.

</almost-copy-pasted-part>

UPD: I also would like to thank Ashishgup and kocko for help with round preparation and testing!

UPD2: The contest will be extended for 15 minutes because the problems are more interesting than we thought. We also advise to read all the problems because some of them may have the same difficulty and we cannot know which one will be easier for you than the other.

UPD3: Editorial is published!

UPD4:

Congratulations to the winners:

Rank Competitor Problems Solved Penalty
1 MbahFaishol1937 8 248
2 bertmin 8 450
3 BaiBatyr 8 455
4 LJF007 7 305
5 proizvedenie 7 322

Congratulations to the best hackers:

Rank Competitor Hack Count
1 Nazarbek_Baltabaev 120:-90
2 Radewoosh 75:-21
3 yzm10 36:-2
4 csegura 31
5 shaker007 30:-11
798 successful hacks and 492 unsuccessful hacks were made in total!

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

Problem Competitor Penalty
A blast 0:01
B Kirill_Kudr22 0:04
C I_love_HellHoleStudios 0:04
D divya_rawat 0:10
E llbra9z 0:13
F FlyInTheSky 0:42
G MbahFaishol1937 0:27
H UMP45 0:25

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

»
4 months ago, # |
  Vote: I like it -8 Vote: I do not like it

why I m struggling in Div.3 ? how can I improve my DP & graph solving ability?

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

Hoping for a good contest!! Was awaiting Div3 eagerly.

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

"You will be given 6 or 7 (or 8) problems and 2 hours to solve them." It is so vague. Though It'll be decided later.

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

Div.Vovuh xD

»
4 months ago, # |
  Vote: I like it -36 Vote: I do not like it

I hope to become purple after this round!

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

    If you solve all problems and take first place, that might be possible

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

    I hope to become red after this round!

»
4 months ago, # |
  Vote: I like it -18 Vote: I do not like it

you can safely stop doing these, they are useless. stop spamming the website

»
4 months ago, # |
  Vote: I like it -22 Vote: I do not like it

I find difficulties of problems from Div 3 are as same as Div 2!

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

    Why do u think so?

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

      It's from my experience from Div 2 and Div 3 contests I've participated.

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

        I dont think so. Probably, u cant solve 3 problems sometimes even when u`re blue, but in div3 u can

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

        I used to think the same when I was around your rating, but once you reach somewhere around 1500, you will notice you are able to solve 4 or more problems in Div 3.

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

        experience ?!!!! you mean solving at most 1 problem in more than 15 minutes in less than 10 contests ? are you sure you know what the meaning of experience is ?

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

        maybe it's right when you solve only 1 problem. My experience: 3 div.2 / 4 div.3 (year ago) 4-5 div.2 / 6-7 div.3 (now)

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

          OK, I got it. If I go to advance level I will get the difference. Thank you guys

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

    because you're so bad at coding. if you aren't advancing, why do you keep trying and wasting your time with this cp bullcrap? move on kid....

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

      I know what I'm doing. Didn't ask for your advice. Piece of shits everywhere

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

    The creators of the contests have sufficient intelligence to differentiate problems of Div 2 from Div 3. Trust them.

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

    That's because you solve only one problem during the contest regardless of whether it is Div2 or Div3. So you find both of them same.

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

Vovuh can stay on top of the contributors table just by organizing 1/2 Div. 3 rounds per month xD

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

Hope I will turn pupil after the round :)

»
4 months ago, # |
  Vote: I like it -13 Vote: I do not like it

Good luck everyone, i hope for a good contest for all of us.

»
4 months ago, # |
Rev. 2   Vote: I like it -11 Vote: I do not like it

Div 3 after long time.

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

Tired of helping Vasya and Petya !

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

when these persons are testing the round , the chance of hack comes down a lot !

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

    It becomes zero in some questions(B) as they have to remove then xd

»
4 months ago, # |
  Vote: I like it -13 Vote: I do not like it

The winner of this contest name will start with 'g'.

MyPrediction

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

DIV-3 contest is always missed by Vovuh. :D :D :D

»
4 months ago, # |
  Vote: I like it -11 Vote: I do not like it

Does the countdown work correctly? It says 7:05 before start!

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

wow new contest from vovuh

i love you man

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

The temperature is higher than my meme contribution

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

good luck everyone,hope your rating will increase

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

where are the problems

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

Unable to see the problems.

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

Not able to see problems. Is it only me ?

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

question is not opening

»
4 months ago, # |
  Vote: I like it -6 Vote: I do not like it

what is going on with interface?

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

why i can't ask an question????????????

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

Anyone else not seeing problem statements??

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

WTF

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

But where are the problems. Contest is running without any problem set

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

Oh time is running although there aren't any questions!

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

    seems like, it's gonna be an unrated contest

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

      no way ...no one has seen the problems ..they will extend the contest

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

what's happening codeforces..

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

i can't see any problem

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

I cannot see the problems.

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

no questions?

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

Problems??

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

problems aren't visible.. lol

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

Where are all problems? Are we a joke to you?

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

Hello, there is some issue. The problem set is not loading.

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

Why everyone is writing same comment of not able to see the problems ?

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

are there any hidden questions :(

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

I can't see any problems in contest main page.

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

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

can't view any problems??

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

Where are the problems, I can not see them

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

I cant enter in this round.Help plz

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

Why problemset is invisible?

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

Problems?!!!

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

So many submissions already and i am just receiving the problems... Will it be rated?

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

The problems were not visible and suddenly I saw 3000 people have already solved the first question

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

will there be extra time for the delay?

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

unexpectedly ez round...wish u guys good luck.

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

Yet another internet speed round XD

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

Queryforces

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

problem C is easy but hard to implement...

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

    < 10 lines in python for me

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

      Could you please explain the solution. I mean pseudo code

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

        You can consider the formula for how much additional charge you will need, where "out" is the number of days you don't charge: neededCharge = (out*a) + ((n — out)*b) — k + 1 Specifically, we need neededCharge to be less than or equal to 0, so we can set out based on that. Simplify to get out <= (k-n*b-1)/(a-b). So, set out = floor((k-n*b-1)/(a-b)) Then, if out is less than 0, your answer is -1. Otherwise, your answer is min(n, out).

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

    I am having understanding the problem, could you please explain the problem. I will really appreciate it. Thanks.

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

can any one explain problem D ?

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

    store array containing frequency of i in arr[i]. sort all values in reverse order, now for all elements after 1st element in array, its value is min(arr[i],arr[i-1]-1). Answer is sum of positive values in array.

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

Problem E is more easy for Java people

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

Thanks for the contest!

For anyone who had a hard time with any of the problems, I wrote up descriptions of my solutions, which you can find at this link. If you have any questions, feel free to post below.

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

    Thanks, I think it'd be a bit easier to read if you posted this as a blog and if you have the implemented code, to share it.

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

      Good idea—I’ll post this soon. Thanks!

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

        Geothermal {May be I am wrong}...

        I tried D using max-heap but at the 19th case the response was TLE .. but as you guys have used sort() method [complexity will be nlogn]. So, as Mine...

        https://codeforces.com/contest/1183/submission/56128383

        any suggestion where am I wrong???

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

          I'm not sufficiently familiar with Python to debug it effectively, sorry.

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

            Geothermal thanks for the response ...sorry, I don't want you to debug my code ... I am just asking whether max heap is a good way to solve it ..

            pseudocode:


            heap=maxheap(contains the frequency of distinct nos) start=maxheap[0] //max value while(heap not empty): val=heap(remove max value from heap) if((val-start)>=0): if(start>=0): count=count+start start=start-1 else: break else: if(start>=0): start=min(val,start) count=count+start start=start-1 else: break

            So, for me its O(nlogn) ... n for removing the elements and log(n) for maintaining the heap...??? am I correct?? ...

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

    Thanks for your effort. I looked into it. I found that explanation of Q.F was difficult for me to understand ( or maybe because i have used another method .) Can you tell me in short what you did ?

    My method : I found out during the contest that if there is a solution which doesn't have max element (let's say m) . Then the only better option can be m/2 + m/3 + m/5.

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

      Yes, I think we used different methods (although I know other people who used your approach too). That's a clever solution--my method was essentially a pruned complete search. I noticed that any number under 200,000 can't have too many factors (more precisely, they have at most 160 factors). This lets us considerably reduce the number of possibilities we have to search through, and from there the rest is essentially a bash.

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

        If I'm not wrong, you take 340 problems as a candidate for first problem , and for each of them you take next 170 as second and 340 as third candidate ?

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

          I took 340 problems as candidates for the first problem, then for each potential first problem, I chose 170 candidates for the remaining two problems. I then did some optimization so that I could pick the best pair of problems in ~170 operations rather than by considering all possible pairs of candidates.

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

    getting tle in test case 6 problem g https://codeforces.com/contest/1183/submission/56137010

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

How to solve G?

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

    Edit : This is for Problem H.

    Consider dp[i][j] -> number of distinct subsequences ending at i, of length j. Then,

    $$$dp[i][j] = \sum_{c = a}^{c = z} dp[prev[i][c]][j - 1] $$$

    Where prev[i][c] is the maximal index before i, that has value c.

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

      Is there only dp solution? I've tried whole round to think greedy one

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

        i'd say, that this is Dp + greedy

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

      How does it make sure that only unique subsequences are counted

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

      How can we take care of Overflow??

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

Totally, I could not understand the problem C :(

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

    it takes me more than 40 min to understand :(

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

    You can consider the formula for how much additional charge you will need, where "out" is the number of days you don't charge: neededCharge = (out*a) + ((n — out)*b) — k + 1 Specifically, we need neededCharge to be less than or equal to 0, so we can set out based on that. Simplify to get out <= (k-n*b-1)/(a-b). So, set out = floor((k-n*b-1)/(a-b)) Then, if out is less than 0, your answer is -1. Otherwise, your answer is min(n, out).

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

    "For each query print one integer: -1 if Vova cannot complete the game or the maximum number of turns Vova CAN JUST PLAY otherwise"

    The maximum number of turns Vova can just play that is without charge and play.

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

How to solve E?

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

    dynamic programming dp [i] [j], the number of different strings of length i ending in j letter

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

      Could you explain how do you ensure that we don't count the same string twice while building the dp. Thanks in advance.

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

        Try to understand it yourself. Let's get another matrix used [i] [j], indicating whether there was such a state before. If it was, we simply reset dp [i] [j] and recalculate the answer for it since this time we will have more different lines of length i ending in j.

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

          Thanks for making me figure it out myself..

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

      Actually BFS is ok...

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

In test case 4 of E why cost int not 232 — 1*0 + 10*(10-9) + (C(10,2) = 45)*(10-8) + 44*(10-7).

UPD : Got it. I made a mistake.

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

why there was no hacking ? and when the ratings will come up ?

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

    Read the Announcement of the round

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

    In Division 3 rounds, hacking occurs for twelve hours after the contest. Ratings will update after the hacking phase and system tests finish.

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

      Thank you for your explanation would you tell me how to hack somebody now ?

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

    The Hacking phase in Div.3 comes after the contest like educational round

    The rating will come up after finish the Hacking phase

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

great round I would say but the complexity of the tasks > D is quite high for a Div. 3 contestants

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

Damn I could solve E I think.. isn't it trying all the possibilities and if it took too long we would output -1

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

    No its not you wold definitely get TLE or WA for that the solution . just consider a 100 letter string with same characters and k=99. you can use dynamic programming to solve it.

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

      Yup it's no good to solve it like that I will try it later

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

      Why DP. I thought it is a implementation type problem. I got pretest passed without DP.

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

        Yes I thought of an implementation solution like yours but unfortunately I wasn't able to solve the hard version with it so I used DP to solve both of them.

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

      It is possible. My (updated after contest) solution: http://codeforces.com/contest/1183/submission/56154439

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

        what do you mean by possible . I'm sure you didn't simply tried all the possibilities inefficiently.

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

          I tried all, but stop when I achieve k number of possibilities. Sure, it's not fair "all". But it's kind of brute force.

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

    Hahaha, trying all possibilities? Did you read "substring" instead of "subsequence"?

    Just as a side note, total possible ( without removing repetitions ) number of subsequences is $$$2^N$$$ where $$$N$$$ is the length of the given string.

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

      Did you read reza comment .. yeah I get it and I know the possibilties could be large but I thought if we didn't find 100 substring after 1e8 possibility then there's no answer but as reza said 100 same letter wouldnt work with this way

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

        Oh my bad then. But you didn't clearly mention what you were going to do? I accept I misunderstood here, but you should have said something like "Since $$$K$$$ is small, we can just find those many subsequences and then stop". This gives better idea of what you were trying to convey.

        Anyhow, I must apologize for my misunderstanding. Sorry for that! I shall read more carefully from now on.

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

can I hack my own solution???????

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

Thanks for the contest!

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

Why am I not a trusted participant since I have participated in more than two rated rounds and never had +1900 rating?

»
4 months ago, # |
  Vote: I like it -7 Vote: I do not like it

The user CaNDidaTE_FaSTer cheated again.

He somehow find the solution of problem H of sraman915

Submission by sraman915: 56104958
Submission by CaNDidaTE_FaSTer: 56124086

I think he should be banned from Codeforces as he did cheating multiple time. The another cheating caught by me is here

I am drawing attention of MikeMirzayanov

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

    Who are you LE_ROI? :D :D :D If you can prove this I will give you everything in this world. Please don't wast your time to see other code. Nijher chorkai tel dao. Copy past codeforce onek valo dhorte pare. I don't know who is sraman915. Hey Sraman are you know me? LE_ROI are you man or woman? :D :D :D

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

    The question is all about finding the distinct subsequences of length K. after that one can easily figure out the solution. I googled it and found something relevant which I have also mentioned in my code.

    I don't know CaNDidaTE_FaSTer but after seeing his solution I think he has also used the same thing but he forgets to mention in his code.

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

      Yes, you are correct. But I don't copy and past. I just use google to find out finding the distinct subsequences of length K . Thanks you sraman915.

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

      Hey. I have also taken code from that site, although I was not sure whether I should use that code. Are we allowed to take code from other sites during contests?

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

        Yes, googling is a must skill. It does not violate any rule of CF.

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

        You can take any code that is not copyrighted except the code from current participants of the contest.

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

          Okay. Thanks for clarification.

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

    It seems he has copy and paste code from Internet source. It is clear from inconsistent indenting. Many people have done this. I don't believe he has cheated.

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

TIL that declaring a massive vector makes a big difference in time complexity. (vector (MAX)) https://codeforces.com/contest/1183/submission/56113733

https://codeforces.com/contest/1183/submission/56126400

https://codeforces.com/contest/1183/submission/56126075

https://codeforces.com/contest/1183/submission/56126321

I thought that declaring a vector only takes up space and not time.

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

TLE https://codeforces.com/contest/1183/submission/56117801 AC https://codeforces.com/contest/1183/submission/56126830 The only difference between 2 submissions is I declare the array inside main

Why I got TLE ?

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

    Have a look at my submissions I got plenty of TLE's for the same reason on D. When you declare your array globally of size 2e5 and when there are 2e5 queries it will become O(10^10) because you are initially array of size 2e5 everytime. That's why array should be dynamic to take advantage of the fact that the sum of n over all queries is <2e5.

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

How to solve G?

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

When I tried to hack others solution with my testcase.I am getting generator crash error Since it is valid. My test case is : : test case

(for Problem D )

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

    It is because you are generating a testcase with 200000 queries where n=200000. However, in the problem statement, it is mentioned that "It is guaranteed that the sum of n over all queries does not exceed 2*10^5 ".

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

Hello i am very new to codeforces will anyone tell me that after participating in div 3 and solving 2 questions why there is no effect on my rating??please tell me Thanks :)

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

    Right now, hacking phase is going on which will continue for 12 hours. So, ratings will be changed later after the hacking phase ends.

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

    the rating changes will ocurr after finish hacking phase in 12 hours

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

can anyone explain..how to use DP in problem E?

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

    Sure. Sub-problem : Count number of distinct subsequence in a string ? Sol — I'll use 1 based indexing. Let DP[i] be the number of distinct subsequnces ending with character s[i]. Then if character s[i] did not occured before then we can chain it to all distinct subsequence occured before this position i.e. we can freely choose second last position in our subsequence DP[i] = sum of all DP[j] for j < i. If s[i] occured before then we don't need to count second last position before last occurence of s[i] because they are already calculated DP[i] = sum of DP[j] for prev[i] <= j < i. where prev[i] = last occurence of s[i]. Base case is empty subsequence. DP[0] = 1.

    Original-Problem — Just add length state in DP. DP[i][j] = Number of distinct subsequence having last character s[i] and is of length j . Base case DP[0][0] = 1.

    This solution is O(n^3) but can be optimised to O(n^2) by calculating prefix sum DP for each length layer.

    While finding best cost in problem : Start taking subsequence with maximum length.

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

very nice round . congrats

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

Can somebody please explain the graphical approach to problem E?

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

queries round.

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

can somebody explain how you think problem B solution thanks in advance

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

    Take the item with the least price, if you increase this price by k, you will get the maximum price this item can be given, Now the range of prices for this item will be, assume price as 'a', [a,a+k], Now look at the item with the maximum price, you can change it's value to anything in the range, (let price be 'b')[b-k,b+k], if you take intersection of these ranges, you will get the range in which all prices of other items can be brought to,i.e, each item in the array can be brought to some price in this intersection, the maximum of this intersection will be the answer.

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

    In B we have a sure move to maximize the common price, if that is not possible there can't be a common price.

    After sorting the prices, if we increase the smallest price by k(maximum possible increase), and if the product with largest price is less than a[0] + 2*k, then there exist an increment or decrement of a value less than k to reach that maximum possible price. But if the product with largest price is greater than a[0] + 2*k then there is no such price that the smallest and largest initial price product can have in common.

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

    thank you

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

Can someone please review my solution for B: https://codeforces.com/contest/1183/submission/56089281

I think I got lucky, since I don't even know what I was intending to do. My logic made sense in the start, and I kept changing the conditional to pass the example input.

Perhaps it will not pass sytem tests.

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

    I think your solution is correct. After sorting the array, to print (a[0]+k) as answer, we need to just check if (a[n-1]-k)<=(a[0]+k) or (a[n-1]-a[0])<=2*k. Instead of checking only for a[n-1] (or max element), you are checking for all elements which is not necessary. So it should pass system tests.

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

      Thank you for your reply. Yes I noticed this too. I wasted time being confused with myself. I fully understand it now.

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

Problem statement of C was not good, it took me around 30-40 minutes to understand the problem statement.

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

In the third problem, when I submit the solution with pypy I am getting TLE(time limit exceeded) in test 27 but when I use python 3 my solution is getting accepted. What is the difference between them and why did coordinators asked to use pypy??

edited: Solution with python 56132978 Same solution with pypy 56130341

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

    I did some research and found out that the problem is += when I tried solving with replaced += in pypy my solution was accepted.

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

Good round and good tasks. Thanks, Vovuh!

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

Will hack score?

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

.

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

How can I figure out what's wrong with my code when I get a WA on a mile long test case?

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

    Create a program that generates a (small) testcase, generate one as long as your output equals to the output of a bruteforce/copied model solution.

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

      The solution itself is more or less bruteforce plus I tested the code for a lot of small cases by hand so I'm really surprised that I get WA

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

The best div 3 I ever seen. But different in complexity between D and E was too hight.

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

Hey codeforces ,

Please check my blog where I have revealed a big fraud that happened in today's contest !

What these two users did is just unbelievable, I hope MikeMirzayanov will do something about the subject.

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

problem G getting tle on test case 6 https://codeforces.com/contest/1183/submission/56137010

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

My solution I'm getting trouble with problem B. Could anyone tell me what's wrong with my approach?? please...

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

When will the problem analysis be published?

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

any help pls!,why this code fail in test 3 problem B? https://codeforces.com/contest/1183/submission/56142029

»
4 months ago, # |
  Vote: I like it -8 Vote: I do not like it

how to solve E?? plz someone explain it in simple words

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

    Use breadth first search. Nodes are strings. Edges is removing one character from it. Use map or set to remove duplicates.

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

    For E u can simply bruteforce...Generate unique strings by deleting 0,1,2,3... characters from given string until size of 'S' becomes K... To generate all string u can use a queue of string and push the given string into it now take the front of queue, generate and push all unique string by deleting a character from it. Repeat this until queue becomes empty... You can refer to my submission

»
4 months ago, # |
  Vote: I like it -8 Vote: I do not like it

Are all the solutions rejudged? I had solved 3 problems but now it is showing none. What is the issue?

»
4 months ago, # |
  Vote: I like it -29 Vote: I do not like it

One of the worst contests ever. Terrible test cases, and for some reason, all questions had the same weight which doesn't make any sense.

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

Does our rank go up if we do successful hacks?

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

Editorials?

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

Interesting problems.

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

systems message:"Внимание! Ваше решение 56108275 по задаче 1183E значительным образом совпадает с решениями других участников и находится в группе одинаковых решений lukamosiashvili/56108275, Whatever.../56123536. Такое совпадение является явным нарушением правил. Отметим, что непреднамеренное утечка тоже является нарушением. Например, не следует пользоваться ideone.com с настройками по умолчанию (публичным доступом к вашему коду). Если вы имеете неоспоримые доказательства, что совпадение произошло по причине использования общего источника, опубликованного до соревнования, то напишите комментарий к посту о раунде со всеми деталями. Подробнее можно прочитать по ссылке http://codeforces.com/blog/entry/8790. Такое нарушение правил может являться основанием для блокировки вашего аккаунта или других штрафных санкций. В случае повторения нарушений, ваш аккаунт может быть заблокирован." I can not wonder how he copyed my code, because I not gived him my code.

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

Where Is The Editorial?

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

any editorial/tutorial please? :)

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

    https://codeforces.com/blog/entry/67973

    unofficial and please stop making these comments before reading other comments in here, you're creating useless messages which waste people's time when you could have just scrolled up a bit and found what you were looking for.

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

The test case in problem c on which my code was hacked is showing same solution on one of the correct submissions .Are there any other reasons of a code getting hacked ?

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

Where can I get editorial of this contest?? Plz help

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

Can someone please explain how to solve the last problem(H)?

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

Wow, this is my first time on the list!! Happy:)

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

This may sound dumb but I still dont understand Problem C- Computer Game. What is different between output 0 and -1?

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

    NOTE: In the first example query Vova can just play 4 turns and spend 12 units of charge and then one turn play and charge and spend 2 more units. So the remaining charge of the battery will be 1.

    doubt: TEST CASE: 15 5 3 2 If Vova can play 4 without charge and then 1 turn with charging then why is output 4?

    Help would be really appreciated

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

      It’s all based on the completion of this game. In worst case you may output 0, otherwise output -1 when Vova cannot complete anyway. Vova can complete only if after each of n turns the charge of the laptop battery is strictly greater than 0. If it is equal to zero, it can only output -1, but it is not good.

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

      The answer that the setter is looking for is the maximum number of turns Vova can play without charging, so the last turn (the play and charge turn) does not count towards the final answer. That makes the answer 4 instead of 5.

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

I am a begginer and most of my codes face TLE.Please suggest?

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

If you are Python programmer, consider using C++ instead of Python when you submit your code

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

what is wrong in my code;

include

using namespace std;

int main() { int a,n,b,d,c; cin>>a; d=a; while (d != 0) { b = d % 10; c = c + b; d = d / 10; } if((c%4) == 0) {cout<<a; } else {n=c%4; a= a+n; cout<<a;}}

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

    You should write a loop to find a bigger answer than "a" in the else statement.