Akulyat's blog

By Akulyat, 2 years ago, translation, In English

Hi, Codeforces!

Three years later, first ideas of a contest turned into this complete set of problems, so I am glad to invite you to take part in Codeforces Round #824 (Div. 2), which will take place on Oct/02/2022 17:35 (Moscow time). The round will be rated for the participants with rating lower than 2100. Participants from the first division are also welcomed to take part out of competition.

You will be given 2 hours 15 minutes to solve 6 problems. All the problems were created and prepared by me.

I would also like to thank:

Scoring: $$$500-750-1250-1750-2250-3000$$$.

Note that some problems have similar scores. Your sense of the scoring distribution may differ, don't forget to read further problems if you get stuck.

I look forward to seeing you on the leaderboard. I hope you'll enjoy all 6 problems and wish you good luck!

Too many thumbs down

UPD1: Editorial

UPD2:: Winners and First to solve

Div2

Place Participant
1 HugeWide
2 9u46
3 naaamte
4 seaneri
5 huweidong

Div1 + Div2

Place Participant
1 maspy
2 orz
3 BurnedChicken
4 disorientation
5 Chenyu_Qiu

First to solve

Task Participant
A bigfather
B Chenyu_Qiu
C Elaina-chan
D Sai_t
E swiftqwq
F tfg
  • Vote: I like it
  • +227
  • Vote: I do not like it

| Write comment?
»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

\ (•◡•) /

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

I can't wait to get back

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

I reacted with heart on telegram

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

wish everyone will find something interesting in this round

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

I hope to cross 1000 rating mark in this contest for the first time ^_^

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

Mamba Mentality Round

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

Its time to summon the hearts <3 army. Letss go

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

Finally a contest on the weekend that I can do!

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

Hope For a Big +ve delta to everybody in the contest

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

    That's not actually possible because rating is not calculated like this, let's suppose everybody solved all problems then its not that everybody will have +ve delta, delta is based on the people which have higher rating than you but performed less than you, then you will have a +ve delta...like sort the registered participants by rating and then see on which number you are coming if your rank in the contest is more than that then you will have +ve delta (assuming everybody who has registered participates).

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

A round with no tester comments! That's pretty astonishing. Edit: Now there are some.

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

    Many users(including me) would be sad as the last round had too many FSTs and Hacks due to bad testing in problem B and C! :(

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

As a tester, this contest has a couple of nice problems, and the overall quality is much better than average!

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

As a tester, I must say that the problems are really great and I highly recommend everyone to come.

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

This gonna be my first contest ever, I'm so excited

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

Hopefully i dont get destroyed by the problems like the last contest :*).

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

Hoping for +141 delta

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

My first competition

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

Good Luck Everyone!!! Hope everyone has a fun time :)

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

You could find someone to teach you if you don't know how to write a problem description, and about what information shuold be emphasized.

»
2 years ago, # |
  Vote: I like it -32 Vote: I do not like it

Solution for problem D has been leaked on a discord group by a user named Instrospection. Solution is in Python

ATTENTION, please look into it coordinators and MikeMirzayanov

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

    but how did you find that out

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

    i don't think you should comment this under the blog (where everyone can see it) in the middle of the contest :/

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

      Strongly agree with you.

      Still, he couldn't have known if it was leaked on a "discord group" if he wasn't in that group.

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

The problem statements were shit.

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

    D is a good problem, but the problem statements are very bad.

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

    I could not understand problem B at all

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

I spent too much time understanding the question, which is unfair to foreigners like me. Maybe my English is too poor.

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

I appreciate illustrations to the problem statements to make them more understandable. Without them it might've been crazy

A — 24mins, still don't know what it was about, just submitted the obvious formulae from the samples after giving up on thinking.
B — 16mins,
C — 31mins, I feel like my implementation is crap but the task itself is quite decent.
D — 24mins (just like A). Surprisingly easy. I enjoyed this kind of problem but wonder if it is too straightforward. Guess could've solved it even faster.

So to me C>A>D>B . But from the number of submissions the round seems well balanced in general except E which has a very few submissions but it is fine for most people I guess.

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

    how do you do D? Why is it easy?

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

      I guess as always for me I either think in the right direction or not. And here I was lucky.

      First think about how to find all triplets. Notice that two cards uniquely identify the third one. So you can calculate all the triplets for n*n*k. After that it becomes a basic combinatorics

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

      1) By two cards you can determine third to be in set
      2) So if two cards determine the third, then there cannot be two sets with strictly two common cards
      3) It means that any meta-set is two sets with one common card
      4) This gives O(n^2 * k) solution (store all meta-sets by common card and some combinatorics)

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

    lol idk why so many ppl have such weird opinions on the problem set. Sure, the statements were unclear (especially for B, where it was blatantly incomplete). Regardless, I think the ideas required for the first 3 problems were what you would expect in a Div2

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

      ok then maybe ur better than me then. I find it's super challenging to think (even if the problem is easy) after spending 90% of brain stamina to understand the statements.

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

        I wasn't replying to you. But I can tell you for sure that the English used for A was perfect, not sure about B. It's just that A is a difficult to understand problem in itself, maybe they could have reworded it better to make it sound less mathematically rigorous?

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

The gap between D and E is too big.
And WHY TIMELIMIT OF D is FOUR SECOND???
Even the most brute force $$$\mathcal{O}(n^3k)$$$ can pass??? Why???
(Submission 174397296 and My hack)
Just why 4 sec??? Is there a standard solution that can`t run in 2 sec???

a very bad round for me. not worthy of the time.

wow upvotes are dropping very fast:) expected it to happen:)

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

    Wuf. Even my python solution passed for half a second

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

    If $$$O(n^3k)$$$ can pass then it is the fault of the weak pretests not the loose time limit.

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

    I'm actually very surprised that brute force would pass, even with the generous 4 second time limit, since it's like, $$$10^{10}$$$ operations. My guess is that the pretests are actually not too strong, and we might see TLE hacks and/or FST on $$$O(n^3k)$$$ approaches.

    I think the standard approach would take $$$O(n^2 k \log n)$$$ time (find sum of all pairs, store them in a map; then for each card, count how many instances of its additive inverse is present as a pair sum and add the count choose 2 to the answer). Mine took 623ms, so it should comfortably fit 4 seconds with slower languages or approaches with poorer constant factors (though I don't think mine was anywhere near optimized to begin with). Maybe they wanted to disallow unordered map hacks?

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

    n^3*k passed main tests...

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

I think the problems is really good and I enjoy it, but the descriptions of them is so unclear that I waste lots of time. Hope the next time the words will be much clearer.

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

did u have to do graphs to detect cycle in C?

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

    well, it's just one cycle so you can check indegree and outdegree but I was too lazy so I used a DSU xd

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

      can u show me ur submission by pasting it here or somewhere else with a link? i wanna see but submission are not viewable rn

      • »
        »
        »
        »
        2 years ago, # ^ |
          Vote: I like it -18 Vote: I do not like it
        Here you go
      • »
        »
        »
        »
        2 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        https://mirror.codeforces.com/contest/1735/submission/174413223

        No graph. I used a Map to track which character corresponds to which character (obviously empty in the beginning).

        Filling that map is the crux of the problem. I used a List-array of size 26 to store all connections.

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

          thanks, thats a really smart method

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

      I used DSU with path compression. I was about to implement union by rank, when I recalled that it's only size 26, which is definitely not worth that much effort.

      flakes24 it should be enough to just store a parent array or even a map to indicate which character precedes another. Then when you want to make a new mapping, you can simply check all ancestors to make sure this new successor doesn't form a cycle, unless you already have a chain of all 26 letters, so the only remaining relation is to complete the cycle. I didn't actually do this (I used DSU instead), but I think this should still pass the time limit, provided that the rest of your algorithm is efficient enough.

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

        I thought about doing the second method (cycle method also striked but im not that comfortable with graphs yet), but it felt too implementation heavy to check 26 ancestors. But i had about 110 minutes after doing B and should have given it a try atleast. Thanks for the help tho.

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

      btw, do u know any good resource to learn dsus in this context?

      i dont know why youre getting downvoted tho

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

5/10 for problem quality.

1/10 for problem description.

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

Solved D 30 seconds before the end of the contest b/c I had thought my sol was incorrect.

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

I did not like A at all. I liked B a lot. The hardest about C and D were understanding the problem statements. I am grateful the testcases were good, else I would not have understood anything.

The difficulty felt nice, except for A. I think A was too strange, took me 30min to write 1 correct line of code. Solved A, B, C and D

»
2 years ago, # |
  Vote: I like it -12 Vote: I do not like it

Upvotes on this blog is gonna drop faster than my rating

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

The problems is really good but the descriptions of these problems are not clear.

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

got a stroke reading/trying to understand problem C

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

E is a bit boring, because there are too many details to pay attention to.

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

In problem B, " You want that for each pair of pieces, their sizes differ strictly less than twice. "

Twice of what?

In problem C, " each letter in s was replaced with the one that follows in clockwise order ",

Follows what in clockwise order? should have been "replaced with one that follows it in circle in clockwise order"

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

    Exactly ! Not specified clearly

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

    Nice comment!

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

    Twice of what?

    I think it is pretty clear the size of two items differ strictly less than twice means the bigger of the two is less the two times bigger than the smaller.

    Idk

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

      It definitely was not clear. My initial interpretation was that if you compare every possible pair, you would find strictly less than two instances in which the the result was that the elements were different. Of course, this would imply that all elements must be equal unless there are $$$\leq 2$$$ elements, so I was very confused at how simple this was, until I saw the test cases.

      The visual explanation helped clear up my mistake, but it doesn't change the fact that the initial wording was very poor. Thankfully, a clarification was issued shortly at the start, so they at least responded properly to inquiries.

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

I think C is easy for people who knows graphs (dfs) and can write very hard code

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

    I think all questions are easy for people who know how to solve it

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

    You don't need graphs and dfs for C

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

      Yes, but i don't say that graphs is only solution

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

      Also come on. Stop mentioning dfs as some advanced technique that few people know

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

      Yes, a while loop will do.

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

All the problems were insanely good, and I especially liked C. One of the most balanced + well prepared round I have ever participated in. Congrats to authors!

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

Problem F is a good problem!

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

I misread the shit problem statements many times. My entry experience was extremely bad.

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

Is there anybody else who struggled in understanding problem statements today?

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

Very confusing description... Had to guess the meaning based on given test cases for the first few problems :-)

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

    Can you specify what exactly was not clear?

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

      Perhaps "very confusing" is a bit over, but I think I do need to carefully look over every word in the description to understand them, while in previous contests just skimming over is enough. For example, "For this reason, all 26 lowercase English letters were arranged in a circle in some order, afterwards, each letter in s was replaced with the one that follows in clockwise order, in that way the string t was obtained." It seems unclear to me what each character in s is replaced with, and I had to go over the TCs to make sure what I am thinking is correct.

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

How to solve D?

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

    Ok, this was the first time I solved D, and to do so I broke this problem into different parts, so the first significant observation was no 2 sets can have 2 same cards, as it will force the third card to be same and hence 2 sets to be same. So let's say card 1 was in 6 sets then I can combine any 2 sets and that will be a meta-set, so the total meta-set would be 6C2 (choose any 2 sets among all possible), so, if I am able to find in how many sets each card is in then I can sum all their results (cnt[i]C2). To find a set, for each pair of cards I found out which was the required card so that they form a set (this card will always be unique) and checked if that card existed in our n cards, to do so in log(n) I stored each card in the map. so total time complexity was O(n*n*k*log(n)).

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

Make it unrated

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

    Why? That's all legal. Statements hard to understand but you can understand

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

    This round must be unrated because we can't understand the problems. So without understanding we can't solve.

    some people are not good in english so you better use simple words/sentences.

    "their sizes differ strictly less than twice." this is shit.

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

      1.Read carefully 2.Watch at examples and notes 3.Use translator

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

      I think, your problem isn't "understanding problem"

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

How much for a good problem statement, please? ,

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

why engish in this round so hard to understand qnq

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

Is there anyone like me? When I'm confused about a problem statement, my brain is fried and can't think anymore for the rest of the contest.

I was super confused about A and D problem statements.

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

    I spend about 20 minutes in understanding problem A and decided to leave the contest.

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

      I spend around 25 min in finding a approach with wrong submission , It is more logical than B

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

I quickly found a solution for E, but unfortunately, because i was stuck on C for a long time because of implementation issue, i had no time to implement E. Solved A,B,C,D

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

Solution for D:

Firstly,let's find all "sets":

Enumerate each pair $$$(card[i],card[j])$$$,we can calculate a unique $$$card[k]$$$ according to $$$card[i],card[j]$$$.

Next, we only need to check whether $$$card[k]$$$ is in the given cards.

Time complexity:$$$O(n^2k)$$$.

Next, we notice that the intersection of two "sets" has at most one card.

$$$Proof$$$:assume the intersection of two "sets" has 2 cards $$$card[i],card[j]$$$,we can calculate a unique $$$card[k]$$$ according to $$$card[i],card[j]$$$,which leads to contradiction.

For each $$$card[i]$$$,suppose it exists in $$$k[i]$$$ sets,if $$$k[i] \geq 2$$$,we can select two from the $$$k[i]$$$ "sets" to form a "meta-set".

It can also be proved that all selected "meat-sets" are distinct.

So the answer is $$$\Sigma {C^{k[i]}_{2}}$$$.

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

D and E are amazing!
D ... All CPer who have played SET must think "From $$$2$$$ cards I can identify the last card" at least once, I guess.
E ... We must use matching to solve this? Nope.

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

good contest!!!

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

Problem description left the chat.

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

i spent more time understanding problem statements than actually solving them.

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

CF rounds helping us practice reading comprehension as well. nice.

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

"their sizes differ strictly less than twice." I bet it'll be fun to solve the "once" version of it. Twice fun in fact.

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

    It was a weird way to write the statement ;/

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

I solved A by test case №3 i just divided 1033/3 and found genius formula.

»
2 years ago, # |
  Vote: I like it -12 Vote: I do not like it

Problem D

English version: "A feature for three cards is called good if it is the same for these cards or pairwise distinct."

machine translation of Russian version: "For a trio of cards, a characteristic is good if it is the same for all three cards, or all three are different in pairs"

Sad that I prefer the machine translation...

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

Can anyone please explain problem C in a clearer way?

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

    in order to get the lexicographically smallest string you should go from left to right and try to map every character by the alphabetical order from a to z,consider it as graph where there is a directed edge from a character to the character it is mapped with, here you should take care of 3 cases

    1 — you can't map a character to itself (loop edge)

    2 — you can't make a cycle of length less than 26

    3 — you can't map a character to an already mapped one

    take a look at my code , i hope i made it clear.

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

      where is your code?

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

      Many many thanks for explaining the solution approach, but I was more into problem statement, what actually the problem said?

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

        simply you initially have a string s , to obtain the string t you make your own alphabetical order of the 26 letters such that each letter in string s is replaced by the letter the goes next to it in the alphabetical order you just made

        for example if your s is aqerk and your 26-string order is something like au..qw..er..rz..ko , then your t-string is uwrzo

        now you have string t , you should output the lexicographically smallest string s which could lead to string t by some mapping order

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

ReadingForces

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

Very intresting!I tried my best and I think I will get a good result.I really love these problems.

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

I really enjoyed today's contest. Although some of the problem descriptions werent the best, problem A B and C were very interesting and the pretests were very strong. keep it up!

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

Problem description is like: Go A to B then go C then back to B, again back to A then go C finally print "Helo World".

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

Had a contests filled weekend and I had a great time

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

The questions were really good! Thanks for good questions :)

  • The solutions and proofs were all very beautiful(for the questions I have solved)
  • The problems were generally straightforward

My only possible critism is that this round was more about finding ideas....

But I really enjoyed it!

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

Anyway, a good contest!

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

can someone please help me, where am I going wrong this is solution for B

            Arrays.sort(arr);
            int div = 2*arr[0]-1;

            for (int i=0; i<n; i++) {
                if (arr[i] >= 2*arr[0]) {
                    ans += (int)Math.ceil(1.0*arr[i]/div);
                }
            }
            System.out.println(ans);
  • »
    »
    2 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I think you need Math.ceil(1.0*arr[i]/div)-1 instead of Math.ceil(1.0*arr[i]/div) as dividing a number in n pieces will need n-1 operations

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

    Note: ans+=(arr[i]+div-1)/div-1; That is math

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

In problem D, I used unordered map to hash from vector of int to int and it took over 1 second to run which is longer than most submissions. Anyone know why?

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

    hash function could be slow, there could be hash collision in your hash function, or else there is somewhere else that adds/multiplies to the time complexity.

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

      Is there any better data structure to store the value for each card? Because editorial also suggests us to use map/hashmap.

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

        I think map/hashmap is good enough for the question, but generally I don't recommend you using unordered_map on codeforces, as it could be vulnerable to hacks by deliberately causing hash collisions.

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

          In the case of problem D, I think it is possible to hash the set without hash collisions using 3**k and long long int; If you used this as an hash value, I think map/hashmap is going to be near to best you can use.

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

            Yeah, I just tried your suggestion and it still took quite long so the problem might be my implementation. Anyway, thanks a lot for detailed explanation.

»
2 years ago, # |
  Vote: I like it +1 Vote: I do not like it
I would like to thank:
"Aleks5d, arzhantsev64, ChthollyNotaSeniorious, DanWallgun, flowerletter, Gegege337, Imakf, LeoRiether, mejiamejia, okwedook, PO3OBAR_Bblnb, SSerxhs, TomiokapEace, triple__a, wabadabakalakaboo for testing the round and giving significant feedback."

I see that there are several testers. Do they only verify the accuracy of the judge data or do they proofread the problem descriptions as well?

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

Can Any Body explain the Solution of Problem B

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

    174391163 if you see my code.I think you can understand this problem.

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

    It is no good to divide further the smallest number, as it will always result in more operations caused by having to divide up other numbers further. And therefore, we can transform the question to: given n numbers, make every numbers that are not the smallest number between the range of smallest number/2+1 ~ smallest number*2-1. Dividing each number so that all numbers are between the range will take ceil(number/(smallest number*2-1))-1 operations: and so the answer is the sum of it for all numbers.

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

      dhyang24 why you have taken ceil(number/((smallest number*2)-1))-1 rather than ceil(number/(smallest number*2))-1 this

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

        The question states that the biggest number should be strictly smaller than smallest number*2; the maximum number after the division must be (smallest number*2-1)

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

      It is guaranteed that if you divide a number in ceil(number/(smallest number*-1))-1 parts, when evenly distribued, it is in the range of smallest number/2+1 ~ smallest number*2 -1

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

        And can you tell why have take -1 after calculating ceil value

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

          dividing a number into n parts will take (n-1) operations, as each operation increases the total number of parts by 1, and the initial number of parts is 1.

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

            Ok I got it thanks for giving time to my Queries dhyang24 And Congrats for becoming Candidate Master

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

I’m sorry that the English statements are confusing.
I tried to make them plane, but it was hard for some sentences.
We discussed the places you were confused by and these are the best formulation we eventually came to.
I would really like to see your suggestions for replacing them. I still can’t choose good options. I hope that next time I’ll be more careful and precise.

I hope you enjoyed the problem ideas after you got through the statements.
Anyway, don’t forget to check the editorial and feel free to ask me if there is something unclear there too.

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

Problems have pretty bad wording, otherwise it is fine I think

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

C, it correct when I tested but codef say... 174424830

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

    I don't understand your approach entirely (it would help if you commented what the different arrays actually meant), but it seems like you're missing the check for when all 26 letters are linked, in which case you would need to link the endpoints to form a cycle.

    Instead, I think your approach would eventually try to extend beyond the 26 letters and/or try to access an array element that was not initialized, which can lead to different results. As such, even if you saw the correct answer on your own machine, there may be undefined behavior, which can lead to different results in other machines.

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

I need upvote anyone can help TT.

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

Ratings updated preliminarily. We will remove cheaters and update the ratings again soon!

»
2 years ago, # |
  Vote: I like it -26 Vote: I do not like it

speedforces

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

    not really, at least problems up to C were definitely not the hardest problems (in the corresponding position) I've ever seen. I even thought D might have been worth a try. (though I did lack the ideas for it)

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

Problem F is very nice, thank you!

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

In question C: why can't

badcfehgjilknmporqtsvuxwzy be the answer for abcdefghijklmnopqrstuvwxyz?

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

    because you must always get a big loop with length 26. But in your example you have loops: a->b->a, d->c->d and so on

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

There is Codeforces Official Channel in Telegram with round announcements. For some reason, all posts get an overwhelming amount of thumbs down. Can we turn the situation around and let hearts win? 209 hearts and 139 thumbs down at first message, 134 hearts and 137 thumbs down at second, hearts are winning

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

I like this Score Distribution : 500 — 750 — 1250 so much

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

Had lot of learning and fun. Thank you

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

I think the problem D should add a tag named Reading Comprehension.

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

I don't quite understand why there are many difficult questions to read recently, such as the D question, which is difficult to understand, but I can quickly pass after understanding

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

D and E are very nice problems! (especially D in my opinion)

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

can't find my rating; I can still see the score and rank, but not rating, I remember seeing a notification saying that my rating has updated post this contest. Was the contest made unrated or is this something that only I am facing?

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

My solution to A was reported similar to someone else. Now, this is because we happened to use the same code template, which is available online, and the code for A was pretty short and simple. This is a mere coincidence. Why would I plagiarize problem A. Please revert back my rating changes, I have given the contest honestly