Molecular simulation of pattern formation in electron beam lithography