A polymer having a segment a having at least one bond selected from a urethane bond, a urea bond, an amide bond, an imide bond, or an ester bond in a main chain and a hydrocarbon polymer segment,
- wherein the hydrocarbon polymer segment has at least one repeating unit selected from a repeating unit represented by Formula (1) or a repeating unit represented by Formula (2),
- in Formula (1) and Formula (2), R11 to R27 each independently represent a hydrogen atom, an alkyl group, or an aryl group, and a partial structure -L11-A in Formula (1) and a partial structure -L12-A in Formula (2) each are independently a partial structure represented by Formula (3) or Formula (4),
- in Formula (3) and Formula (4), X represents —O—, —S—, or —N(R3)—, R3 represents a hydrogen atom, an alkyl group, or an aryl group, L21 represents a single bond or an alkylene group having 1 to 20 carbon atoms, L22 represents a single bond, an alkylene group having 1 to 20 carbon atoms, or an arylene group having 6 to 20 carbon atoms, Y2 represents a trivalent group made of hydrocarbon, L23 and L24 each independently represent a single bond or an alkylene group having 1 to 20 carbon atoms, A2 represents a carboxylic acid group, and * represents a bonding portion with a C atom in Formula (1) or a C atom in Formula (2).