线段树 又是熟悉的感觉,又是E题写完了,没调完,不过还好上了紫 CF1295E 可以发现可以打败怪兽的关系类似二维偏序 那么首先考虑第一维(武器)以攻击值($a_{i}$)进行排序 把所有的怪兽以防御力($x_{i}$)进行排序 然后用双指针维护到目前遍历到的武器,可以打败的怪兽 然后考虑防具和怪兽的攻击力也就是第二维 首先先定义$lb$数组,$lb[i]$表示所选防具至少为$i$的最少花费 可以用差分求出 可以发现如果选到防御力为$i$的防具,那么所有当前可以打败的怪兽中,只要攻击力小于$i$…
题意 有\(n\)个武器,第\(i\)个武器攻击力为\(a_i\),价值\(ca_i\). 有\(m\)个防具,第\(i\)个防具防御力为\(b_i\),价值\(cb_i\). 有\(p\)个怪,第\(i\)个怪攻击力为\(x_i\),防御力为\(y_i\),价值\(z_i\). 可以选择\(1\)个武器和\(1\)个防具,假设选择第\(i\)个武器和第\(j\)个防具,那么你需要花费\(a_i+b_j\),且可以杀死所有满足攻击力小于\(a_i\)且防御力小于\(b_j\)的怪,并获得这些怪物…
  A - Journey Planning 题意: 有一列共 n 个城市, 每个城市有美丽值 b[i], 要访问一个子序列的城市, 这个子序列相邻项的原项数之差等于美丽值之差, 求最大的美丽值总和. 思路: 对于一个合法的子序列, b[i] - i 结果是一个定值, 统计该值取最大. view code #include <bits/stdc++.h> using namespace std; #define ll long long #define inc(i, l, r) for (in…
T1 无聊的数列 来自:Link flag 帖先从水题入手. 首先分析题目,它是以等差数列为原型进行的修改.等差数列一大性质就是其差分数列的值除第一项以外均相等. 于是不难想到使用差分数列进行维护. 假设原数组为 \(A\),其差分数列为 \(num\).规定 \(num_i = A_i - A_{i - 1}(i \in [1, n])\). 当前更改区间 \(l, r\).需累加的等差数列首项为 \(k\),公差为 \(d\),长度为 \(r - l + 1\). 对于 \(l\),我们需要…
第一次打虚拟赛. CF 传送门 T1:Contest for Robots 统计 \(r[i]=1\) 且 \(b[i]=0\) 的位数 \(t1\) 和 \(r[i]=0\) 且 \(b[i]=1\) 的位数 \(t2\). 两个数都为 \(0\) 或都为 \(1\) 时没有贡献. 若 \(t1=0\),则 \(r\) 序列不管乘多大的 \(p\) 也不会比 \(b\)序列更大,所以直接输出 \(-1\). 否则,我们考虑将 \(r[i]=0\) 且 \(b[i]=1\) 的位置的 \(p[i…
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the grid. Each of the ships consists of bconsecutive cells. No cell can be part of two ships, however, the shi…
D. Sea Battle time limit per test: 1 second memory limit per test :256 megabytes input: standard input output: standard output Galya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the grid. Each of the ships…
D. Sea Battle time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Galya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the grid. Each of the ships con…
The Battle of Chibi Time Limit: 6000/4000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 591    Accepted Submission(s): 192 Problem Description Cao Cao made up a big army and was going to invade the whole South Chin…
If you have 2 level 25 pets and any level 1 pet, obviously start with him in your lineup. Defeat all eastern kingdoms pet trainers in order of level (don't know exact order, but just do this). This should get you to around 15-17. Go to dragonblight a…