A young man accused in last year's fatal shooting of a teenager who had received his Virginia high school diploma minutes earlier at a public event pleaded guilty on Thursday to first-degree murder and a firearm-related charge and was sentenced to 43 years in prison.