Project Euler #127: abc-hits

Sort by

recency

|

4 Discussions

|

  • + 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
  • + 1 comment

    R > 1 makes this difficult. I can handle n=10^5 when r=1, but when r=1.5 I can only handle n=10^4 before I run out of time. Can someone confirm them solved this without using hardcoded data sets?

  • + 0 comments

    Well, Haskell's built-in read :: String -> Double is quite slow, so I write my own version of reader. After many times of submission I found that the input format does not follow what it should be:

    The input r is written with at most 6 decimal digits behind the decimal point.

    It confused me for a whole day, and later I just tried to read 8 decimal digits behind the decimal point and that was accepted.

  • + 1 comment

    Although the outputs from my code are correct, even then the there is a timeout message when the code is executed?

No more comments