版本比较
P6642 [CCO2020] Exercise Deadlines 题解
正文
增加 2 行删除 2 行
23 行未改动242526272828293031323334343536373820 行未改动23 行未改动int a[200005], pre[200005];int c[200005];ll tot;void add(int x) { for(; x <= n ; x += x & -x) c[x]++; for(; x <= n ; x += x & -x) c[x]++;}int ask(int x) { if(x == 0) return 0; int ans = 0; for(; x ; x -= x & -x) ans += c[x]; return ans; return ans;}int main() { scanf("%d", &n); for(int i = 1; i <= n; i++) {20 行未改动