Another four ACMs submitted

Easy ones.

I) Nonstop Travel

Be careful when the arriving time (in seconds) at a location is NOT integer.

II) What day is it?

Very interesting and infomative. You know what day Jan 1st 1 is? How many days are there in the month of September 1752? (Hint: run 'cal' on your UN*X box).

Two useful links:

1) Zeller's Rule
2) How about the a date

Note that both of the 2 formulas above only apply to the Gregorian Rule. (A little bit change needed for the Julian Rule).

III) Is it a tree?

Just remember each node except the root has exactly one parent, no more no less (as in real world, every one has only one father, duh!).

And dont forget those void trees (having 0 node).

PS, i've used hash table for looking up. You can use hsearch() when you are doing with strings. Well whenever for ingeter hashing, i'd go for this hash function.

IV) (Your)((Term)((Project)))

Familiar problem. You know those parentheses gotta need a stack.

Have gone crazy about a off-by-one bug. Trials-and-Fails(WAs). Should have been calm enough. Should have done this problem ACed in 10 minutes.

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