Simple and versatile methods to integrate directed self-assembly with optical lithography using a polarity-switched photoresist.