#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; //------------------------------------- #define ll long long #define ull unsigned long long #define sc(x) scanf("%lld",&x) #define sc2(x,y) scanf("%lld%lld",&x,&y) #define sci(x) scanf("%d",&x) #define sci2(x,y) scanf("%d%d",&x,&y) #define rep(i,a,n) for(int i=a;i #define pb(x) push_back(x); #define uni(vc) vc.resize(unique(all(vc))-vc.begin()) #define db(x) cout<<#x<<" "<mod) ans%=mod; } // cout<> inp[i]; int ase[MX][3]; ase[0][1]=0; ase[0][2]=0; int ls=0; rep(i,1,n) { ase[i][1]=i; ase[i][2]=i; ff=1; if(inp[i]<=inp[i-1]) { for(int j=i-1; j>=ls; j--) ase[j][2]=i-1; ls =i; ff=0; } } if(ff) { for(int j=i-1; j>=ls; j--) ase[j][2]=i-1; } // rep(i,0,n) cout<=inp[i-1]) { int gp = i+1; ll tot =1 ; for(int j=i+1; jmod) ncr[i][j]%=mod; // } // }