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

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

(this is more of a vent post but if i'll read any suggestions in the comments)

For the last 6 months, I felt like I've had some horrendous luck/consistency with my contests:

Any extra advice on how to be more consistent in contests, besides from:

  • Doing virtual contests (last virtual contest I did was a while ago and I haven't had much time since).

  • Practicing problems of similar difficulty and tags to the problem that caused the bad performance (didn't make a big difference).

  • Being more relaxed during contests (didn't really make a difference either).

  • Get more sleep (I haven't noticed much of a difference).

  • Stop caring about rating (Would be nice but I doubt I can do that, at least not until i hit a specific rating).

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

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

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

GIven this problem:

Given $$$n$$$ integer pairs $$$a_i$$$, $$$b_i$$$, pick $$$k$$$ of them so that $$$\frac{\sum_{}^{}a_i}{\sum_{}^{}b_i}$$$ is maximized, output the maximum value.

Constraints:

$$$1 \le k \le n \le 200000$$$

$$$1 \le a_i, b_i \le 10^{6}$$$

I have this scuffed greedy algorithm which does the following:

  1. Assume the result is $$$\ge x$$$, then let $$$u_i = a_i - xb_i$$$

  2. Greedily pick the largest $$$k$$$ values of $$$u_i$$$.

  3. Update $$$x$$$ to the new optimal value, if the new value is not better then stop.

After a lot of random tests, the worst case only made it perform $$$7$$$ iterations.

Are there any tests that makes it TLE, or at least run a lot more than $$$7$$$ iterations? If not, is there a proof? What is the runtime in the worst case?

Code

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

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

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

So I'm changing my pfp every day for december (because it's cool or smth)

Obviously that'll mean 31 pfps and i have decided that i will let other people pick them.

So for every day, I will pick the highest upvoted reply that I haven't picked yet and set it as my profile picture, obviously with a few rules:

  1. Please no nsfw or offensive :prayer:
  2. Ideally you should send an image.
  3. If there are no more pfps to pick from then it will be a pick of mine.
  4. No duplicates unless it's interesting (and no you can't just change a single pixel and call it a new image)
  5. If it is heavily downvoted then it won't be picked. (somewhere below 10 downvotes?)
  6. Maximum of 2 pfps per person.

Also i might add more rules if someone tries to loophole (or if i forgot one because stupid) (please behave properly).

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

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