A polymer comprising: a first structural unit represented by at least one of formulae, and below; and a structural unit represented by at least one of formulae and below in formulae to, R 1 is each independently a halogen atom, a monovalent hydrocarbon group having 1 to 20 carbon atoms, a monovalent halogenated hydrocarbon group having 1 to 20 carbon atoms, a nitro group, a cyano group, any of primary to tertiary amino groups or a salt of any of primary to tertiary amino groups; n is each independently an integer of 0 to 2; when n is 2, two or more R 1 may be the same or different and may be joined together in any combination to form a part of a cyclic structure; in formulae and, R 2 and R 3 are respectively and independently a halogen atom, a monovalent hydrocarbon group having 1 to 20 carbon atoms, a monovalent halogenated hydrocarbon group having 1 to 20 carbon atoms, a nitro group or a cyano group; e and f are respectively and independently an integer of 0 to 2; a and b are respectively and independently an integer of 0 to 8; when a is 2 or more, two or more R 2 may be the same or different and may be joined together in any combination to form a part of a cyclic structure; when b is 2 or more, two or more R 3 may be the same or different and may be joined together in any combination to form a part of a cyclic structure; Z 2 andZ 3 are respectively and independently -O-; v is an integer of 0; w is an integer of 0; G is -O-, -S-, -C=O-, -SO- or -SOz-; L is a bivalent group represented by formula (L-1) or (L-2) below; y is an integer of 1 to 3; when y is 2 or more, two or more L may be the same or different; when y is 2 or more and a is 1 or more, two or more R 2 may be the same or different; in formulae (L-1) and (L-2), A is each independently -C -, -SO- or -SOz-; B is each independently -O-, -S- or -N(R 8)-; R 8 is a hydrogen atom, a halogen atom, a monovalent hydrocarbon group having 1 to 20 carbon atoms or a monovalent halogenated hydrocarbon group having 1 to 20 carbon atoms; R 7 is each independently a halogen atom, a monovalent hydrocarbon group having 1 to 20 carbon atoms, a monovalent halogenated hydrocarbon group having 1 to 20 carbon atoms, a nitro group or a cyano group, I is each independently an integer of 0 to 2; s is each independently an integer of 0 to 8; when s is 2 or more, two or more R 7 may be the same or different and may be joined together in any combination to form a part of a cyclic structure; and "*" indicates a bond. a first structural unit represented by at least one of formulae, and below; and a structural unit represented by at least one of formulae and below in formulae to, R 1 is each independently a halogen atom, a monovalent hydrocarbon group having 1 to 20 carbon atoms, a monovalent halogenated hydrocarbon group having 1 to 20 carbon atoms, a nitro group, a cyano group, any of primary to tertiary amino groups or a salt of any of primary to tertiary amino groups; n is each independently an integer of 0 to 2; when n is 2, two or more R 1 may be the same or different and may be joined together in any combination to form a part of a cyclic structure; in formulae and, R 2 and R 3 are respectively and independently a halogen atom, a monovalent hydrocarbon group having 1 to 20 carbon atoms, a monovalent halogenated hydrocarbon group having 1 to 20 carbon atoms, a nitro group or a cyano group; e and f are respectively and independently an integer of 0 to 2; a and b are respectively and independently an integer of 0 to 8; when a is 2 or more, two or more R 2 may be the same or different and may be joined together in any combination to form a part of a cyclic structure; when b is 2 or more, two or more R 3 may be the same or different and may be joined together in any combination to form a part of a cyclic structure; Z 2 andZ 3 are respectively and independently -O-; v is an integer of 0; w is an integer of 0; G is -O-, -S-, -C=O-, -SO- or -SOz-; L is a bivalent group represented by formula (L-1) or (L-2) below; y is an integer of 1 to 3; when y is 2 or more, two or more L may be the same or different; when y is 2 or more and a is 1 or more, two or more R 2 may be the same or different; in formulae (L-1) and (L-2), A is each independently -C -, -SO- or -SOz-; B is each independently -O-, -S- or -N(R 8)-; R 8 is a hydrogen atom, a halogen atom, a monovalent hydrocarbon group having 1 to 20 carbon atoms or a monovalent halogenated hydrocarbon group having 1 to 20 carbon atoms; R 7 is each independently a halogen atom, a monovalent hydrocarbon group having 1 to 20 carbon atoms, a monovalent halogenated hydrocarbon group having 1 to 20 carbon atoms, a nitro group or a cyano group, I is each independently an integer of 0 to 2; s is each independently an integer of 0 to 8; when s is 2 or more, two or more R 7 may be the same or different and may be joined together in any combination to form a part of a cyclic structure; and "*" indicates a bond.