Hi everyone,
The problem which I've been stuck on is: http://cs.stanford.edu/group/acm/slpclive/problems/G.pdf
Can someone please give me some hints / idea how to solve this problem?
Cheers
Hi everyone,
The problem which I've been stuck on is: http://cs.stanford.edu/group/acm/slpclive/problems/G.pdf
Can someone please give me some hints / idea how to solve this problem?
Cheers
For a given set of K prime numbers S = {p1, p2, ..., pK}, consider the set of all numbers whose prime factors are a subset of S. This set contains, for example, p1, p1p2, p1p1, and p1p2p3 (among others). This is the set of `humble numbers' for the input set S. Note: The number 1 is explicitly declared not to be a humble number.
Your job is to find the Nth humble number for a given set S. Long integers (signed 32-bit) will be adequate for all solutions.
K and N, 1 <= K <=100 and 1 <= N <= 100,000.
I'm getting TLE due to running O(N ^ 2 * K) algorithm (Simply I'm building the humble number sequence
Hi everyone,
I'm new to Codeforces, Seems a very nice place for training.
BTW, I'm trying to solve this problem
http://acm.sgu.ru/problem.php?contest=0&problem=122
I've search for the Dirac's Theorm which states that there is a hamiltonian cycle.
But how should I build the path?
Cheers
Igor