Concept:"Ought not to have + past participle" criticises a past action: it was wrong or unwise, but it was done.Explanation:The person did walk home alone late at night, and the speaker says this was unwise: "You ought not to have walked home alone so late at night.""Would not have walked" describes an imagined past result; "might not have walked" expresses possibility."Need not to" is ungrammatical; the modal form is "need not have" (without "to"), and it means the action was unnecessary, not unwise.Answer:Option C (ought not to)