上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 43 下一页
摘要: #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define mem(a,b) memset(a,b... 阅读全文
posted @ 2016-03-13 16:33 qlky 阅读(235) 评论(0) 推荐(0) 编辑
摘要: CodeForces 518A 字符串进位。。   阅读全文
posted @ 2016-03-13 11:11 qlky 阅读(329) 评论(0) 推荐(0) 编辑
摘要: CF:Problem 425A 区间暴力,枚举区间。交换选定区间最小值和剩余区间最大值k次。 其实等同于将剩余区间最大k个加到选定区间里,然后排序   CodeForces 363D 这题其实是二分法。需要买最多的车,判断能不能买k辆车的话,一定是钱最多的k个人,买最便宜的k辆车,然后二分查找找出最 阅读全文
posted @ 2016-03-13 10:51 qlky 阅读(202) 评论(0) 推荐(0) 编辑
摘要: CodeForces 343A 这是第一题,像这种水题一定不要想复杂,思路不对立马换。 抓住串联和并联,可以用辗转相除法   CodeForces - 289A 这题考看懂题意。。   CodeForces 628B 这也是简单题,千万别先往复杂想。只要最后两个数字能被4整除,则这个数字就能被4整除 阅读全文
posted @ 2016-03-13 00:45 qlky 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 9.1 数字三角形 9.1.2 记忆化搜索与递推 方法1:递归计算。程序如下(需注意边界处理): 用直接递归的方法计算状态转移方程,效率往往十分低下。其原因是相同的子问题被重复计算了多次。 方法2:递推计算。程序如下(需再次注意边界处理): 程序的时间复杂度显然是O(n2),但为什么可以这样计算呢? 阅读全文
posted @ 2016-03-12 17:44 qlky 阅读(429) 评论(0) 推荐(0) 编辑
摘要: 例题7-1 除法(Division, UVa 725) 一定要注意数组初始化的位置 #include <iostream> #include <string> #include <cstring> #include <cstdlib> #include <cstdio> #include <cmat 阅读全文
posted @ 2016-03-06 10:18 qlky 阅读(393) 评论(0) 推荐(0) 编辑
摘要: 例题 例题5-1 大理石在哪儿(Where is the Marble?,Uva 10474) 主要是熟悉一下sort和lower_bound的用法 关于lower_bound: http://blog.csdn.net/niushuai666/article/details/6734403 此外还 阅读全文
posted @ 2016-01-31 22:02 qlky 阅读(499) 评论(0) 推荐(0) 编辑
摘要: memcmp(const void *buf1, const void *buf2, unsigned int count)可以比较两个串相等 http://baike.baidu.com/link?url=moP6BHDBs7PfCbVKaICYTP9biwBKdYjBfy2Raz45kwLx1S 阅读全文
posted @ 2016-01-31 17:24 qlky 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 我的思路是A右与B左对齐,然后一路滑过去,寻找其中的最小值。然而WA。。 #include <iostream> #include <string> #include <cstring> #include <cstdlib> #include <cstdio> #include <cmath> #i 阅读全文
posted @ 2016-01-31 16:12 qlky 阅读(309) 评论(0) 推荐(0) 编辑
摘要: 首先可以用fgets读取一行,用辅助字符数组保存字母和在原数组的序号 http://blog.chinaunix.net/uid-22566367-id-381994.html http://blog.chinaunix.net/uid-21757287-id-327365.html 接下来有几种方 阅读全文
posted @ 2016-01-31 00:54 qlky 阅读(213) 评论(0) 推荐(0) 编辑
上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 43 下一页