Project Euler #127: abc-hits

  • + 0 comments

    For those who are stuck. The first thing to do is to find all abc hits for c < 100000 and r = 1.5. There are exactly 83519 triplets. For every triplet calculate the t for which rad(abc) = c^t. Build segment tree from all triplets with cumulative sums. Then use the tree to find the sum for all queries.

    • tree build: 150 ms
    • 100000 queries: 150 ms