湘潭大学1185 Bob's Problem】的更多相关文章

Bob's Problem Accepted : 114   Submit : 589 Time Limit : 1000 MS   Memory Limit : 65536 KB 题目描写叙述 Bob今天碰到一个问题.他想知道x3+y3 = c 是否存在正整数解? 输入 第一行是一个整数K(K≤20000),表示例子的个数. 以后每行一个整数c(2≤c≤109) 输出 每行输出一个例子的结果.假设存在.输出"Yes",否则输出"No".(引號不用输出) 例子输入…
Bob and math problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 401    Accepted Submission(s): 149 Problem Description Recently, Bob has been thinking about a math problem.There are N Digit…
主题链接:http://acm.hdu.edu.cn/showproblem.php?pid=5055 Problem Description Recently, Bob has been thinking about a math problem. There are N Digits, each digit is between 0 and 9. You need to use this N Digits to constitute an Integer. This Integer need…
题目链接:1484 - Alice and Bob's Trip 题意:BOB和ALICE这对狗男女在一颗树上走,BOB先走,BOB要尽量使得总路径权和大,ALICE要小,可是有个条件,就是路径权值总和必须在[L,R]之间,求终于这条路径的权值. 思路:树形dp,dp[u]表示在u结点的权值,往下dfs的时候顺带记录下到根节点的权值总和,然后假设dp[v] + w + sum 在[l,r]内,就是能够的,状态转移方程为 dp[u] = max{dp[v] + w }(bob) dp[u] = m…
Description Problem D The Book-shelver's Problem Input: standard input Output: standard output Time Limit: 5 seconds Memory Limit: 32 MB You are given a collection of books, which must be shelved in a library bookcase ordered (from top to bottom in t…
题目:codeforces 459D - Pashmak and Parmida's problem 题意:给出n个数ai.然后定义f(l, r, x) 为ak = x,且l<=k<=r,的k的个数.求 i, j (1 ≤ i < j ≤ n) ,f(1, i, ai) > f(j, n, aj).,有多少对满足条件的i.j. 分类:逆序数.线段树.离散化, 分析:这是一道不错的数据结构题目,比較灵活. 推一下第一组例子之后发现时让求一个逆序数的题目.可是不是单纯的求逆序数. 第一…
题目链接:http://codeforces.com/contest/459/problem/D D. Pashmak and Parmida's problem time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Parmida is a clever girl and she wants to participate in O…
Shoemaker's Problem Shoemaker has N jobs (orders from customers) which he must make. Shoemaker can work on only one job in each day. For each ith job, it is known the integer Ti (1<=Ti<=1000), the time in days it takes the shoemaker to finish the jo…
Hotaru's problem Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 2274    Accepted Submission(s): 795 Problem Description Hotaru Ichijou recently is addicated to math problems. Now she is playin…
[HDOJ 5371] Hotaru's problem Manacher算法+穷举/set Manacher算法一好文:http://blog.csdn.net/yzl_rex/article/details/7908259 套一个Manacher算出回文半径数组p之后 有两种方法 穷举法: 枚举-1的点(依据题意仅仅必为偶数回文) 找在该点回文半径内与其相隔最远 而且回文半径等于他俩距离(即两点为中心的回文串同样) 的点 记录找到时的距离 不断枚举找最大值即为最大回文串长 串长/2*3即为答…