#include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; const ll INF=1LL<<60; typedef pair P; typedef pair PP; const ll MOD=998244353; const double PI=acos(-1); int main(){ int N; cin>>N; map mp; vector A(N); for(int i=0;i>A[i]; } vector dp(N+1,0); ll ans=0; for(int i=0;i