Various ACMs

A productive day.

New members joined in working on ACM together.

Besides, i myself have submitted 4 problems. All are easy ones:

Hanoi Troubles Again, Pseudo-Random Numbers, Reverse Text and Integer Inquiry.

The last one is also about dealing with big numbers (addition arithmetic).
Something you should pay attention to:

1) Allocate _enough_ memory (100 100-digits numbers addition would occupy at most 102 digits).
2) For big numbers, dont forget 0 + 0 is also 0. (Duh!?)


Today's Tips:
1) Dont be cheap about your memory. LIMIT + 1 does not suffice.
2) Be careful, be MORE careful.
3) Test against the extreme cases.

Avoid those off-by-one bugs!

Update:

Although it has passed the online judge, there was a bug in the old version of sumbig.c (Integer Inquiry). reverse() has not correctly dealt with odd-digits number. Thanks for Penguin (aka. walte) triggering this bug.

New version uploaded.

Leave a comment

Recent Entries

  • Running Spaz on WebOS Emulator

    > You got root, you got everything. Yeah, Palm Pre is hot these days. Now with the [webos emulator](http://www.geektang.com/2009/06/linuxwebos.html) and [ssh](http://www.geektang.com/2009/06/sshwebos.html) available, you can have...

  • Haskell Platform

    >The Haskell Platform is a blessed library and tool suite for Haskell distilled from Hackage, along with installers for a wide variety of systems. IOW,...

  • When MT Meets iPhone/iPod Touch

    Just found [iMT](http://plugins.movabletype.org/imt/). It's the iphone / ipod touch interface for mt4. So now you can add/edit blog entries / comments on your favorite device...

  • All Project Euler Problems Solved

    [Project Euler](http://projecteuler.net) continues to be fun. First reached 100% when there were 240 problems. And have successfully guarded that honor since =). (As of this...

  • Million Digits of E, Sqrt(2), Pi

    > More puzzles, more fun. Besides [acm oj](http://acm.tju.edu.cn/toj/ranklist.html) and [projecteuler](http://projecteuler.net), i also like to solve the puzzles on [spoj](http://spoj.pl). The ACM/ICPC rules are rather limited...

Close