摘要: 原题链接 题意:就是多组询问,和多组操作,操作只有一种,就是在 \(l\) 到 \(r\) 加上新的地雷,询问是问在 \(l\) 到 \(r\) 一共有多少种地雷。 题解:这题应该是数据结构的一个经典套路,就是记录 \(l\) 和 \(r\) 的位置,在单点 \(l\) 和 \(r\) 上 \(a_ 阅读全文
posted @ 2021-04-23 14:49 u_yan 阅读(40) 评论(0) 推荐(0) 编辑
摘要: 原题链接 题解:二维树状数组,第一次遇见,就是快速的计算出前缀和。 代码: #include <cstdio> #include <iostream> #include <queue> #include <cstring> #include <vector> #include <algorithm> 阅读全文
posted @ 2021-04-23 13:41 u_yan 阅读(39) 评论(0) 推荐(0) 编辑
摘要: const ll N = 1333; int n; struct BIT { int tag[MAXN], t[MAXN], Tag; void reset() { ++Tag; } void add(int k, int v) { while (k <= n) { if (tag[k] != Ta 阅读全文
posted @ 2021-04-23 13:38 u_yan 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 原题链接 题解:手推一下就知道了是要维护一个平方和的序列,然后就大力码码码。 代码: #include <cstdio> #include <iostream> #include <queue> #include <cstring> #include <vector> #include <algor 阅读全文
posted @ 2021-04-23 11:19 u_yan 阅读(50) 评论(0) 推荐(0) 编辑