maybe a floating point issue?
czylabsonasa
nobody at dev.null
Fri Sep 19 07:32:11 UTC 2025
On Friday, 19 September 2025 at 07:04:16 UTC, Serg Gini wrote:
> On Friday, 19 September 2025 at 06:23:02 UTC, czylabsonasa
> wrote:
>> Hi.
>>
>> I'm trying to solve a programming contest
>> [problem](https://open.kattis.com/problems/anthony) in D. The
>
> Let's see:
>> auto p=new fT[](A+C);
> In D code you allocating p vector of size A+C
>
>> p.resize(A+C+1);
> In C++ code you are allocating p vector of size A+C+1
>
> Maybe on some corner cases of the logic Trav function it can
> affect the result
Thanks, Serg, good catch, usually i set the limits a little bit
larger than the requirements, but this time i missed for the D
code.
To be sure (the devil isn't sleeping...) tried w/ `A+C+1` sized
allocation for the D, but no success, and `A+C` sized for the C++
- still accepted. (only the 1,...,A+C-1 indices are accessed).
cheers
More information about the Digitalmars-d
mailing list