且未

博客园 首页 新随笔 联系 订阅 管理
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 24 下一页

2018年9月29日 #

摘要: 目录最短路练习poj 2387 Til the Cows Come Homepoj 2253 Frogger poj 1797 Heavy Transportationpoj 3268 Silver Cow Partypoj 1860 Currency Exchang... 阅读全文
posted @ 2018-09-29 13:58 阿聊 阅读(151) 评论(0) 推荐(0)

2018年9月27日 #

摘要: hdu 1180 诡异的楼梯#include#include using namespace std;#include#include #include using namespace std;const int N = 50;const int INF = 1e6;... 阅读全文
posted @ 2018-09-27 14:02 阿聊 阅读(218) 评论(0) 推荐(0)

2018年9月25日 #

摘要: 题目两种做法,开始用贪心做的,有种情况没考虑到,结果排序错了。这个例子,感觉上有三个交点,以为是30,其实是20.贪心代码:#include #include #include #include using namespace std;struct node{ ... 阅读全文
posted @ 2018-09-25 12:06 阿聊 阅读(134) 评论(0) 推荐(0)

2018年9月18日 #

摘要: long long factorial(int n){ long long m = 1; for(int i=1;i<=n;i++) m*=i; return m;}long long C(int n,int m){ re... 阅读全文
posted @ 2018-09-18 10:58 阿聊 阅读(253) 评论(0) 推荐(0)

2018年9月17日 #

摘要: 题目题意:一共有2k个人,分别为k个好人和k个坏人,现在我们需要每隔m个人把坏人挑出来,但是条件是最后一个坏人挑出来前不能有好人被挑出来。。问最小的m是多少约瑟夫环问题,通常解决这类问题时我们把编号设为从0~n-1。求出每一轮出列的人:start = (start +... 阅读全文
posted @ 2018-09-17 15:04 阿聊 阅读(191) 评论(0) 推荐(0)

2018年9月16日 #

摘要: 题目题意:求 点s 到 点t 的 第 k 短 路的距离;估价函数=当前值+当前位置到终点的距离f(n)=g(n)+h(n); g(n)表示g当前从s到p所走的路径的长度, h(n)‘启发式函数’,表示为终点t到其余一点p的路径长度;(1)将有向图的所... 阅读全文
posted @ 2018-09-16 11:12 阿聊 阅读(78) 评论(0) 推荐(0)

2018年9月14日 #

摘要: 题目大意:给你 a , b , c , d , k 五个值 (题目说明了 你可以认为 a=c=1) x 属于 [1,b] ,y属于[1,d] 让你求有多少对这样的 (x,y)满足gcd(x,y)==k。给你的时间是 3000 MS。 0 #include #... 阅读全文
posted @ 2018-09-14 17:47 阿聊 阅读(115) 评论(0) 推荐(0)

摘要: 题目由二分思想,尽量往右靠(每次取中间值加1为新的左边界 且 右边界不变),以n=3为例:(((((1+m)/2)+1+m)/2)+1+m)/2=m 解得,m=7. 当n=n时,归纳易得, m=(2^n)-1. 阅读全文
posted @ 2018-09-14 11:10 阿聊 阅读(115) 评论(0) 推荐(0)

2018年9月12日 #

摘要: 题目题意:第Ki 个不是完全平方数的正整数倍的数。对于一个数t,t以内的数里的非完全平方数倍数的个数:num=1的倍数的数量−一个质数平方数(9,25,49...)的倍数的数量+两个质数的积平方数(36,100,225...)的数量−三个质数balabala……所以 ... 阅读全文
posted @ 2018-09-12 13:06 阿聊 阅读(149) 评论(0) 推荐(0)

2018年9月10日 #

摘要: 题目 题意:要求输出所给定的数n的最大质因子的序号,0#include using namespace std;const int Max = 1e6+10;int num[Max];void cal(){ int cnt = 1; mems... 阅读全文
posted @ 2018-09-10 18:27 阿聊 阅读(146) 评论(0) 推荐(0)

上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 24 下一页