A polymer comprising units of formulas (1) and (2) and having a Mw of 1,000-500,000 is provided. R1 is H, CH3 or CH2CO2R3, R2 is H, CH3 or CO2R3, R3 is alkyl, R4 is H, alkyl, alkoxyalkyl or acyl, R5 is alkyl or aryl, Y is a divalent hydrocarbon group which may contain a hetero atom and which forms a ring with the carbon atom, Z is a trivalent hydrocarbon group, k is 0 or 1, and W is -O- or -(NR)- wherein R is H or alkyl. A resist composition comprising the polymer as a base resin is sensitive to high-energy radiation, has excellent sensitivity, resolution, and etching resistance, and lends itself to micropatterning with electron beams or deep-UV rays.