Tempe5t's blog

By Tempe5t, history, 13 months ago, In English

Hey,

As the contest had already ended more than a month ago, I've trying to find any OJ where it'd be possible to submit problems from InfO(1) Cup 2023, but I couldn't find any. Is there any online judge where it can be done?

Thanks in advance!

Full text and comments »

  • Vote: I like it
  • -4
  • Vote: I do not like it

By Tempe5t, history, 16 months ago, In English

Given a number $$$n$$$ find the number of its divisors not greater than given $$$k$$$ ($$$n$$$ can be even up to $$$9 * 10^{18}$$$).

This problem can be solved using some fast factorization algorithm (e.g. Pollard's rho) and then just generating every divisor not greater than $$$k$$$ (there are max $$$(9*10^{18})^{\frac{1}{3}} \approx 10^6$$$ divisors so it should be fast enough).

But, can it be done faster? (especially without iterating divisors?)

Also, is there some nice upper bound for the answer (except for the trivial number of divisors of highly composite numbers)?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By Tempe5t, history, 16 months ago, In English

Hey, I've been trying to solve the following problem and I have no idea how to go further.

You are given 2 weighted undirected trees $$$T_1$$$ and $$$T_2$$$ such that both trees have $$$n$$$ vertices. You have to find the pair of vertices $$$(v, u)$$$ such that the value of $$$f_1(v, u)+f_2(v, u)$$$ is minimal where $$$f_i(v, u)$$$ is the maximum weight on edge on the path from $$$v$$$ to $$$u$$$ in $$$i$$$-th tree (only output the minimal value, no need to output vertices).

$$$n \leq 10^6$$$ and $$$w_i \leq 10^9$$$ (where $$$w_i$$$ is weight on $$$i$$$-th edge)

I thought about converting those trees to Line trees and then doing some D&C but it doesn't seem to work and I have no idea how to go further. I'm rather looking for some hints than a whole solution. Thanks in advance!

Full text and comments »

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