随笔分类 - 二分
摘要:"UVA 12467 Secret Word" kmp+二分,二分枚举答案的长度,用kmp判断是否合法 cpp include using namespace std; define rint register int define rll register long long define lon
阅读全文
摘要:题目描述 A Light-Emitting Diode (LED) is a semiconductor light source, which emits light when an electric current of voltage higher than a threshhold is a
阅读全文
摘要:题目描述 There are two sequences a1,a2,...,an , b1,b2,...,bn . Let . There are m operations within three kinds as following:• 1 x y: change value ax to y.
阅读全文
摘要:二分找出r的大小,然后dfs对图染色。 #include "bits/stdc++.h" using namespace std; const int maxn = 2e5 + 100; int n, k; int ans[maxn]; int cnt[maxn]; int l, r, mid; v
阅读全文
摘要:10544: 凉宫春日的叹息 题目描述 给定一个数组,将其所有子区间的和从小到大排序,求第k小的是多少。 输入 第一行两个数n, k,表示数组的长度和k;第二行有n个数,第i个是a[i],表示给定的数组。 输出 仅一个数,表示答案。 样例输入 复制样例数据 样例输出 提示 对于15%的数据,n≤10
阅读全文
摘要:题目描述 双十一就要来啦!而Yuno刚刚获得了一笔X元的奖金。那么是不是应该清空下购物车呢?购物车总共有N个物品,每个物品的价格为Vi,Yuno想尽可能地把手头的奖金给花光,所以她要精心挑选一些商品,使得其价格总和最接近但又不会超过奖金的金额。那么Yuno最后最少可以剩下多少钱呢? 输入 第一行,两
阅读全文
摘要:题目描述 作为惩罚,GY被遣送去帮助某神牛给女生送礼物(GY:貌似是个好差事)但是在GY看到礼物之后,他就不这么认为了。某神牛有N个礼物,且异常沉重,但是GY的力气也异常的大(-_-b),他一次可以搬动重量和在w(w<=2^31-1)以下的任意多个物品。GY希望一次搬掉尽量重的一些物品,请你告诉他在
阅读全文
摘要:BaoBao and DreamGrid are playing the game Plants vs. Zombies. In the game, DreamGrid grows plants to defend his garden against BaoBao's zombies. There
阅读全文

浙公网安备 33010602011771号