https://vjudge.net/problem/Gym-100712G 题意:给出n枚不同价值的硬币和一个总价S,现在要选择尽量多的硬币来大于等于S,要求是比如说现在选择的硬币的总和为sum,那么所选择的任何一个硬币x,sum-x都必须<S. 思路: 一开始是想排序然后优先选择小的...没想到最后是暴力枚举. 因为N很小,最大也就是10,每枚要么选,要么不选,二进制枚举. #include<iostream> #include<algorithm> #include&l…
题意1: 给你一个由小写字母构成的字符串s,你可以其中某些字符变成大写字母.如果s中有字母a,你如果想把a变成大写,那s字符串中的每一个a都要变成A 最后你需要要出来所有的字符对,s[i]和s[i-1]需要是辅音字母,且s[i]和s[i-1]中需要一个字母大写另一个小写.a.e.i.o.u.w.y这七个字母是元音 输出最大字符对数量 题解1: 首先预处理一下s字符串中字符相邻的数量,就是记录w[s[i-1]][s[i]]的数量 之后二进制枚举所有字母变成大写的情况. 然后枚举这个字母变成大写之后…
时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 Lara Croft, the fiercely independent daughter of a missing adventurer, must push herself beyond her limits when she discovers the island where her father disappeared. In this mysterious island, Lara finds a tomb…
任意门:http://hihocoder.com/problemset/problem/1829 Tomb Raider 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 Lara Croft, the fiercely independent daughter of a missing adventurer, must push herself beyond her limits when she discovers the island where her fath…
[题解]Coins(二进制拆分+bitset) [vj] 俗话说得好,bitset大法吼啊 这道题要不是他多组数据卡死了我复杂度算出来等于九千多万的选手我还不会想这种好办法233 考虑转移的实质是怎样的,就是对于一个\(dp\)数组表,平移\(val_i \times num_i'\)位然后异或起来,这样就直接bitset开就好了. 背包问题的转移就不说了,优化就是利用二进制来优化,方法就是,我们可以知道所有数都是二进制表示出来的,根据加法交换律以及背包转移的方法,我们从小往大枚举\(2^x\l…
Lara Croft, the fiercely independent daughter of a missing adventurer, must push herself beyond her limits when she discovers the island where her father disappeared. In this mysterious island, Lara finds a tomb with a very heavy door. To open the do…
 Gym 101047M Removing coins in Kem Kadrãn Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Practice Description standard input/output Andréh and his friend Andréas are board-game aficionados. They know many of their friend…
题意:平面上有n个点(1<=N<=1000),你的任务是让所有n个点连通,为此, 你可以新建一些边,费用等于两个端点的欧几里得距离的平方.另外还有q(0<=q<=8)个套餐(数量小,可枚举),可以购买,如果你购买了第i个套餐,该套餐 中的所有结点将变得相互连通,第i个套餐的花费为ci. 分析:按照刘汝佳的思路做的.首先求一次本身的最小生成树值,然后枚举购买的套餐(二进制枚举),每次购买了之后,将其权值设为0,并且加进最小生成树. #include<cstdio> #in…
B. New Year and Old Property time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The year 2015 is almost over. Limak is a little polar bear. He has recently learnt about the binary system. He…
题目链接:http://poj.org/problem?id=2784 Buy or Build Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 1528   Accepted: 592 Description World Wide Networks (WWN) is a leading company that operates large telecommunication networks. WWN would li…