- 博客(9)
- 收藏
- 关注
转载 hdu1059 01背包多重背包二进制优化
链接:http://acm.hdu.edu.cn/showproblem.php?pid=1059 题意:有六个物品价值分别为1~6,依次给出六个物品的数量,问是否能平均分成价值相等的两份 代码: #include #include <stdio.h> #include <string.h> #include //#define maxx(a,b) (a>b?a:...
2019-07-12 18:51:17
218
转载 LeetCode-【动态规划】-完全平方数
版权声明:转载 自 https://blog.youkuaiyun.com/zw159357/article/details/82595031 给定正整数 n,找到若干个完全平方数(比如 1, 4, 9, 16, …)使得它们的和等于 n。你需要让组成和的完全平方数的个数最少。 示例 1: 输入: n = 12 输出: 3 解释: 12 = 4 + 4 + 4. 示例 2: 输入: n = 13 输出: 2 ...
2019-07-06 10:05:12
197
原创 逃离迷宫1728
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1728 https://www.cnblogs.com/qiufeihai/archive/2012/08/27/2659159.html
2019-07-04 14:51:59
237
转载 hdu2072
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=2072 using namespace std; #include #include int main(){ char a[1000],b[1000][1000]; while(gets(a)){ if(strcmp(a,"#")==0) break; int i=0,j,k,n=0; char * t...
2019-06-28 19:08:28
175
原创 判断一个数是否为素数
题目:判断一个数是不是素数,1 < N <= 50000 思路:判断n是否整除(求余是否等于0)大于1而小于sqrt(n)中的任何一个数,如果有则不是素数,否则是素数 bool isPrime(int n) { int i; for(i = 2; i <= sqrt(n); i++) { if((n % i) == 0) ...
2019-05-11 14:42:49
170
转载 刷oj的顺序
第一阶段:开始入门吧!(15天,53题) 一.输入输出练习(2天,10题) 1000、1089—1096、1001 二.简单操作:(2—4天,12题) 2000—2011、2039 三.英文题试水(3—4天,8题) 1720、1062、2104、1064、2734、1170、1197、2629 四.回归水题(4-6天,24题) 2012—2030、2032、2040、2042、2054、2055 ...
2019-04-09 19:25:35
455
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人