会员
周边
捐助
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
canexjtuzju
记录
Powered by
博客园
博客园
|
首页
|
新随笔
|
联系
|
订阅
|
管理
上一页
1
···
14
15
16
17
18
19
20
21
22
23
下一页
2014年7月6日
STL源码--空间配置器(一)
摘要: 一、STL空间配置器allcator的主要接口allocatedeallocateconstructdestroy嵌套结构体:rebind这里稍微解释一下rebind的作用,常见用法如下,allocator::rebind::other;rebind主要是为了实现不同类型采用同样的内存分派的策略。例...
阅读全文
posted @ 2014-07-06 22:55 canexjtuzju
阅读(202)
评论(0)
推荐(0)
编辑
2014年6月27日
wioi 1043--方格取数
摘要: 题目描述:设有N*N的方格图(N 2 #include 3 #include 4 using namespace std; 5 6 int a[11][11]; 7 int dp[11][11][11][11]; 8 const int INF = 999999999; 9 10 int oper...
阅读全文
posted @ 2014-06-27 23:02 canexjtuzju
阅读(340)
评论(0)
推荐(0)
编辑
wikioi 1251--括号
摘要: 题目描述:给定n个变量,求乘积的表达式的个数。相邻元素相乘需要加*号。思路:直接递归即可,ans[i][j] = ans[i][k]+ans[k+1][j](i 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 u...
阅读全文
posted @ 2014-06-27 22:38 canexjtuzju
阅读(261)
评论(0)
推荐(0)
编辑
2014年6月26日
wikioi 1688--求逆序对
摘要: 题目描述:给定数组,求逆序对的个数思路:归并排序,归并的时候改变计数,当前面的元素比后面元素大则计数cnt+=(m-i)+1没有AC的版本 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #inclu...
阅读全文
posted @ 2014-06-26 22:47 canexjtuzju
阅读(138)
评论(0)
推荐(0)
编辑
wikioi 1497--求余运算
摘要: 题目描述:给定b,p,k要求(b^p)%k思路:主要是快速求幂运算,有递归和非递归两种思路。递归有错误,应该是溢出问题#include #include #include #include #include #include #include #include #include #include #...
阅读全文
posted @ 2014-06-26 22:12 canexjtuzju
阅读(171)
评论(0)
推荐(0)
编辑
面试金典--17.1
摘要: 题目描述:不用临时变量,直接交换两个数思路a = a+b;b = a- b;a = a-b 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #inclu...
阅读全文
posted @ 2014-06-26 20:53 canexjtuzju
阅读(93)
评论(0)
推荐(0)
编辑
面试金典--11.6
摘要: 题目描述:数组每行每列都是有序的,编写代码找到指定元素思路:(1)从数组右上角开始找,每次更新i,j(已经实现)(2)对每个元素,它必定是它右下角子二维数组的最小值,也必定是左上角子二维数组的最大值,这样可以减少规模,没有实现 1 #include 2 #include 3 #include ...
阅读全文
posted @ 2014-06-26 20:31 canexjtuzju
阅读(134)
评论(0)
推荐(0)
编辑
面试金典--11.5
摘要: 题目描述:给定排序后的字符串数组,中间有一些空串,要求找到给定字符串的位置思路:(1)遍历,最慢的(2)二分查找,当mid处为空串,就找到最近的非空串继续寻找。如果需要找空串?(单独处理) 1 #include 2 #include 3 #include 4 #include 5 ...
阅读全文
posted @ 2014-06-26 20:08 canexjtuzju
阅读(116)
评论(0)
推荐(0)
编辑
面试金典--11.2
摘要: 题目描述:给定一个字符串数组,将变位词排在相邻的位置思路:map即可这里发现一个问题,string用sort排序不能使引用,回头看看源码。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #inclu...
阅读全文
posted @ 2014-06-26 13:52 canexjtuzju
阅读(151)
评论(0)
推荐(0)
编辑
面试金典--11.3
摘要: 题目描述:给定一个数组,数组是由一个排好序的数组循环旋转得到的,现在要在数组中找给定值思路:(1)递归,二分查找,左右子数组肯定会有一个是排好序的,比较a[mid]与a[l]的大小之后,判断哪部分排好序,然后判断目标值在哪部分特殊情况是:2 2 2 3 2 2 2 2这种情况,中间元素与左边元素相同...
阅读全文
posted @ 2014-06-26 12:59 canexjtuzju
阅读(172)
评论(0)
推荐(0)
编辑
上一页
1
···
14
15
16
17
18
19
20
21
22
23
下一页