Problem of Buddies
CodeChefOpen on judge ↗
Two sequences of integers of length $n$ are referred as buddies if they have at least one buddy common between them. The pair of positive integers $(a,b)$ are referred to be buddies if the sum of proper divisors of $a$ equals $b$ and vice-versa, that is the sum of proper divisors of $b$ also equals $a$. Given two sequences, find whether they are buddies are not. ###Input: - The first line of
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start