#include using namespace std; #define REP(i,N) for(i=0;i P; typedef struct{ int first; int second; int third; }T; //昇順 bool comp_Se(T& l, T& r){ return l.second < r.second; } int main(void){ int N; cin >> N; int i; vector v(N), dp(N+1,0); REP(i,N) cin >> v[i]; dp[1] = v[0]; for(i=1;i