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

Автор wRabbits_AlMag, история, 5 лет назад, По-русски

Hi, all. There was an interesting problem from Codechef's August 19 Long challenge. In short, you are given vector k and vector c, and you have to find vector x, such that x1⋅k1+x2⋅k2+…+xN⋅kN=0. and √x1+c1+√x2+c2+√+…+√xN+cN is max (of course if every expression under a root is non-negative).

There have been great analytical solutions to this problem, and the editorial mentions approaches like using Cauchy-Schwarz Inequality and alike.

I have a feeling that the solution might represent something geometrical. Given the first equation, we can see that vectors x and k are perpendicular. I can't interpret the second expression in geometrical terms, but from drawing few examples, X seem to be parallel with the perpendicular, drawn from the point C to the vector K, with the length, multiplied by some number

In this picture N=2, K = OB, C = OC, the resulting X = OA. CD is the height, dropped from the C onto the vector OB, and the result is parallel to it, with some scaling factor.

If anyone can help me interpret vector X in geometric terms — i am very curious.

Полный текст и комментарии »

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

Автор wRabbits_AlMag, история, 5 лет назад, По-английски

Hi all. I recall there used to be a very useful tool for hosting local acm-like competitions — contester. However the link appears not to be working. In case someone knows an updated link, or knows about an alternative (preferably locally hosted, but any system where i can set problem statement and generated tests will work) — please share. Kudos from me.

Полный текст и комментарии »

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

Автор wRabbits_AlMag, история, 6 лет назад, По-русски

Some time ago I've picked up a habit of visiting comment section during system testing after a round. Too excited for the results to not step away from a computer — might as well, right? I'm not a big contributor, so keeping it low, mostly reading. Took me awhile to notice polarizing attitudes toward pretests, that varied from contest to contest. Especially if a good percentage of solutions that passed pretests — failed system tests. Big comment threads start to grow about pretests being weak. I wondered, what are pretests? Additional validation in between tests from the problem statement and system tests. They're kind of saying that your solution is demoable. Happy path is working. If everything is ideal, input is small, etc, your solution might be useful and give correct answers. But they don't mean that solution is acceptable (literally), thus not taking away the pleasant feeling of slight anxiety when you block your solution to hack roommates. It's a double win — additional validation to your logic, and not enough validation for everyone else, giving you chance to hack. So personally i'm thankful for them, and especially because this platform is the only major one that provides them. I get interested when I saw this is not the only attitude people share. How do you view pretests? Is the measure of failed solutions an indicator of weak pretests? What is the expectation from these kinds of tests?

Полный текст и комментарии »

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