版本比较
题解:P14379 【MX-S9-T2】「LAOI-16」摩天大楼
正文
增加 3 行删除 3 行
80 行未改动818283848585868788899091929394949596979851 行未改动15015115215315415415515615715880 行未改动
nxtit = pos2.lower_bound(p); preit = prev(nxtit); res2 += tr1.Rquery(*preit, *nxtit);
tr1.update(p, 1); pos1.insert(p);}void Add2(int p){ auto nxtit = pos2.lower_bound(p); auto preit = prev(nxtit); res2 -= 1ll * tr1.Rquery(*preit, p) * tr1.Rquery(p, *nxtit);
pos2.insert(p);}void Del1(int p){51 行未改动 if(a[x] == 2) Del2(x); a[x] = y; if(a[x] == 1) Add1(x); if(a[x] == 2) Add2(x); cout << ans - res1 - res2 << "\n"; cout << ans - res1 - res2 << "\n"; } return 0;}```