Блог пользователя Pyqe

Автор Pyqe, 8 месяцев назад, По-английски

logo

Sugeng enjing, Codeforces! 🥰🥰🥰🥰

COMPFEST 15 is happy to invite you to participate in Codeforces Round 902 (Div. 1, based on COMPFEST 15 - Final Round) and Codeforces Round 902 (Div. 2, based on COMPFEST 15 - Final Round) on Oct/08/2023 12:05 (Moscow time). Both rounds will be rated. You will be given 2 hours and 30 minutes to solve 7 problems.

Note the unusual time of the round.

The problems are written by ArvinCiu, Pyqe, and nandonathaniel.

We would like to thank:

COMPFEST itself is an annual event hosted by Universitas Indonesia. It is the largest student-run IT event in Indonesia and competitive programming contest is one of the competitions hosted.

We hope you will enjoy and have fun in the contest. Muga-muga beja lan isa entuk biji apik!! 💪💪🔥🔥

UPD: Scoring distribution

  • Div. 1: 500 — 1000 — 1250 — 1750 — 2250 — 2750 — 3250
  • Div. 2: 500 — 1000 — 1500 — 2000 — 2500 — 2750 — 3000

UPD2: Contest is over!

Congratulations to our winners!

Congratulations for our first solvers:

Div. 1

We will try to post the editorials as soon as possible. Please stay tuned!

UPD3: Editorial

On behalf of the COMPFEST committees, we are glad that our Codeforces Round ran quite smoothly and we hope that you all enjoyed our problems. See you next year! 😍😍

  • Проголосовать: нравится
  • +570
  • Проголосовать: не нравится

»
7 месяцев назад, # |
  Проголосовать: нравится +85 Проголосовать: не нравится

Thank you errorgorn for carrying

»
7 месяцев назад, # |
  Проголосовать: нравится +19 Проголосовать: не нравится

rfpermen will win COMPFEST 15!

»
7 месяцев назад, # |
  Проголосовать: нравится +33 Проголосовать: не нравится

Thank you Pyqe for carrying

»
7 месяцев назад, # |
  Проголосовать: нравится +14 Проголосовать: не нравится

orz errorgorn coordination twice in a row

»
7 месяцев назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

.

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится +68 Проголосовать: не нравится

    The round is based.

    Actual answer
»
7 месяцев назад, # |
Rev. 2   Проголосовать: нравится +74 Проголосовать: не нравится

As a tester, I am forbidden from commenting on the announcement post with any opinion.

»
7 месяцев назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

What is the meaning of Muga-muga beja lan isa entuk biji apik!!

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится +40 Проголосовать: не нравится

    It's Javanese (a local language in Indonesia) meaning "good luck and have a good score" :D

»
7 месяцев назад, # |
  Проголосовать: нравится +63 Проголосовать: не нравится

As a tester I can assure you the problems are very **********************************.

»
7 месяцев назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

The starting time was really weird but i guess it will be held on sunday after all

»
7 месяцев назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

Finally a new round after 8 days :)

»
7 месяцев назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

Contest, finally.

»
7 месяцев назад, # |
  Проголосовать: нравится -64 Проголосовать: не нравится

Not Every Country in the whole world observe a holiday on Sunday. In my country, Friday and Saturday are the two off-days in the week. And Sunday often is the busiest day of our schedule as it is the beginning of a new weekend. IF YOU COULD HOLD THAT CONTEST ON SATURDAY IN SUCH AN UNUSUAL TIME, then no people in the world would have had any problem as Saturday is the intersection of two traits of holidays.(friday-saturday based holiday like my country and Saturday-Sunday based on the majority of the country).

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится -16 Проголосовать: не нравится

    Certainly I agree with your idea. The unusual time is unfriendly for both Chinese and Americans. For Americans, it seems harder to wake up so early. And for Chinese, there was a National Day holiday until 6th so we had to go to school or work. We are still studying or working at 17:05. However, I can accept the usual time, 22:35 because I am allowed to stay up late at my dormitory.

»
7 месяцев назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

Hope i have a good luck

»
7 месяцев назад, # |
  Проголосовать: нравится +13 Проголосовать: не нравится

Good luck everyone, Remember, you don't lose when you fail, you lose when you give up.

»
7 месяцев назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

what will be the score distribution system?

»
7 месяцев назад, # |
  Проголосовать: нравится -21 Проголосовать: не нравится

Tomorrow I will fall 100 rating in CF first and then fall to blue in ARC.

»
7 месяцев назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

Hope I have good luck.

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Waiting.....................................

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

what will be if you win ?

»
7 месяцев назад, # |
  Проголосовать: нравится +7 Проголосовать: не нравится

Please note the unusual timing of the round

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

are COMPFEST div 2 problems harder than normal div 2 problems?

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Muga-muga beja lan isa entuk biji apik!! Sound interesting, What's that mean?

»
7 месяцев назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

Please announce the score distribution system.

»
7 месяцев назад, # |
  Проголосовать: нравится -6 Проголосовать: не нравится

As a participant I hope to get 1200+ rating or even better, Pupil ****

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Good luck everyone.

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Thankyou

»
7 месяцев назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

Thanks for bringing this time to the game!

»
7 месяцев назад, # |
  Проголосовать: нравится +13 Проголосовать: не нравится

Why are there so many problems(like 7 problems) in recent Div1 contests? It's hard to adapt.

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Hey King 👑 you dropped "score distribution"

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

best wishes

»
7 месяцев назад, # |
  Проголосовать: нравится -6 Проголосовать: не нравится

clashing with icc world cup

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Who wants the cantest to start at 14:35 UTC?

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Finally, Chinese Oiers don't need to hold up to 1:05 evening. :D

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Pyqe mlbb?

»
7 месяцев назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

good luck to everyone

»
7 месяцев назад, # |
  Проголосовать: нравится +22 Проголосовать: не нравится

265 forces

»
7 месяцев назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

The Scoring distribution is opposite in the announcement, swap div1 with div2.

»
7 месяцев назад, # |
  Проголосовать: нравится -9 Проголосовать: не нравится

It seems D1 = 500 1000 1250 1750 2250 2750 3250, does it correct?

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

i see that was found extra register so where is it

»
7 месяцев назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

Completed A-D in 40 minutes ,then nothing for 2 hrs. E>>>>>D.

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

How to solve D

  • »
    »
    7 месяцев назад, # ^ |
    Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

    Just iterate over every maximum value $$$g$$$ from $$$1$$$ to $$$10^5$$$. Then, let's say $$$x$$$ = "count of indices that needs to be colored black to get a maximum of $$$g$$$" and $$$y$$$ = "count of indices that when colored black gives a maximum value less than $$$g$$$". Then, the contribution for $$$g$$$ would be $$$c_g = 2^{x + y} - 2^y$$$. Answer is the sum of $$$c_g \cdot g$$$ over all $$$g$$$.

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    You can use the following formula $$$\sum x*freq[x] = \sum freq[>=x] $$$. RHS means for given x, frequency of elements which are greater than or equal to x.

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Can anyone please help me understand the solution for DIV2 Problem D Thanks in advance :)

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    It will be quite hard to explain. Wait for an editorial.

  • »
    »
    7 месяцев назад, # ^ |
    Rev. 2   Проголосовать: нравится +9 Проголосовать: не нравится

    If we select any index i to make it black we can replace arr[i] with the maximum value at any index j, such that i is a factor of j (because we would always be marking all such j green).

    Then we can sort the resulting array, and now for the maximum element to be Kth from this array, we have 2^(k-1)*arr[k] possibilities, we can just calculate this sum for all the elements from 1 to n in the sorted array and take the remainder which would give the ans.

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    I'll explain my solution, maybe not most efficient. Basically, for each idx we go to the right with step idx to find the maximum value that this idx can lead to after coloring. It is similar to how we use of sieve of eratosthenes, although in our case we do it for every idx, not skipping already visited before. (Let's say idx == 2, we're going to check idxs 2, 4, 6, 8,... and store max value of them. For idx == 4 we're going to check 4, 8, 12,...)

    After that we create dictionary value -> amount of idxs (that lead to that value after coloring them with black)

    And starting with greates value to lowest, you have value: amount of idxs. Let's say v: k. And let's say amount of possible numbers to choose from is n (it's n in the beginning). Amount of subsequences which contain at least one of numbers from those k numbers is 2 ** n — 2 ** (n — k). (total — amount of subsequences that don't contain at least 1 of those numbers). You multiply it by value v and add it to result. Then you do n -= k, as we don't want to consider those anymore. MOD at the end

»
7 месяцев назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

Duck problem F

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

WTF with D's nowadays

»
7 месяцев назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

What a great Contest

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I'm honestly really annoyed at this, can someone see what's wrong with my code because I've been trying to debug this for the last 20 minutes.

Submission

  • »
    »
    7 месяцев назад, # ^ |
    Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

    fact[now] / (fact[i] * fact[now - i])

    Suspicion... I'd rather multiply by inverse of fact[i] * fact[now - i], because fact[now] not necessary dividable by fact[i] * fact[now - i]

»
7 месяцев назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

Is my solution correct for D1C?

For each of the directed subgraph, we need to find cycles and then there are 3 cases on some pair of adjacent nodes (pick both, pick first, pick second). For each case, apply dp and find the maximum count of nodes we can pick. Then backtrack to get all the picked nodes.

Also, is there any simpler solution than this?

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится +5 Проголосовать: не нравится

    I couldn't debug within time, but my approach was:

    Consider the usual directed edges (i, A[i]).

    If in-deg of a vertex = 0, then it cannot be circled. And so it's out-child has to be circled. And if we know that if a vertex is circled, it cannot circle its out-child, so decrease in-degree of its out-child (and if its in-deg becomes 0, mark it as not-circled, and push into the process-queue).

    Keep repeating the above two points, until you end up with no vertex with in-deg = 0. So, in-deg of all 'active vertices' >= 1 and we already know that out-deg = 1 for all. So, in-deg = out-deg = 1 for all active vertices. So it's just a bunch of cycles. Iff all cycles are even, there's a soln.

»
7 месяцев назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

How to solve D1C?

  • »
    »
    7 месяцев назад, # ^ |
    Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

    given graph is cycles with tentacles

    first — delete tentacles:

    if there is no edges to a[i] ("end of tentacle") — it shouldn't be chosen -> a[a[i]] should be chosen — remember, delete them, decrease in-edges count for a[a[a[i]]] do this while you can — you can keep vertices with 0 edges in the set and add them when some vertex becomes 0 in-edged

    ether everything is deleted or there is still untouched cycles

    if there is cycle with odd length — cout << "-1". You can understand this from a cycle of length 3

    if each cycle has even length — color them 1 0 1 0 1 0

    • »
      »
      »
      7 месяцев назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      There is answer even if there are cycles of odd length. Consider

      6
      1 2 1 1 2 3
      
      • »
        »
        »
        »
        7 месяцев назад, # ^ |
          Проголосовать: нравится +8 Проголосовать: не нравится

        After the first phase, everything would be deleted in this case. So there is no odd cycle.

  • »
    »
    7 месяцев назад, # ^ |
    Rev. 4   Проголосовать: нравится 0 Проголосовать: не нравится

    First of all we will try to identify what indices or elements are mandatory to come and what are mandatory to not to come. For this we can make a frequency array and if freq[x]==0 , x as an index can never come in p and because x can never come a[x] must come in uncircled elements and as an index too and a[a[x]] must not come as uncircled elements and so on .... considering all these facts, first of all we need to identify mandatory presence and absence.

    After this if there are any a[i]==i pairs or there are odd numberof indices left ans is -1 else an ans always exist.

    • »
      »
      »
      7 месяцев назад, # ^ |
      Rev. 3   Проголосовать: нравится 0 Проголосовать: не нравится

      Counter?

      6
      3 1 2 6 4 5
      
      • »
        »
        »
        »
        7 месяцев назад, # ^ |
          Проголосовать: нравится +3 Проголосовать: не нравится

        yeah while traversing odd cycles must be removed ... in haste i just checked the parity of the remaining nodes instead of individual cycles. Thanks for pointing it out.

        AC Code

»
7 месяцев назад, # |
  Проголосовать: нравится +15 Проголосовать: не нравится

In problem D the word indices should've been highlighted.. I wasted the entire time thinking that elements multiples of black elements will be colored green.

Spoiler
»
7 месяцев назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

How to solve Div 1 C? I knew that it can be reduced to coloring nodes in a directed graph (in which outdegree of every node is at most $$$1$$$) such that for every node $$$i$$$, if its color is $$$0$$$, then, it must have outdegree $$$1$$$ and its outgoing node must have color $$$1$$$, otherwise, if its color is $$$1$$$, then at least $$$1$$$ incoming node must exist that have color $$$0$$$.

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Yes, that's basically the solution. The only additional thing is that cycles have to be handled carefully.

    Process each component of the functional graph individually, for each hanging tree, do subtree dp ($$$dp_{u, 0}$$$ stores if its possible to not pick node $$$u$$$ after picking/not picking nodes from only its subtree and $$$dp_{u, 1}$$$ stores whether its possible to pick it). The transitions are the same as what you have written (its possible to not pick a node if all of its incoming edge nodes are picked, and possible to pick a node if atleast one of its incoming edge nodes are not picked).

    Now, we need to check if a valid set of choices for the nodes on a cycle exists.

    Pick any one node on the cycle to be the starting node. Fix the choice (not pick/pick) for this particular node, and go along the cycle, maintaining similar dp states (note that these dp states must take into account two things: the last node on the cycle, and the hanging subtree). The transitions are almost the same as when we find dp values for only hanging trees. Check whether there is a valid set of choices for both choices of the starting node.

    Finally, you can just store backlinks and find the unpicked nodes to get the final answer. Unfortunately, my implementation is cancerous and belongs on r/EyeBlech.

    • »
      »
      »
      7 месяцев назад, # ^ |
      Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

      I now watched the tutorial and realized that I'm soooooooooooooo stupid. I had the same logic of $$$99$$$% of the editorial ;-;

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

When can I see others's code?I want to know the solve of Problem D...

»
7 месяцев назад, # |
  Проголосовать: нравится +96 Проголосовать: не нравится

Weak samples are OK for ICPC problems, but absolutely disaster for CF.

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

When will the editorial be posted?

»
7 месяцев назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

.

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

div2 C is there any trick?

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

What is test 7 in Div 1 D :(

»
7 месяцев назад, # |
  Проголосовать: нравится -7 Проголосовать: не нравится

After solving Div2 D, I have a strong feeling that D can't be solved by 2000 people itself in Div2, maybe heavy cheating is going on i Think

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится +8 Проголосовать: не нравится

    True, I had the same feeling.. thought either I am missing some simple observation or most of the submissions are copied.

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится +11 Проголосовать: не нравится

    No, it was comparatively easier also today.

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Is there a randomized solution for D1C? I was choosing an index that was not circled in the answer, the probability of an index X to be that index is >=1/2 so with about 20 chooses I fill find such index. Then I was trying to make an answer for it greedily.

»
7 месяцев назад, # |
  Проголосовать: нравится +10 Проголосовать: не нравится

Interesting, but strange solutions for D1CD

»
7 месяцев назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

Can someone help me find out, what is wrong with this submission? Div 2B/ 1A: https://codeforces.com/contest/1877/submission/227185346

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    initial ans should be p, cause you must to talk to someone with prize p and you have (n-1) people left to talk

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Was dvi2E doable with 2sat or am i trolling?

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    My solution was like this:

    If we could find sush uncircled elements such that:

    1. for every uncircled element with value x there is circled element with index x

    2. for every circled element with index i there is uncircled element with value i

    Then it would be easy to find a solution

    We can also see that this conditions are neccesary Now we just need to add our conditions to 2sat We will have 2n variables Variables i, 1 <= i <= n will be : 0 — if we doesnt circle element with index i 1 — if we circle element with index i Variables i, n < i <= 2 * n will be:

    0 — if we circle all elements with value i

    1 — if we doesnt circle all elements with value i We can see that adding clauses is easy now

    • »
      »
      »
      7 месяцев назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      How do you express 2. condition with 2-sat clauses?

      • »
        »
        »
        »
        7 месяцев назад, # ^ |
        Rev. 7   Проголосовать: нравится 0 Проголосовать: не нравится

        When i is 1 it implies i + n is 1(it means that not every element with value i is circled)

        For n < i <= 2 * n

        i is 0 implies j is 1 for all j such that a[j] = i (every element with value i is circled)

        For 1 <= i <= n

        i is 0 implies i + n is 1 (if i is not circled then not every element with value i is circled)

»
7 месяцев назад, # |
Rev. 2   Проголосовать: нравится -13 Проголосовать: не нравится

Div. 1 C was a strange one, I couldn't find the edge case on which I failed...

»
7 месяцев назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

Why can't I submit a contest problem now? Is it always like this during system testing? I never tried before. I really want to submit 1E.

»
7 месяцев назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

It seems that the score distribution of Div. 1 and Div. 2 are accidentally reversed.

»
7 месяцев назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

The sample is too weak :(

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

aaa QAQ,i'm firstly loser!!!QAQQQQQQQQQQQQQQQQQQ

»
7 месяцев назад, # |
Rev. 3   Проголосовать: нравится -106 Проголосовать: не нравится

Totally not today's D.

Also it seems like that GfG post is only 3 weeks old lol (nvm, more like it's 6 years old)

If this problem actually appeared in the largest student-run IT event in Indonesia — that seems curious at the very least.

I am not saying that someone from the writers stole a problem, I'm wondering how nobody from the round organizers or the testers tried to google something like Sum of maximum elements of all subsets, that's literally the first search answer

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится +31 Проголосовать: не нравится

    The 2 problems are very different though. There are plenty of problems with sum of max element of all subsets, just tat the condition for the subsets are different

    • »
      »
      »
      7 месяцев назад, # ^ |
      Rev. 2   Проголосовать: нравится -46 Проголосовать: не нравится

      Everything is relative, but I can't agree with very different

      It's obvious that selecting an index $$$k$$$ is not worse than selecting any of the subsequent $$$kth$$$ indices, so for each $$$k$$$ we just update the value at that position with max of values on positions that are divisible by $$$k$$$ with $$$O(nlogn)$$$ time complexity (another way to notice this is to consider taking an index $$$1$$$).

      After this operation the problem is reduced to the one described in the article

      Personally for me the condition of the green and black elements felt more like a red herring

»
7 месяцев назад, # |
  Проголосовать: нравится -8 Проголосовать: не нравится

them bu l qua

»
7 месяцев назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

Can anyone please give a hack? I get WA on pretest 4 on problem 1C/2E

Edit: ignore my last sub please, try this

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Any one can elaborate there E approach like will it is related to functional graph kind of think?

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

why the name effects of anti-pimples for problem D??

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I was not able to submit solution for D while the contest was going on, It showed some error and then it started showing that "same code already has been submitted" So, I thought it will be considered but its not been considered in final standings and the solution was correct when I tried it after system testing.

What can be done about this ?

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

can anyone tell me what is wrong with my solution of the d problem in div 2 , 227195204

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    You haven't taken modulo within your binary exponentiation function. It's causing an overflow.

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    you have integer overflow in your binpow function since you aren't taking mod.

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Codeforces highlights your error with red line)) (need mod in binpow func)

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    ohh thanks guys actually in contest also it was giving wrong of test 4 so i was just losing my cool that's why i didn't see the error message on top

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Failed to Notice $$$0\le a_i$$$ in D2D, I let $$$a_i=0$$$ if $$$i\mid j$$$ and $$$a_j\ge a_i$$$, which is wrong as I couldn't count the correct number of indices. However, I passed pretest successfully. Why not make pretest stronger?

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

For Div2 C how to visualize and find formula for k = 2 and k = 3

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится
                    if(k==1){
                        System.out.println(1);
                    }else if(k==2){
                        if(m<n){
                            System.out.println(m);
                        }
                        else{
                            System.out.println(n+m/n-1);
                        }
                    }else if(k==3){
                        if(m<n){
                            System.out.println(0);
                        }else{
                            System.out.println(m-n-(m/n-1));
                        }
                    }
    
    • »
      »
      »
      7 месяцев назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      Thank you

      • »
        »
        »
        »
        7 месяцев назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

        I made a table for B, maybe you can take a look

        std::map<int, int> mp;
        for(int i = m; i >= 0; i--){
            std::set<int> st;
            int t = i;
            st.insert(t);
            for(int j = n; j > 0; --j){
                st.insert(t % j);
                t %= j;
            }
            mp[(int)st.size()]++;
            if(st.size() == k){
                std::cerr << i << '\n';
            }
        }
        for(auto x: mp){
            std::cout << x.first << " : " << x.second << '\n';
        }
»
7 месяцев назад, # |
Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

Video editorial for div2 — A, B, C and D with Code Walkthrough Youtube Video Link

»
7 месяцев назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

is it just me or does anyone feel like Codeforces is giving less rating points than previously for the same ranks

  • »
    »
    7 месяцев назад, # ^ |
    Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

    It depends on quantity and overall rating of participants. Also it depends on your current rating as well.

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится +1 Проголосовать: не нравится

    You get less rating increase for separated Div 1 and Div 2 rounds because candidate masters have to choose the Div 1 category as opposed to normal Div2, Educational, or Div1+Div2 combined rounds

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I didn't participated during the competition, so I participated in the Virtual Participation.

But I wonder why the number "265" appears so many times in the examples.

»
7 месяцев назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

Waiting for the editorial!!!!!!

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

As for the problem B in div2, my code got Pretests passed during the competition and got ac after the competition, But why does it show that I did not pass problem B ? Is there anything going wrong with the system?

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Thank all of you,this is a great contest!

»
7 месяцев назад, # |
  Проголосовать: нравится +28 Проголосовать: не нравится

I really like the problemset for this contest :). Thanks a lot to the authors, only complaint is maybe d1b is a little bit boring, but it's still fun. I think my favorite is d1c.

»
7 месяцев назад, # |
  Проголосовать: нравится -10 Проголосовать: не нравится

I think div2's E is like a shit, not only without useful examples, but also with a misleading example

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится -10 Проголосовать: не нравится

    Do you play Genshin impact bro.

    • »
      »
      »
      7 месяцев назад, # ^ |
        Проголосовать: нравится -13 Проголосовать: не нравится

      Yes,I do.Genshin Impact is an open-world adventure RPG developed by miHoYo. Set forth on a journey across a fantasy world called Teyvat. In this vast world, explore seven nations, meet a diverse cast of characters with unique personalities and abilities and fight powerful enemies together with them, all on the way during your quest to find your lost sibling and the hidden secret of this land.

»
7 месяцев назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

you can find number 265 in 1A's 1B's and 1D's test.

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

It was a good contest and I have learnt a lot of it and especially b and c were good problems

»
7 месяцев назад, # |
Rev. 3   Проголосовать: нравится 0 Проголосовать: не нравится

Attention! Your solution 227183020 for the problem 1877C significantly coincides with solutions 8vod/227158830, YuvrajSinghCharavande/227183020. Such a coincidence is a clear rules violation. i received this mail but the question is case based for 3 cases k=1,2,3 and greater i wrote it in the sequence k>3 for 0 ways and then outputs for the rest. i checked the codes submitted by others as well but i don’t see the complete resemblance also those accounts are far newer then mine. Also i would like to know why problems 1 and b are skipped as well.

»
5 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

how to approach the problem 3 in division 2 of this round??please help

»
5 месяцев назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

Tuk edisi tahun ini Anda akan dihubungi kalau sudah ada info lengkap