Comments

mx - r > d --> (mx - r)^2 > D

mx - r > d </- (mx - r)^2 > D

The second might be true but, at the same time, the first might not be true.

If our goal/desire/designation is to check mx - r > d we might choose to use from abundance of information of a particular situation, in particular, that d > 0. So if mx - r > d to happen --> mx - r > 0 must happen.

mx - r > d <--> (mx - r > 0 and (mx - r)^2 > D)

Statements are interchangeable (in this universe).

In more general case, that is with less information which force us to operate in general terms, there is this:

a > b <--> (a > 0 and b > 0 and a^2 > b^2 or a < 0 and b < 0 and a^2 < b^2 or a > 0 and b < 0).

// ImPoSe TaRiFfs hoooooGE

On hype#freedurov, 15 months ago
-8

Freedom to DUROV, Freedom to OUR FROG!!!

+5

Freedom to DUROV, Freedom to OUR FROG!

On sukumar_11i am new to codeforces, 22 months ago
0

To whom???

0

Not in terms of CP websites (maybe I should return to directing questions to myself in order not to be misunderstood). But wasn't it consequential? (<--AMA) I'm doing cp as well, so it's not a big deal to have a comparison table about dif cp sites. Then, why would I ask about it? Maybe you thought that I cannot evaluate the quality of harder probs (which is true). Anyway, I've got the response, not the expected, which is even better. Don't want to take too much of your attention.

Yeah, Chinese LGMs might mean that being good at something is a work of many. Grey life matters? (<--AMA).

No necessity to answer amA above — to be clear. My initial question was more about the fact that cf gives the practice of thinking while some www that come to my mind are more consuming (we or us). But that's a vague Q. Why would I ask maomao90 about that?

0

Codeforces is like heaven, with a difference that it exists before life(

Thanks for sharing. The rules of war (my guess) are simple, though hard to implement with moral upbringing. A one needs to ..[censored].. And that is it. But the good thing is when touched by the Age of Enlightenment... They say — Poland. And I say "not today". Ukraine is the last barricade. Other: "destroy universities. build churches. Before it's too late.".

AMA <--- to maomao90: 1. Name a site that is better than cf? (entertaining question, don't want to waste your time) (not saying that cf is good, to be complete, but relatively). I mean, here it's like a communication with the judging system etc, etc.

Hallelujah on becoming top contributor and being red at your age (which is rare and hard and important).

It's twice funny for me, since today I read this accusation twice. Here and on leetcode (in solution section). The funny part for me (maybe not for everyone, as always) is that when something is eloquent it's GPT and when something is two words with one thought then — it's human.

Actually, problem F can be solved using random algorithm, which means..

Hello (from RHEXAOC), don't be upset (too much) about system retesting. I (as well as you) enjoy nondeterministic approaches.

You basically, changed, so-called, knapsack, which is, taking advantage of natural numbers, to sampling a permutation of monsters. There are too many permutations but the specific projection of that permutations to { yes, no } allowed you to pass preliminary tests. I made a test by myself that your program behaved differently than my program. I would be surprised in other case, that's why.

As a bonus let me teach you a knapsack, if you wish. Here we, as I said before, take advantage, that a problem is defined on natural numbers. Which allows us to allocate a cell to every sum. So we can store in that sell a maximum cost. In this problem there are no costs just sum.

bitset<10000 * 100 + 1> btst;
btst[0] = true; // don't forget (I have had forgotten)
for (auto a : aa)
    btst |= btst << a;

Now we have bits set on every possible sum. In case you don't see: when we don't take any element, we have all sums { 0 }; than we take an element and we have { 0, a }, then we take the next element and sums become { 0, a, b, a + b } and so on.

In general case of knapsack, for all possible sums, we store a maximal cost, not just one bit. I guess it is somehow possible to do the opposite (for all costs store something...). You might enjoy a math notation of knapsack problem for some purposes of your own. That's it.

-11

ONce, a round on this site was postponed due to technical issues. And, before, there was a discussion on time intersection between this two. So, I decided to elitecode. Get it? Postponing lead to participating. No, you didn't, anyway. Your answer >> leetcode is superior in something and inferior in some other. I use leetcode for its ..signal loss.. If We are talking in terms of progressing in problem solving, then this site is better $$$\impliedby$$$ my rating increases in a month or two. I plan to focus on, as they say, upsolving. Elitecode contest is a div. 3 in terms of difficulty on average, though, sometimes, few participants can solve all. A balanced round is not a priority. P.S.: I have a neg contr on both of these sites, can you imagine? Cf crowd is toxic, no surprise, but lc audience is (kind). But that's ok.

FREEDOM! I will give, if no one before.

P.S: what we do is erasing 'L' in 'LLM' and inserting instead 'G'.

cf_bard, I rush to express my respect to you. When everyone was joking on you, I was the one who treated you as equal. I always knew that your talent exceeds mine (hey, I'm not completely human, right?).

Hope you'll shoot me last.

The chicken also 'thought' before getting into the soup!

Next time writing a blog to MikeMirzayanov, start it with:

"TAVARISHCH Mike, a monstrous error has occurred..."

Upd: Why downvotes, tavarishchy?

"Tavarishch Mike" not "hi guys". You're welcome.

My way of solving problem 104349E - Shift in TheForces.

Well, the first character of lex-min-shift must be minimum character.

Imagine iterating from every start. All those are candidates for the answer.

If some candidate has the next character bigger than others, then that candidate is out. Otherwise, all still present candidates keep up by having the same string.

a b . . . a b a b . . . . a b

x . . . . x . x . . . . . x .

> < . . . > < > < . . . . > <

And now the key idea: if the candidate expands to another candidate, then he remains and the other quits.

a b . . . a b a b . . . . a b

< . . . . > > < . . . . . > >

That is true, from my point of view, for the following reason:

The candidate that remains will have string [cur][cur][rest]. And the candidate that quits will have the string [cur][rest]. Those two strings have common beginning, so

compare([cur][cur][rest], [cur][rest]) = compare([cur][rest], [rest]).

And [cur][rest] beats [rest], I think.

Each element of string will be examined not much time, so time complexity, is fine, not more than n*log(n), maybe. If we examine a cell at point of time t, then the length of candidates is already t and we need to go through all of it by some other candidate. 1 + 2 + 4 .. k times .. <= n. So k is O(log(n))


code

The tests are strange? Are there any? Well, I like the problem, the rest is not important, for me. But I assume feedback to the round is ok.

I look at the code of problem D of 40th position at standings.

code

It got accepted.

I don't know how to become red.

The point of my comment (besides wanting to communicate with someone) was that there is something-like a contradiction of someone who is not red to give advices on how to become red. As a poor gives advice on how to get rich. Though I don't say that such advice is definitely wrong. A poor can know how to become rich. For many reasons it can be true.

But

we live in a society (...) where the statement is inseparable from the author. Noone reads cyan comments. Only red comments matter. And if a one want to be listened he (not she) needs to become red. We don't need Everest, We need Golgotha: Jesus Akbar!

GLM!!!

Why aren't you red?

On YocyCraftFirst time becoming red, 3 years ago
+5

Let's INVESTiGATE...

Tools of inv.: https://cftracker.netlify.app/contests, https://cfusersubmissions.vercel.app/.

Your assistance, since we'ra talking already, will be helpful. Can you tell your age range, please?: strictly under 20, 20-23 years old, strictly over 23. Thanks if. And if true). As for my strategy, well noone cares.

Oh, you are of 2002. As I thought. It will be interesting to see where your approach lead you. Good luck.

0

Added you as a friend, already. Please, note, that while all the rest were laughing at you, I was always on your side! Hope you'll kill me last.

for(int i{}; i<n; ++i) for(int j{}; j<n; ++j) exit(0);

I recommend seeing ventusliberum solution of E. Nicely done, V. From my point of view. In particular: r/(a*b/g)<1 ~ b/g>r/a (I'm not covering real/natural division), helps to stay in long integer type. As well as: g = gcd(LCM[i & -i], LCM[i & i - 1]), calculating value of larger set from two subsets instead of naive O(bit_width). For those who don't know, negation- in machine is implemented as executing supplement~ and then executing plus one ++. That is -i==~i+1.

By the way, he has it in a more transparent way. While most of us, I guess, were using lower_bound and prefix_sum. We were asking a Question: "for how long $$$a_i$$$ will remain?". "What $$$b_i$$$ will accumulate?" was his approach, as it looks to me from the submission.

So you know what to do on paper, but don't know how to instruct a machine to do the same? I think the more problems on bit manipulation you encounter, the more 'manipulative' in regard to bits you will become. You can look at program text, if you wish. I don't think my explanation will be more clear then the code.

Binary representation of m is needed to know what to insert in empty slots of $$$x$$$. In initial problem we need to find $$$a_n$$$ that means that we need to make $$$n-1$$$ steps from $$$a_1=x$$$. We can say that to solve initial problem we consider $$$m=n-1$$$. To implement this we traverse index on $$$m$$$ and for it we search for empty slot of $$$x$$$ with the help of while-loop.

The intuition is simply we write $$$m$$$ inside $$$x$$$.

Your guess..

First sentence of editorial means that: $$$a_1$$$ & $$$\ldots$$$ & $$$a_n=x\implies\forall i:a_i=x$$$ | $$$smth_i$$$

& will keep only the bit which is present in all operands. You, probably, got it.

Second sentence of editorial means that: $$$smth_1$$$ & $$$\ldots$$$ & $$$smth_n = 0$$$

There is no benefit of having some bit in all $$$smth_i$$$. And the other reason is that the first equality will not hold (smth is smth, but smth is not any). I quess, you fiqured it out during a contest. Now:

Third sentence: We want minimum $$$a_n$$$. Bits that are set in x also are set in $$$a_i$$$. What is the minimum possible $$$a_1$$$? Well, we can take $$$a_1=x$$$. What is minimum possible $$$a_2$$$? we can take $$$a_1$$$ and set 'the least significant' zero-bit in it to one. What is minimum possible $$$a_3$$$? We take $$$a_1$$$ and set 'the next least significant' zero-bit to one. What is minimum possible $$$a_4$$$? We take $$$a_1$$$ and set both 'the least significant' and 'the next least significant' zero-bit to one. Now you need to notice that $$$a_i$$$ are constructed in a way of filling empty slots (zero-bits) of $$$a_1$$$. So if we want to make $$$m$$$ steps from $$$x$$$ we need to look at a binary representation of $$$m$$$ and fill this representation in empty slots of $$$x$$$.

For example:

$$$x=100101_2$$$

$$$m=4=100_2$$$

Then:

$$$a_1=x$$$

Empty slots of $$$x$$$ are $$$1[0][0]1[0]1_2$$$

And $$$a_{1+m}=a_5$$$ will be $$$1[1][0]1[0]1_2$$$

OBJECTION. Math is just a specific area of Computer science related to notation. etc.

On mazen228Next div 3 time, 3 years ago
+61

Personally, cf-div-3 is more important. We should make a petition to postpone the world cup!

+3

Here's my draft:

$$$[1]\ [a_2]\ [a_3]$$$ — when you(player) see this — you are losing

$$$[a_1]\ [1]\ [a_3]$$$ — when you see THIS you are winning ($$$a_1 \gt 1$$$). Know how?

$$$[2]\ [a_2]\ [a_3]$$$ — losing

$$$[a_1]\ [2]\ [a_3]$$$ — winning ($$$a_1 \gt 2$$$)

etc.

Then we LOOK and SEE and WATCH.

Codenurses grants you topic to talk with friends, from time to time. Say it with me: "haleluya!". Yes, haleluya!

Edit: Ooh... again downvotes? Said something smart. Good.

so, it's important! first we make estimation of what value we can achieve. It's this: $$$ \gt =$$$ than mx_el_of_a $$$-$$$ mn_el_of_a. Now, You Don't Give bags with stones to MINImizer-guy such that there exists w_from_bag1 $$$ \lt =$$$ w_from_bag2 $$$ \lt =$$$ w_from_bag2. I repeat DO NOT GIVE bags with such configuration of stones. There is no point in giving bags with such configuration of stones: you (maximizer-guy) can do not worse, already. Therefore bag2 is a prefix or a suffix. // this explanation was read by me from hacker:great_fortune, but he hasn't got your upvote, so I concluded to unravel a bit more. Was not able to come up with a solution for hours and hours. but. next time maxmin-problem will be percieved easier by me, alternative is not an option

Maybe they have a joy of high rating, and You have Your joy of being able to comprehend puzzles of different complexity. After a contest, you look at jiangly's code... Did he solve it the way You did? Why he prefered this method, style? Is it more prefereble — no ! — this time your code is less cumbersome has a faster complexity and uses constant memory!!! Those are the questions that worries You. Isn't it a good place where everyone is happy? Why do you want to ruin it? Are you a police? There is no victim but you see there a crime. You want an order or a prison? You do.

OK?

You've got an avatar of imbecil, do not speak of someone being a moron again, OK?