We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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.
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?
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.
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.
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?
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.
Although the outputs from my code are correct, even then the there is a timeout message when the code is executed?