2018-12-09 16:54:49 C++

C++

Copy Copied! Full
REP(i,n-1){ if(a[i]<a[i+1]){ cusum[a[i]]++; cusum[a[i+1]]--; }else{ cusum[a[i]]--; cusum[a[i+1]]++; } } cusum[0]++; cusum[a[n-1]]--;
RECOMMEND