#include #include using namespace std; #define rep(i,n) for(int i = 0; i < (n); i++) int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N, K; cin >> N >> K; const int n = 1000100; atcoder::fenwick_tree cnt(n); rep(i, N) { int W; cin >> W; if (W > 0) { if (cnt.sum(W,n) >= K) continue; else cnt.add(W,1); }else { if (cnt.sum(-W,-W+1)) cnt.add(-W,-1); } } int ans = cnt.sum(0,n); cout<