UVa Online Judge

UVa 294: Divisors

UVa 294: Divisors

In UVa 294, Divisors, we are asked to find the number with the maximum number of divisors in a given range. Counting number of divisors is a classic problem, and there exists a fast and simple way to do it. We start off with a straight-forward, but slow, implementation and progressively optimize it until it’s fast enough. We don’t stop there, though, but we end with a much faster implementation by noticing that divisor count is related to prime factorization.

Read the problem description here or here. Continue reading →

Posted by Bjarki Ágúst in UVa Online Judge, 8 comments
UVa 100: The 3n + 1 problem

UVa 100: The 3n + 1 problem

The problem (or UVa 100) is the first problem at UVa’s online judge. The problems there are not in any particular order, as can be seen from this first problem which is far from being the easiest (but also very far from being the hardest). You can read the problem statement here or here. Continue reading →

Posted by Bjarki Ágúst in UVa Online Judge, 11 comments