Discrepancy of random graphs and hypergraphs