acgo题库
  • 首页
  • 题库
  • 题单
  • 竞赛
  • 讨论
  • 排行
  • 团队
  • 备赛专区

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
登录
注册
题目详情题解(0)讨论(0)提交记录(0)
  • 全站最先发讨论

    #include <iostream> #include <vector> #include <algorithm> struct Event { int x; int y_low; int y_high; int type; }; struct Node { int count; long long covered_length; }; stdvector<int> all_y; stdvector<Node> tree; void push_up(int node_index, int l, int r) { if (tree[node_index].count > 0) { tree[node_index].covered_length = all_y[r + 1] - all_y[l]; } else if (l == r) { tree[node_index].covered_length = 0; } else { tree[node_index].covered_length = tree[node_index * 2].covered_length + tree[node_index * 2 + 1].covered_length; } } void update(int node_index, int l, int r, int update_l, int update_r, int val) { if (l > update_r || r < update_l) { return; } if (l >= update_l && r <= update_r) { tree[node_index].count += val; } else { int mid = l + (r - l) / 2; update(node_index * 2, l, mid, update_l, update_r, val); update(node_index * 2 + 1, mid + 1, r, update_l, update_r, val); } push_up(node_index, l, r); } void solve() { int n; std::cin >> n; } int main() { stdios_basesync_with_stdio(false); std::cin.tie(NULL); solve(); return 0; }

    userId_undefined

    187****3948

    分支·分支解题者时间刺客模拟·模拟练习生字符串·魔法使数组·数组操作员倔强青铜
    1阅读
    0回复
    0点赞
首页