DimmyT's blog

By DimmyT, 4 years ago, translation, In English

As-salamu alaykum, Codeforces! (Peace, Codeforces!)

We are glad to invite you to Codeforces Round 673 (Div. 1) and Codeforces Round 673 (Div. 2), which will take place at Sep/27/2020 18:05 (Moscow time) (notice later time than usual). The round is rated for both divisions. Each division will be given 6 problems to solve in 2 hours.

Problems were prepared by nkamzabek, bthero and me DimmyT.

We are very grateful and would like to sincerely thank the following people for their assistance in preparing the round:

This is our first round, we hope that the problems will be interesting and that the round will pass without issues.

Score distribution:

Div2: 500-1000-1500-2000-2500-3000

Div1: 500-1000-1250-2000-2250-2750

Wish everyone good luck and high rating!!!

UPD: problem ideas

UPD: Editorial Out

Congratulations to everyone, contest passed without issues!!!

Div1:

  1. tourist

  2. ksun48

  3. maroonrk

  4. 300iq

  5. Aidos

Div2:

  1. poorboy

  2. kaisel

  3. immortalhunt

  4. hieu_2004

  5. _dg_

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

| Write comment?
»
4 years ago, # |
  Vote: I like it +49 Vote: I do not like it

Hope that your first round as a setter will be flawless.Good luck DimmyT.

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

As a setter, give me a contribution please)

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

How was this blog made 7 weeks ago?

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

    I guess its because He started writing the blog 7 weeks ago and posted it today

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

    Because, in Kazakhstan, we have a time machine which can take us back for at most for 7 weeks.

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

      wait!! still you are orange. (as you can better your previous contests by going back in time)

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

        Proof that orange is the best color.

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

          Yes

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

          I made this comment long ago, when I was young and foolish. I have since changed my mind on this topic. Truly red is the best color.

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

            congratulation for getting red!

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

          But you are red now ORZ

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

      Sounds like beginning of a problems.

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

DimmyT Will I reach you? I hope I can reach you...

Reference: See my profile picture and the problem setter's. Also, I do want to reach Master. :3

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

clash with CodeAgon 2020 (Codenation coding challenge) https://www.interviewbit.com/contest/codeagon-2020/

just saying :)

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

Good luck to everyone and thanks the authors for the contest!

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

DimmyT Please BOLD or HIGHLIGHT the unusual contest time .

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

    Done

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

      Do you really think that the bold rated will stop inquisitive people from asking "Is it rated?"?

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

Wa alaykumu as-salam

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

Wa alaykumu s-salam DimmyT

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

Oalaikumus salam

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

lovely to see salam... Walaikumussalam

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

Oya-laikumus salam DimmyT,, hope the Div-2 round will be very interesting ❤

»
4 years ago, # |
  Vote: I like it +54 Vote: I do not like it
Fun fact
Another fun fact
Conclusion
»
4 years ago, # |
  Vote: I like it -28 Vote: I do not like it

Wa alaikum us salam. [user:DimmyT]Very very good wishes for your first round.

»
4 years ago, # |
  Vote: I like it -60 Vote: I do not like it

Good to see a round from the Borat country_****_

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

    Number one problems in the region!

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

Why have you tagged this round as cf666 ?

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

A best of luck to all from this baby panda :)

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

what is the division rule in parallel div1/div2 round, because i am seeing that some experts are registered in div1 and some master are also registered in div2 too so am i little bit confused can anyone explain

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

    register started before last rating update.

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

    maybe that or those masters doesn't wanna participate in rated contest..so they registered in div2

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

      in parallel round there is no case of unofficial participant, contest is rated for everyone....

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

Hope that I will become specialist after this round.

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

    hope that i will become candidate master after this round :( +111 rating

»
4 years ago, # |
  Vote: I like it -41 Vote: I do not like it
Spoiler
  • »
    »
    4 years ago, # ^ |
      Vote: I like it +9 Vote: I do not like it

    For those too lazy to click 15 times it says Good luck and high rating!!1!

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

this contest time is very good for me.

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

Walaikum-assalam...waiting for your first and hopefully nice round.and also hope i will reach my top rating ...

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

waiting for score distribution

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

Wa alaykumu s-salam!

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

Good luck to everyone!

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

Will score distribution publish after the contest?????

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

Hope for a better Rating for me and everybody :) keep practicing!

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

Less than 90 minutes until the round starts.. no score distribution yet?

UPD 1: Less than 60 minutes, no score distribution yet

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

    Less than 45 minutes, where's score distribution?

    UPD1: wait, they finally posted it.

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

As a contestant, I would like a cake.

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

    I just ate cake. What coincidence :D

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

thanks again to MikeMirzayanov to for creating, developing, and maintaining the best websise of algorithmic problem ever. and my congratulation to you, DimmyT, for managing a team to creating contest and I hope that will be one of your best experience.

thanks again for your efforts.

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

DimmyT how many shared problems will be?

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

"UPD: problem ideas"

got trolled by this in the update.

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

Original Song is so inspiring!!!

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

This is my first time I solved a div2 probelem during a contest. Yeah!!!!!

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

hello all ,can someone explain me , why my rank dropped ,the moment i submit the same code for the same problem after sometime tho it was already passing the pretests successfully?

»
4 years ago, # |
  Vote: I like it -48 Vote: I do not like it

I'm really disappointed I took my time thinking in C but couldn't see the solution :/

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

    What do you mean by "see", do you mean "without getting the solution"?

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

    What was the point to write it in the comments? You wanted to show everybody how stupid you are? Well, mission accomplished dumb ass

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

      if someone couldn't figure out the solution of some problem that doesn't mean he's stupid most of the times I can solve C
      what's the point of your comment? to show me that you're a piece of shit ? Well, mission accomplished dumb ass

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

        Bruh, why do you still green-piece-of-shit if you've already participated in 200 rated rounds

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

          I'll come back to cyan soon don't worry no wonder why your contribution is -7 because you're a jerk

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

            at least, I participated in less than 150 rounds, and I have higher rating than you, and I don't cry because of unsolved problem

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

              there are others higher than you so what's the point ? does that give you permission to talk down to others should tourist come and write to you orange-piece-of-shit and I'm not crying it's just a comment that expresses what I feel WTH do you want from me

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

                OK, I think guys, that have higher rating then I and had participated in less rounds than I are really cool. I want you to delete all your useless comments, because people here don't give a fuck about how you were thinking in div2 C and didn't solve it. You have just to work hard and don't write this shit in comments.

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

                  I don't think I should take advice on what I should I write from -7 contribution asshole make your contribution more that 100 then speak

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

                  Oh yeah, if u think that contribution shows the level of your IQ, than u r really stupid

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

                  Can you complete a sentence without saying bad words?

                  There are many of codeforces users who have not yet completed the age of 13 and you are affecting them with your speech.

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

                  well it shows how good your comments are and your comments sucks
                  so you think tourist is cool well you're right he is cool but does he talk like you ? No he never told someone you're bad because he isn't a piece of shit like you

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

                  impermanence how old are you lmao.

                  8?

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

                  OK

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

                  Sure

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

            And I really don't give a fuck about my contribution:)

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

            In Ukraine we say:"Не кажи гоп, поки не перестрибнеш", and i think it's beautiful.

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

              In Ukraine "Kyivstar" bans Codeforces, and i think it's beautiful.

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

        If you can't solve problem, it is your fail. Your comment was stupid and useless. You have better go and upgrade your skill.

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

          I'm sure in real life you look like your profile picture

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

            ахаха чел на риал лайф сразу переходишь та куда

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

              иди на хуй себя

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

            savage.......

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

        Really guy, why do you write this comment? What are you waiting for? You simply write shit into comments, and because of you and guys like you comments section have a lot of useless shit instead of really important comments.

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

          so all of the other comments are full of useful information ? let's see one of your comments
          you should create problems on mathforces, not codeforces. well that was really great comment ... but it's better if I didn't read it

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

            Don't react to these negative messages. These guys are just provoking you.

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

              You're right I won't next time they're just trolling

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

nice score, awesome D...

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

That was stressful, wow.

In Div1C, was it intended to disallow $$$O(n \log n \log C)$$$ solutions? If so, it would've been better to make it explicit with setting $$$n = 10^6$$$ or something.

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

    I was also stuck at this the whole time.

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

    my o(nlogc) get tle

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

    My $$$O(n log C)$$$ solution using unordered_map TLE for a few times.

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

      In my experience "$$$O(f(n))$$$ with unordered_map" in practice performs more like $$$O(f(n) \log n)$$$.

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

      I was able to pass with the same complexity using gp_hash_table

      https://codeforces.me/blog/entry/60737

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

        Now hacked by test case 44

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

          Unfortunate :(

          A question: does the test case just force a lot of hashmap accesses or is it specifically made to kill pb_ds

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

            I think it is specifically made to kill your simple hash.

            https://codeforces.me/blog/entry/60737

            PS. The hack is not made by me so I just guess.

            PSS. I just realized the blog is shared by you first.

            In this post it said:

            A better hash function ...... I used hash function in the post to get AC now.

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

    Agreed, time limit was definitely not fun, I only got AB because of starting C too late and not giving myself enough time to optimise at the end :[

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

    My solution worked pretty fast. Also, the intended solution was $$$O(n log C)$$$. My solution: 94020968.

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

      Not allowed to view the requested page :/

      I'm sure the intended solution was $$$O(n \log C)$$$, but in the case of borderline complexities like $$$O(n \log n \log C)$$$ it would be nicer to have time limits and constraints that make it clear whether it passes or not. Currently it seemed clear that $$$O(n \log n \log C)$$$ would pass, but in the end I found out that it doesn't.

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

    Should ideas rather than optimizations.

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

      The intended solution should pass pretty easily

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

        my O(nlogc) solution took 1.8s(I noticed this 10minutes after passing pretests) in pretests.Since it was very close I didn't want to take risk.I had to constant optimize it and resubmit losing a lot of points in the process.also got mle once just for using long long instead of int.imo in trie problems ml should be higher.like 1-2 gb

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

          My solution uses pretty small amount of memory. My implemention with trie pass easily too.

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

    Yes my $$$O(n \; log \; n \; log \; C)$$$ using mergeSort failed but passed in 2386 ms in mashup :(

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

why is my contribution -1? what did I do?

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

    You posted this comment without formatting code and without hiding code in a spoiler tag.

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

      Okay. I didn't know that. I am new. How can I now make my contribution non-negative?

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

        My suggestion (this goes out to everyone who has negative contribution and doesn't understand why): lurk the blogs and comments here to get a feeling about which comments and blogs are welcome. And only once you understand, start commenting yourself.

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

WA 6 times.

Div2D pretest 2 is literally mocking at me.

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

And the fastest editorial publisher award goes to DimmyT

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

Can someone please explain the wrong strategy in my d2c ans : Store the indices for each value and then find the minimum value of k for which this fits by binary search. and then manipulate the answer array with left to right traversal.

Regarding binary search I got a pattern that for each indices in kth supposed iteration its supposed count is min(i, k, n — i + 1, n — k + 1) then I binary search on the value of k.

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

submit F in last 5 seconds and find my output is following:

YES
1 1 1 1
1 1 1 3
4 2 3 1
RDLL
DRDD
ULUU
NO

instead of

YES
1 1 1 1
1 1 1 3
4 2 3 1
R D L L
D R D D
U L U U
NO

Hope my solution is wrong XD

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

Cornercase for Div2D: it is possible that we can't subtract anything from such ai that ai<i and this ai is more than sum(a)/n, but we can add to it i-(ai%i) from a0, so solution exists in that case

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

    Also, I've been struck for a long time thinking what if i-(ai%i) > a1. But since at any point say we are at index i, a1 must contain atleast i-1 (as initially all elements >=1). And i-(ai%i) cannot be greater than i-1(since i doesn't divide ai). Hence, the non-negative condition holds. Nice problem.

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

Div1B : The initial value of a_i IS NOT 0

haha....

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

    That one totally got me, I kept thinking that raising a[i] up to i's multiple may cost a[1] become negative...

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

    happened to me too :(

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

got OK on D with 1466 ms with sets in $$$O(nlog^2n)$$$

how to solve it properly?

UPD: resubmit of the same code in upsolving results to 1231 ms. got "lucky".

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

Tonight may be the second time I turn blue. My performance tonight is not good. After finishing the first three questions, I looked at D and didn't have any thoughts, and then I looked at E and I didn't even think. Finally, I came up with an algorithm for the number of operations for question D of 2*n, and submitted it at 01:52. But returning to the wrong answer, I reviewed the code and found a bug, but there is no time to change it. If you give me half an hour more, maybe I can pass it. I also want to be a candidate master, but I know this is not realistic. The realistic goal is to stay blue for the next few rounds. It's incomparable to a god who can turn yellow or red in a few games, and I am satisfied with that. I don’t have any acm and oi experience. I’ve been in contact with codeforces for four months. I can’t even solve div2a from the beginning (yes, I tried div2a for one round, but after trying for more than an hour, I still didn’t get ac. There was no way, I had to look at other people's code, and finally passed this question.), This is my first experience of doing the question in codeforces. By now, I finally solved some problems. Having said that, I hope everyone has good luck and a good rating, and most importantly, make progress on codeforces.

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

    You can do it!!! Before I finally became a Candidate, I almost fell to Specialist.

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

      What is wrong in the solution of D. (Div 2)

      Code

      UPD: Found my bug. Thank You all.

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

      I must say the problems were very good!

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

      This contest is great, thank you for your encouragement.

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

please help why my logic of two sum is not working for problem B My Code

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

    I tried your code with the following input and got the wrong output. In the result, the two groups would be "1 4" and "1 4", and clearly there is a pair that adds up to 5 in each group. The correct partition should be "1 1" and "4 4"

    Input:
    1
    4 5
    1 4 4 1
    Output:
    1 0 1 0
    

    You would want to be consistent in the partition of numbers — by which I mean if one 4 is given to group A for one time, you'll also want it to be given to group A when it appear for the second time. The way I did it is to:

    for(ll i=0; i<n; ++i) {
                if (umap[k-nums[i]]>0) {
                    c.push_back (i);
                    //delete this line: umap[k-nums[i]]--;
                } else {
                    umap[nums[i]]++;
                }
    }
    

    and treat "number = half of the unlucky number" as special cases.

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

      Hi, why we need to place in same group.. can you please explain me why we need to be consistent in partitioning.

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

        If you have "3 5 5 3 3 5" and the unlucky number is 8, and if you put 3 into group A the first time and into group B the second and the third, it would be like:

        Group A: 3 5 5
        Group B: 5 3 3
        

        But in this case both of the group contain two pairs of 3-and-5, which adds up to 8.

        A better solution is to partition this into:

        Group A: 3 3 3
        Group B: 5 5 5
        

        In this case no 3 and 5 are in one group.

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

****i think you should make strong pretests..**** btw good questions great-

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

    yes , you are right , pretests are soo weak

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

      You being hacked does not mean pretests were weak. It just means that you sent an incorrect code

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

        my answer had not been hacked , it passed pretests but wrong answer after system tetsing, so please have correct knowledge before saying something

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

can someone help me find why it FST in div2b[submission:93982376] thanks

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

    One of the problems I see is you seemingly have uninitialized c when k%2 == 1

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

    On line 39:

    38   rep(i,0,n){
    39   	if(a[i]>=k){
    40           cout<<0<<" ";
    

    if you put "if(a[i]>=k)" instead of "if(a[i]>k)",then both all numbers bigger than k and k s themselves are automatically labelled 0.

    However, the numbers could also contain 0, and thus 0 and k are both labelled 0, according to your codes.

    Best luck next time, Kanshan.

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

      Oh.thank you . i remember that ai is greater than 0. apparently I was wrong

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

      but in that case. k were not in mp. so 0 will be labelled 1.

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

      sorry I find that when k is 0 I will get wrong

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

What about div-2 B

can some one give me some idea for that

Thanks in advance

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

    Try to partition the numbers into two sets in such a way that for a number $$$x$$$, $$$x$$$ and $$$T - x$$$ won't belong to the same set

    If both sets contain $$$T - x$$$ go to the set with the minimum count of $$$T - x$$$.

    Submission: Link

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

How long will rating be updated after the game?

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

    1 day I think, after the Hacking period

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

      This was a div2/div1 round. So, no hacking period.

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

        Wait, hacks are supposed to be done during contest...? I never did any hacks before so I thought it's after, sorry for that. But the scores are indeed updated one day after the contest, right.

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

          No, ratings usually update about an hour, or two after a div1/2 contest. By the way, FYI hacks will give you points in div1/2 rounds.

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

Congrats Ashishgup

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

Thank you DimmyT, this contest helped me to get Specialist