### Xaxixin's blog

By Xaxixin, history, 2 months ago,

• +1037

By Xaxixin, history, 8 months ago,

When it comes to writing a ternary search, what you usually do is this:

repeat 30/60/100/200 times {
double lm = l + (r - l) / 3;
double rm = r - (r - l) / 3;
if (f(lm) < f(rm))
r = rm;
else
l = lm;
}


Sources (notice the authors): 154861075 154863973

I recommend everyone who still writes like this to read this article . It will improve your ability to fit nested ternary searches. Also, I hope I don't need to explain why it is strictly better than the shown code.

Please, refrain from writing in the comments "but still their code works and is accepted!!1!".

• -67

By Xaxixin, history, 11 months ago,

In an upcoming job interview, I am going to present myself as an exceptional candidate. The question is: how to explain to the recruiter that winning SWERC and solving 1662K - Pandemic Restrictions without receiving any penalties makes me an outstanding engineer?

the recruiter is from the 30u30 Forbes list btw

• +26

By Xaxixin, history, 12 months ago,
1. A straight line may be drawn between any two points.
2. Any terminated straight line may be extended indefinitely.
3. A circle may be drawn with any given point as center and any given radius.
4. All right angles are equal.
5. If two straight lines in a plane are met by another line, and if the sum of the internal angles on one side is less than two right angles, then the straight lines will meet if extended sufficiently on the side on which the sum of the angles is less than two right angles.

• +119

By Xaxixin, history, 12 months ago,