Critical adsorption of an end-grafted diblock copolymer on a flat surface