Yeah, and sizeof and malloc are very easily things students could have been exposed to in high school or their own studies. I’ve seen C books that use them in the first chapter.
It’s fine to say solve this problem using the following tools, but not great to say “if you find another approach, I assume cheating.”
It did not say "I assume cheating". It said you're probably cheating, as in of you look at the population of students who are using such constructs, over 50% of them are using them because they are cheating. Given that accusations of cheating were not made when such constructs were found, it seems like that probability was not factored in when deciding whether or not to advise someone.