Where are editorials? 7 days gone after contest still no editorial @admin . I need editorials for Algebra Score , Awkward Pairs , Good Speech , The Illusionist .
For: Awkward Pairs,
as the sum of digits can be at max 9x18 ~ 162 = N ,
we can apply digit-dp to find out the count of each sum between l to r.
then an O(N^N*log(N)) loop for finding the pairs having gcd = 1, and summing up count[i]*count[j], where i & j are two numbers in the pair.
My solution : https://www.codechef.com/viewsolution/26636236