MICEMAZE SPOJ Solution C++ (Dijkstra's Algorithm)

Algorithm:

1. Reverse edges.
2. Select E as source and run Dijkstra's Algorithm.


Saturday, July 8, 2017

BUSYMAN SPOJ Greedy C

Algorithm:

1. Sort on end times.
2. Iterate over sorted list
        2.1 If the current activity overlaps, skip it
        2.2 If it doesn't increase count of answer. Set new time to end time of this activity.

Code: 

Friday, July 7, 2017

SPOJ/DQUERY solution Sort+Segment Tree (C)

https://apps.topcoder.com/forums/?module=Thread&threadID=627423

Solution: