Pa_sha's blog

By Pa_sha, history, 20 months ago, In English

Hello Codeforces!

I am pleased to invite you all to participate in Codeforces Round 970 (Div. 3), which will start on Sep/01/2024 17:35 (Moscow time).

The format of the event will be like any Div. 3 rounds:

  • 6-8 tasks;

  • ICPC rules with a penalty of 10 minutes for an incorrect submission;

  • 12-hour phase of open hacks after the end of the round (hacks do not give additional points)

  • after the end of the open hacking phase, all solutions will be tested on the updated set of tests, and the ratings recalculated

  • by default, only "trusted" participants are shown in the results table.

I encourage participants with a rating of 1600+ not to create new accounts but to participate unofficially.

Only trusted participants of the third division will be included in the official standings table. This is a forced measure for combating unsporting behavior. To qualify as a trusted participant of the third division, you must:

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

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

Also, it will be the first round with unrated register. If you already registered as rated participant you can change registration type here.

I would like to thank

Good luck!

UPD:

Editorial has been published.

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

| Write comment?
»
20 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

Good luck to everyone! How were you able to set a round as a specialist though?

»
20 months ago, hide # |
 
Vote: I like it +34 Vote: I do not like it

as a tester give me contribution

»
20 months ago, hide # |
 
Vote: I like it -69 Vote: I do not like it

As a tester, I cried because how beautiful the problems are

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

Unrated registration! Too bad I can't test that when I'm usually a rated participant! (since I'm >=1600)

»
20 months ago, hide # |
 
Vote: I like it -23 Vote: I do not like it

qp

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

Will not be able to give this contest :( as I have to travel to college tomorrow at same time.

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

my first unrated div3 :O

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

I have a question — youre only a specialist but you are able to make a content. I have heard that you have to be a master to be able to do that. Can someone explain?

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

As a tester, the problems were great! GL everyone

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

as a tester I hope that yall have fun in this contest!

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

experts who registered as specialists wya

darn they put me out of competition

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

I once again hope I can AK this round ^_^. Good luck to you all as well!

»
20 months ago, hide # |
 
Vote: I like it +21 Vote: I do not like it

Interesting fact, this round is rated for the author. As a tester, I encourage him to participate and get $$$\infty$$$ delta.

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

Return expert?

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

I'm back

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

First time participating unofficially, hope the problems will be good, and good luck to other contestants! ^^

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

Oh god give me power to solve atleast 2 + questions this time :) I love you all who ever reading it

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

Good luck and have fun! I am goona up to pupil

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

i hope i dont drop to newbiew

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

I am very much excited for today's contest, but as usual, more than 2000 cheaters are also ready

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

I am hoping for a positive delta and changing the color of my username

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

This Div3G is like div4D lol

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

Don't just change the problem statement mid contest,who tested this?

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

Are points reduced for compilation error also on submission. I forgot to select the correct language before uploading in 2 questions. :(

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

Problem F really made me angry thought about it over and over again with no conclusion, the third testcase did not make sense and I just can't think straight anymore from the anger I had of this failure. is the modulo increasing the result somehow? I just don't remember modulo could do something like this, am i missing something about probability? wish I started with other problem I would have had the chance probably. I got the same result for testcase 1 and 2 from the solution, but the third one made me want to throw my laptop

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

    It is not increasing it, the answer for the third testcase is a fraction so it is the $$$numerator \cdot modular inverse(denominator) (mod 10^{9} + 7)$$$.

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

    $$$\big(a\cdot b^{-1}\big)\bmod p = \big(a\cdot b^{p-2}\big)\bmod p$$$ for prime $$$p$$$.

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

    You can check this blog about modular arifmetic. Particulary, about modular division, which is pretty common.

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

Problem F be like:

C++: Wrong Answer on test 4

Python: Accepted

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

is my solution for E hackeable?

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

Can someone simplify on what needs to be done in Problem F Sakurako's Box please.

  • »
    »
    20 months ago, hide # ^ |
    Rev. 3  
    Vote: I like it +1 Vote: I do not like it

    answer = $$$\sum_{i = 1}^{n} \sum_{j = i + 1}^{n} \frac{2 \cdot a_i \cdot a_j}{n \cdot (n - 1)}$$$

    modulo $$$10^9 + 7$$$ of course.

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

    There are $$$\frac{n(n - 1)}{2}$$$ possible pairs. Since we want to obtain the expected value, we know that we want to multiply the product of each pair by its probability. Clearly, each pair $$$(a_i, a_j)\, /\, i \lt j$$$ has the same probability of occurring. This means that the probability of each pair is $$$p = \frac{1}{\frac{n(n - 1)}{2}}$$$. Now then, we can see that the final result will have the form $$$pa_1a_2 + pa_1a_3 + ...$$$. So, we can extract the $$$p$$$s and obtain $$$p(a_1a_2 + a_1a_3 + ...)$$$. Here, we know what $$$Q = p^{-1}$$$. At this stage, you must choose a method to calculate $$$Q^{-1} \mod 10^9 + 7$$$. This can be achieved by any number of methods using the modular multiplicative inverse. The value obtained from this we will multiply with the calculated value of the numerator $$$P$$$ to obtain the final result.

    On the other hand, we must find a way to efficiently calculate $$$a_1a_2 + a_1a_3 + ...$$$. This can be done by simply calculating $$$s = \sum_{j = 1}^{i - 1}$$$ and adding $$$sa_i$$$ to the numerator for each $$$2 \leq i \leq n$$$.

    Hope this helps.

    PS: Please do be careful with the modulos.

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

    Both (.-__-. and fisher199) your comments were helpful, and I have solved that problem. Thank you.

»
20 months ago, hide # |
 
Vote: I like it +17 Vote: I do not like it
»
20 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

why none of testers tried to check if F is solvable by chat-GPT ?

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

    Why are you using Chat-GPT during the contest? What is even the point of solving a problem with GPT?

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

      first of all, its the author's fault to not check if it's solvable by gpt or not, i can imagine that at least half of the submissions were made by the help of chat GPT (6k is a lot for a typical Div3 F)

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

        F was set way too high IMO. It was easier than both D and E.

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

    imagine using ChatGPT. using it should be banned because it can sometimes solve template problems regardless of their difficulty.

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

couldn't implement G although exactly know what I'm going to do

Spoiler

this can be done by binary search right? 😭

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

    for n>1, you can set the array to 0, gcd, 2*gcd, 3*gcd, ..., (n-1)*gcd. I believe this will be enough for you to be able to solve it now.

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

    Not quite. Compute gcd, let it be G. Then you can always make the array to be of the form 0, G, 2G, 3G ... (n - 1)G. Then finding the kth MEX is O(N).

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

      Damn, I had no idea how to solve G. How did you notice the GCD?

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

        read how to find GCD using euclidean algorithm

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

        Actually fun fact. This is very similar to the most recent Div 2C, which has a quite similar use of the GCD concept. I immediately thought of using GCD because of how recent that problem was.

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

          In fact, G was made before it, so I didn't take it's idea. But yeah, it is somehow similar.

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

          Funnily enough I solved it in contest.

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

          I got the idea almost at once thanks to this problem.

      • »
        »
        »
        »
        20 months ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it
        1. find smallest positive integer x out of set of integer

        2. allow to add and subtract each other unlimited times. gcd naturally comes into mind.

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

F was easier than D/E lol.

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

what is the idea for E when n%2 !=0 ?

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

    Iterate over each letter to remove and maintain a count of each character at even and odd positions. Notice that the removal of a character will flip the parities of indices in front of it.

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

    I just iterated from 1 to n and checked if i delete the current element in string , how many operations would i need to do in order to obtain alternating string and stored minimum of all those operations . For doing it in time limit , I stored the count of occurence of alphabets at odd and even positions at each index.

    You can check this out , there may be better approaches but this came to me

    https://mirror.codeforces.com/contest/2008/submission/279203992

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

    To calculate the number of operations required for an arbitrary string s, you need to find the maximum count of a character at odd indices and another count for even indices, then subtract both from the size of the string, because that's how many characters you need to change. Also, notice how removing a character at some index i flips the parity of all characters in front. Moreover, if you remove a character at index i and flip the parity of a character at index i+1, then that character will have the same parity for the removals of characters at indices < i. Knowing this, going down from i=n while i>=0 you only need to update the counts related to the characters at index i and i+1, where s[i] is the removed character

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

    We will try removing ith character for all $$$ i $$$ such that $$$ 1 \lt = i \lt = n $$$. with some precomputation, at each $$$ i $$$ we can calculate the most frequent character at even positions and odd positions in $$$ pref_{0\cdot\cdot\cdot i-1} $$$. You can do the same for $$$suff_{i+1 \cdot\cdot\cdot n} $$$. During the precomputation you can also store the characters which occur the most in prefixes and suffixes respectively. Then it is easy to observe that whatever balanced string we'll have will contain either of the 4 characters we just stored (most frequent even from prefix, most frequent odd from suffix) and (most frequent odd from prefix, most frequent even from suffix). (After writing some cases you can observe that after the removal $$$ith$$$ character, the parities of suffix flip). and that's it. you can check my submission

    I couldn't get AC during the contest but I just had to add ans = 1e8. feeling super sad rn :(

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

Was G somewhere related to gcd of whole array if yes then why my solution is giving wrong

if no please help me in solving it

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

Could someone please identify what is overflowing in my F solutions?

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

    Probably this line:

    for(int i = 0; i < n - 1; i++) sum += ( a[i] * prefixSum[i + 1] );
    
»
20 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

explain why people use prefix sum to solve H please :(

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

    That's a very standard trick. It even appeared in a recent CF Problem : Med-imize.

    I added more details here

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

    I precalculated the answer for each x by binary search. Since $$$a_i \leq n$$$, each x splits the numbers int $$$\frac{n}{x}$$$ patterns of $$$0, 1, 2, ..., x - 1, x$$$, I used prefix sums to avoid iterating over that.

    My submission: 279218027

    Time complexity: $$$O(n log^2{n})$$$

»
20 months ago, hide # |
 
Vote: I like it +7 Vote: I do not like it

wonderful set of problems! i managed to do my first two problems :)

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

This is my best CF round — I am top 2000!!!

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

Will you release an Editorial/Tutorial?

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

neal Congrats for actual Rank 1!

Funny how even the top 10 in ranklist people cannot code G correctly.... authors, testers do better. Wrong models really shouldnt be happening.

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

Here is my solution link, written in Simplified Chinese.

The solution of G before constrain modification is included.

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

Am I the only one stucking at implement of E?

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

I believe my first solution for H is hackable. I imagine O(n^2) in the worst case, but it's hard to analyze the complexity.

If someone is interested in hacking, take it)

Basically instead of doing a binary search I'm trying to calculate current result as +1/-1 from the prev result (in the loop). So if we have tests where the result sequence is 0->n->0... then my solution is quadratic.

https://mirror.codeforces.com/contest/2008/submission/279227245

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

The problemset needs to be rearranged, C<B F<D&E!!

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

    The hard part about problem C is proving the simplest solution runs without the risk of TLE. Which I think not many people did.

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

this could be as easy as a div4, anyway good contest

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

From my deepest point in my heart i hate cheaters

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

https://mirror.codeforces.com/contest/2008/submission/279214387

Does it help to not get banned? =)))

int someIrrelevantFunction(int someParameter) {
    return someParameter * 2;
}
»
20 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Someone help me. I don't understand codeforces at all. I don't understand divisions, ratings, trusted players, unrated contestant....I read some cf articles.

First time participated in this Div 3 contest, solved like 3 problems(A,B,C). Why still it shows unrated player?

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

please explain how you got this answer to test 3 from example in F. Why 8 isnt the answer?

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

    i mean there's a whole paragraph telling you to take the answer modulo M. basically when you divide two numbers, you will multiply by the denominator's mod inverse. which is equal to X^(MOD-2)

  • »
    »
    20 months ago, hide # ^ |
    Rev. 7  
    Vote: I like it 0 Vote: I do not like it

    The sum (numerator) is $$$85$$$ while the denominator is $$$10$$$.

    $$$85/10$$$ is $$$8.5$$$, not $$$8$$$

    here you are required to print the answer to the mod of $$$10^9 + 7$$$ Since you can't use mod on a float value, you need to use mod inverse.

    note that $$$ (a / b) \% m \neq (a \% m) / (b \% m)$$$

    instead

    $$$(a / b) \% m = (a \% m) * (b^{-1}) \% m$$$, here $$$b^{-1}$$$ denotes the mod inverse of $$$b$$$.

    To calculate the mod inverse of a number $$$b$$$ for the mod of $$$m$$$ you can use this formula:

    $$$(b ^ {m - 2}) \% m$$$

    This can be calculated efficiently in $$$O(log(m))$$$ using binary exponentiation

    This only works if the mod is prime

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

I know that pE is only prefix sum with odd/even index. But, I don't know how to write it efficiently. My sol is fucking LONG and still having some bugs.

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

Do I get a penalty for wrong submission on the problem which was not finally accepted

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

Though I wasn't cloudflared during the contest, I still spent more time loading pages than solving problem in ABCD. Perhaps I need to open all problem pages next time.

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

Is this solution to B fine? https://mirror.codeforces.com/contest/2008/submission/279237030

Lol I missed this condition during contest — R = C = sqrt(n)

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

In problem B, since the string is always made from a perfect binary matrix, is it sufficient to check if the count of ones equals to 4 * (r — 1)?

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

This submission is failing on some test case. Problem G

https://mirror.codeforces.com/contest/2008/submission/279239206

Can anyone tell me why this is happening.

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

TL for G is actually insane, how is this TLE? 279241104

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

    It has an integer overflow, because r is initialized with unnecessarily large number.

    Suppose $$$k=10^9$$$ and you have some distinct elements, then the answer is obviously larger than $$$10^9$$$. in this case, when mid is 1E9, good(mid) will return true, and therefore l becomes 1E9. Because r is still 2E9, (l + r) overflows.

    See the fixed version: 279244131.

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

How can I delete a comment?

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

hope Cheaters will be identified....

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

performed very bad :( should have taken mod of q also

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

279181406

Can some one please highlight the error in this solution?

I used this formula (Numer/Denom) where,

Numer = sum of (A[i]*(sum(A)-A[i])); for i=1 to n;

Denom = n*(n-1);

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

    n * (n-1) can overflow before it's modded

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

      That's not the case since I use #int long long

      Anyways I got my silly error:

      In my code, Correct:

      int val = (A[i]*((cSum[n]-A[i]+MOD)%MOD)+MOD)%MOD;

      Wrong:

      int val = (A[i]*(cSum[n]-A[i])+MOD)%MOD;

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

Can anyone please tell me why this solution gives tle and this one does not?
In the first one (for the reason I can't understand), instead of counting the numbers in the range [a,b],I pushed all those number in a vector and printed the size of that vector.

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

    vector push_back needs to resize the whole vector occasionally, but it all adds up into the time taken to run the whole program

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

      Thanks man but can you explain it in a bit detail if it's okay for you!

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

        Sure, you can check the Complexity of push_back in this link

        It says Constant (amortized time, reallocation may happen). If a reallocation happens, the reallocation is itself up to linear in the entire size.

        So that's exactly what happen. You can avoid that reallocation by using the .reserve() function to allocate upfront, or the best thing to do in this case is just not using a vector at all.

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

Prefixforces

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

any one has idea how to solve E with dp I don't get how it's tagged as dp

»
20 months ago, hide # |
Rev. 2  
Vote: I like it +22 Vote: I do not like it

Here is some feedback from me. The issue on G was unfortunate, but it can't be helped. However, even without that, I think some problems were also a bit too typical and some things could have been improved.

  • A: The problem itself is okay, but the constraint is a little sad. It could make it more obvious that $$$2^{a+b}$$$ solutions could pass or shall not pass. Most of the hacks on A are about such bruteforce solutions.
  • B: If I remember correctly the description of squared wasn't very clear initially without the last sentence.
  • C: The optimal strategy to make longest array, and that only $$$r-l$$$ matters is too obvious and trivial. The problem could've added something more than that.
  • D, F: These problems were way too typical even for a Div. 3, and don't really require anything other than the basic required algorithm itself. I think problems that only ask whether they know a specific technique or not should be avoided in a rated round.
  • H: Honestly I see no reason for this to be a query problem that allows duplicated queries. There is no point in giving the same query multiple times, and saving the answer is tedious while it leads to huge boost in execution speed in the worst case for many kinds of solutions (but hard to prove the complexity). It could've been more clean to just make it print all answers from $$$x=1$$$ to $$$x=n$$$.
  • »
    »
    20 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Hello can you hack my H which ig has tc of O(n(logn)^3)

    279221504

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

    Hi. Thanks for the feedback. I appreciate it and I will consider it in the next contests. Here is what I can say about some of this:

    • A: There is a rule for Div3 that constrains in the first task should be small. I think it is made for solution like $$$2^{a+b}$$$ to pass, for the programmers who only start competetive programming.

    • D,F: I think you are right, but here is reasons I put it in the contest. There is not a lot of tasks, where expected value or dividing permutation on cycle are in a some simple way, so when I first saw task expected value it was to hard for me even with tutorial. So, I wanted some more easier tasks to be here on at least some topics. I understand that there is a lot of sites, books where you can learn this, but when I was only starting CP I didn't know any of that.

    • H: To be honest, I thought about it, but here is reasons I didn't want to do these version:

      1. It seams like a good hint for this solution.
      1. If you will try to brute force in this version (in a way $$$\frac{n}{x}\cdot log(n)$$$) for each number you can get AC without even understanding the solution.
    • This is why there is queries.

    One more time thanks for your feedback. I don't have anything to say about B and C, because probably you are right.

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

      I can see your reasons behind the other things, but I still don't get about A. If that was your intention, then the constraints should have been even lower, because many $$$2^{a+b}$$$ did NOT actually pass and got hacked or FST. It could've been also done by guaranteeing distinct test cases, but even that was not the case.

      So the only reason I can think why it's so small is just because it's a 4A problem, and I've seen this quite a few times on other Div. 4/3 A problems. It really feels like these constraints are not decided based on actual solutions that it wants / doesn't want to pass, and rather just want to be 'somewhat small'. I understand why the coordinators want to include every possible case in one test, but I honestly don't see why the number of test cases cannot be something like $$$1000$$$ in these problems with larger constraints. The only thing it would do is to take just tens of milliseconds more for any viable solution that is not exponential. If they actually intended to allow any viable exponential solution, then the constraint should be like only 1 digit. For now they're neither of these cases.

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

I have registered as rated in this content but still my rating has not changed in it.

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

Can anyone tell me why this code get WA in B?

1.n must be a square number, like 4,9,16,... 2-(1) n=4 will be yes. 2-(2) n>4, if s contain '0' will be yes, otherwise no.

Any bug in this logic?

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
 
    int T;
    cin>>T;
    while(T--)
    {
        int n;
        string s;
        cin>>n>>s;
        int k=sqrt(n), cnt=0;
        for(auto &c: s)
            cnt += (c=='0');
        if(n!=k*k)
            cout<<"NO\n";
        else
        {
            if(cnt || n<=4)
                cout<<"YES\n";
            else
                cout<<"NO\n";
        }
    }
}
»
20 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I submitted solutions for 6 out of 8 problems, and now it shows that only the 1st is accepted, and the rest are in red or in the queue.

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

    That's because System Testing is currently going on. Wait for it to get over and you're attempts will be back to normal.

  • »
    »
    20 months ago, hide # ^ |
    Rev. 3  
    Vote: I like it +1 Vote: I do not like it

    at first I was so amazed by the fact that its you first contest and you submitted 6/8 problems kinda cool. then I wanted to look your submission and when I saw you submissions of problem A, you took two inputs in array (alright great for beginner) but then your submissions got drastically changed with maturity of variable selection and formatting. I was having mixed thoughts in my mind until I looked at E's Submission and I got reminded of a random comment. Well you know I know what I am talking about but CF is all about fun, please enjoy!

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

When do we get our rating score at Codeforces Round Div 3?

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

Moderators I would like to report this guy almighty_xd with submission of E 279219069 . Vladosiya Pa_sha

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

Why the rating changes are so low? can someone explain if they know?

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

So lucky to have E passed in 1999 ms. 279208099

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

Can someone please tell me whats the problem with my solution for Problem F?

https://mirror.codeforces.com/contest/2008/submission/279375562

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

For problem B I can't understand how just count of 1s equal to perimeter condition is passing all tests 279233678. For s = 111111110 the above approach should say it is a beautiful matrix but the representation doesn't look like that.

matrix representation of 111111110
  • »
    »
    20 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Lol yeah, that solution doesn't look correct. Very interesting that it passed.

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

Guessed dufficulty

A — 800

B — 1000

C — 900

D — 1300

E — 1700

F — 1600

G — 2000

H — 2200