05 2018 档案

摘要:题目描述 有一个神奇的口袋,总的容积是40,用这个口袋可以变出一些物品,这些物品的总体积必须是40。John现在有n个想要得到的物品,每个物品的体积分别是a1,a2……an。John可以从这些物品中选择一些,如果选出的物体的总体积是40,那么利用这个神奇的口袋,John就可以得到这些物品。现在的问题 阅读全文
posted @ 2018-05-21 22:35 wydxry 阅读(574) 评论(0) 推荐(0) 编辑
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 int test(int x) 8 { 9 int sum=0; 10 while(x){ 11 sum+=x%10; 12 x/=10; 13 } 14... 阅读全文
posted @ 2018-05-21 21:12 wydxry 阅读(194) 评论(0) 推荐(0) 编辑
摘要:题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1240 思路:从2开始到sqrt(n)查询可以整除他的素数,并且判断这个素数的平方是否可以整除n,如果可以输出0,否则判断可以整除他的素数个数,奇数个输出-1,偶 阅读全文
posted @ 2018-05-20 02:01 wydxry 阅读(217) 评论(0) 推荐(0) 编辑
摘要:思路:普通的cin会超时 方法很妙 阅读全文
posted @ 2018-05-20 01:32 wydxry 阅读(249) 评论(0) 推荐(0) 编辑
摘要:题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=2020 思路:排序 水水 阅读全文
posted @ 2018-05-19 22:37 wydxry 阅读(173) 评论(0) 推荐(0) 编辑
摘要:题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1090 思路:排序 三个for循环 但是要控制循环 不能从头开始遍历 会超时 阅读全文
posted @ 2018-05-19 22:22 wydxry 阅读(255) 评论(0) 推荐(0) 编辑
摘要:題目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1087 思路:动态规划 求n个点的和最大上升子序列 d[i]=max(d[j]+a[i]),(j<i且a[j]<a[i]) 阅读全文
posted @ 2018-05-19 22:02 wydxry 阅读(188) 评论(0) 推荐(0) 编辑
摘要:题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1049 阅读全文
posted @ 2018-05-19 21:03 wydxry 阅读(267) 评论(0) 推荐(0) 编辑

Live2D