[笛卡尔树][树形dp]Yet Another Array Counting Problem Codeforces1748E
Thepositionoftheleftmostmaximumonthesegment[l;r][l;r]ofarrayx=[x1,x2,…,xn]x=[x1,x2,…,xn]isthesmallestintegeriisuchthatl≤i≤rl≤i≤randxi=max(xl,xl+1,…,xr)xi=max(xl,xl+1,…,xr).Youaregivenanarraya=[a1,a2,…