Efficient Distributed Algorithms on Random Graphs