X : Why do you look sad?

Y : I got 5 for my English test.

X : ….
Answer :
You should have studied well

The sentence states that X gave advice to Y.

Should + have + V3

it means that it was not done in the past.

  Asking For and Providing Information about People's or Animals Actions or Behaviors