#include#include #include #include #include using namespace std;const int maxn=100100;typedef long long int LL;int n,m;LL a[maxn];vector near[maxn];int main(){ cin>>n>>m; for(int i=0;i >a[i]; } LL cur=0,orz; for(int i=0;i =0&&a[i-1]!=a[i]) { near[a[i]].push_back(a[i-1]); } if(i+1