正文
增加 6 行删除 6 行
95 行未改动9697989910010110210310430 行未改动13513613713813914014114214310 行未改动154155156157158159160161162195 行未改动全部展开35835936036136236336436536614 行未改动38138238338438538638738838914 行未改动4044054064074084094104114129 行未改动95 行未改动{if(!q[itl].op) ins(q[itl].l,q[itl].tye);tmp[++ top] = q[itl ++];}else{if(q[itr].op) ans[q[itr].id] += q[itr].tye * query(q[itr].l);tmp[++ top] = q[itr ++];}30 行未改动freopen("data.in","r",stdin);freopen("data.out","w",stdout);#endifn = read();m = read();for(int i = 1;i <= n;i ++){a[i] = read();s[a[i]].insert(i);q[++ tot] = {0,i,pre(a[i],i),0,1};10 行未改动cnt ++;q[++ tot] = {1,r,l,cnt,1};q[++ tot] = {1,l - 1,l,cnt,-1};}else{q[++ tot] = {0,l,pre(a[l],l),0,-1};q[++ tot] = {0,l,pre(r,l),0,1};opt = nxt(a[l],l);195 行未改动全部展开{if(!q[itl].op) ins(q[itl].r,q[itl].tye);tmp[++ top] = q[itl ++];}else{if(q[itr].op) ans[q[itr].id] += q[itr].tye * query(q[itr].r);tmp[++ top] = q[itr ++];}14 行未改动freopen("data.in","r",stdin);freopen("data.out","w",stdout);#endifn = read();m = read();for(int i = 1;i <= n;i ++){a[i] = read();if(!mp[a[i]]) mp[a[i]] = ++ tot;a[i] = mp[a[i]];14 行未改动if(!mp[v]) mp[v] = ++ tot;v = mp[v];assign(l,r,v,i);}else{l = read();r = read();q[++ cnt] = {1,r,l - 1,i,1};9 行未改动95 行未改动9697989910010110210310430 行未改动13513613713813914014114214310 行未改动154155156157158159160161162195 行未改动全部展开35835936036136236336436536614 行未改动38138238338438538638738838914 行未改动4044054064074084094104114129 行未改动95 行未改动{if(!q[itl].op) ins(q[itl].l,q[itl].tye);tmp[++ top] = q[itl ++];}else{if(q[itr].op) ans[q[itr].id] += q[itr].tye * query(q[itr].l);tmp[++ top] = q[itr ++];}30 行未改动freopen("data.in","r",stdin);freopen("data.out","w",stdout);#endifn = read();m = read();for(int i = 1;i <= n;i ++){a[i] = read();s[a[i]].insert(i);q[++ tot] = {0,i,pre(a[i],i),0,1};10 行未改动cnt ++;q[++ tot] = {1,r,l,cnt,1};q[++ tot] = {1,l - 1,l,cnt,-1};}else{q[++ tot] = {0,l,pre(a[l],l),0,-1};q[++ tot] = {0,l,pre(r,l),0,1};opt = nxt(a[l],l);195 行未改动全部展开{if(!q[itl].op) ins(q[itl].r,q[itl].tye);tmp[++ top] = q[itl ++];}else{if(q[itr].op) ans[q[itr].id] += q[itr].tye * query(q[itr].r);tmp[++ top] = q[itr ++];}14 行未改动freopen("data.in","r",stdin);freopen("data.out","w",stdout);#endifn = read();m = read();for(int i = 1;i <= n;i ++){a[i] = read();if(!mp[a[i]]) mp[a[i]] = ++ tot;a[i] = mp[a[i]];14 行未改动if(!mp[v]) mp[v] = ++ tot;v = mp[v];assign(l,r,v,i);}else{l = read();r = read();q[++ cnt] = {1,r,l - 1,i,1};9 行未改动