Search:

Type: Posts; User: laserlight

Search: Search took 0.21 seconds.

  1. Replies
    51
    Views
    9,664

    Apparently the large buffer is not an advantage...

    Apparently the large buffer is not an advantage since testing with BUFSIZ instead of 0x80000 gave timings of 0.81, 0.75 and 0.85:

    #include <stdio.h>

    #define N BUFSIZ

    unsigned char inputv[N];...
  2. Replies
    51
    Views
    9,664

    I believe that there is an edge case bug in the...

    I believe that there is an edge case bug in the code: in the case where the input is 1000000000, the fgets() will read 10 characters in and then insert the null character. However, that leaves the...
  3. Replies
    51
    Views
    9,664

    To be fair, the rules in a "competition" are...

    To be fair, the rules in a "competition" are different from the normal rules of programming/software engineering, so I would accept gets() in this case since the input is guaranteed to be correct....
  4. Replies
    51
    Views
    9,664

    Yes, I finally decided to let the site do the...

    Yes, I finally decided to let the site do the benchmarking for me, and finished with about the same timing with a similiar approach, since it was the next obvious implementation that actually made...
  5. Replies
    51
    Views
    9,664

    Naive? Straightforward is more like it :), and it...

    Naive? Straightforward is more like it :), and it is similiar to what samus250 did, hence the similiar timing. Incidentally, scanf and printf belong to the std namespace. Actually, with this...
  6. Replies
    51
    Views
    9,664

    Well, that is an example of why we should measure...

    Well, that is an example of why we should measure when we want to determine performance :)
    Nonetheless, why not show the source code of both the programs involved?
  7. Replies
    51
    Views
    9,664

    That is interesting. You mean that using dynamic...

    That is interesting. You mean that using dynamic memory allocation is an improvement? I do not see a space-time trade-off benefit here, so that is puzzling.
  8. Replies
    51
    Views
    9,664

    In that case, consider switching to C-style input...

    In that case, consider switching to C-style input to see if it makes any difference.
  9. Replies
    51
    Views
    9,664

    It does not look like dynamic memory allocation...

    It does not look like dynamic memory allocation is actually needed.
Results 1 to 9 of 9