HDU 4149 Magic Potion】的更多相关文章

意甲冠军: a[i] ^ x = f[i] ( i = 1...8 ) 和 ( a[1] + a[2] + ... + a[8] ) ^ x = f[9] 如今f为已知  求x 思路: 从低位到高位确定x值  做法见凝视 代码: #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int f[20],t,ans; int main() { int i,k,j; scanf…
Magic Potion Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 488    Accepted Submission(s): 287 Problem Description In a distant magic world, there is a powerful magician aswmtjdsj. One day,aswm…
题目链接:http://codeforces.com/gym/101981/attachments There are n heroes and m monsters living in an island. The monsters became very vicious these days,so the heroes decided to diminish the monsters in the island. However, the i-th hero can only kill on…
Magic Potion http://codeforces.com/gym/101981/attachments/download/7891/20182019-acmicpc-asia-nanjing-regional-contest-en.pdf 从源点到英雄分别拉容量为1和2的边,跑两遍网络流,判断两次的大小和k的大小 #include<iostream> #include<cstring> #include<string> #include<cmath&g…
Problem I. Magic Potion There are n heroes and m monsters living in an island. The monsters became very vicious these days, so the heroes decided to diminish the monsters in the island. However, the i-th hero can only kill one monster belonging to th…
hdu 1153 magic bitstrings 题目大意 一个质数p,现在让你求一个p-1长度的“01魔法串”.关于这个魔法串是这么定义的:     我们现在把这个串经过一段处理变成一个长宽均为p-1的矩阵,对于第i行的串,是由原来的串按每i位取得的.如果这个矩阵每行的串满足:和原来的串相等或是原来的串按位取反,我们就称这个串是魔法串.(说了一大堆如果还没看懂就去问题底下的Discuss看吧….) 题解 一开始热衷于讨论第一行和最后一行的关系…结果什么也没看出来…后来看了别人的题解,才发现自…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2274 Magic WisKey Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 568    Accepted Submission(s): 323 Problem Description On New Year Festival, Liu…
http://acm.hdu.edu.cn/showproblem.php?pid=4605 可以离线求解 把所以可能出现的 magic ball  放在一个数组里(去重),从小到大排列 先不考虑特殊情况,对二叉树进行dfs 搜索的过程中需要维护各个magic ball到当前节点的概率 维护:根据当前节点大小 和要去左子树还是右子树的情况,可以得到magic数组中哪个段的x和y需要同时加上多少 可以用线段树维护 特殊情况: 1,根节点一定可以到达 2,到达不了的情况需要标记 代码: #inclu…
主题链接: http://acm.hdu.edu.cn/showproblem.php?pid=4016 Magic Bitwise And Operation Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65768/65768 K (Java/Others) Total Submission(s): 1315    Accepted Submission(s): 504 Problem Description Given n…
http://acm.hdu.edu.cn/showproblem.php?pid=3183 A Magic Lamp Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2556    Accepted Submission(s): 999 Problem Description Kiki likes traveling. One day…