• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
breakdawn
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理

2013年3月28日

http://www.pythonchallenge.com/
摘要: Python 2.7.2--------------------0print 2**38http://www.pythonchallenge.com/pc/def/map.html--------------------1import stringtran=string.maketrans(string.lowercase[:26],string.lowercase[2:26]+'ab')'map'.translate(tran)http://www.pythonchallenge.com/pc/def/ocr.html--------------------2 阅读全文
posted @ 2013-03-28 10:57 breakdawn 阅读(178) 评论(0) 推荐(0)
 
 

2012年10月5日

Topcoder srm log
摘要: practice 529 Oct.05.2012div2:[250]:[500]:1.stringstream 可以把字符串从空格分开,类似java的split(' ')2.sort的comp函数写在class里的时候需要是static,所以写在class外比较好3.strcmp是c的字符串比较函数,cpp中<,>,=,!=均被重载,也可以用string的成员函数compare[1000]:1.注意边界N=0,12.使用奇数和sqrt(N)是最明显的时间优化practice 530 Oct.06.2012div2:[250]:[500]:practice 531 J 阅读全文
posted @ 2012-10-05 21:23 breakdawn 阅读(130) 评论(0) 推荐(0)
 
 

2012年9月19日

网页解谜游戏存盘点
摘要: 1.http://riddle.arthurluk.net/2.http://www.csie.ntu.edu.tw/~b94102/game/game.htm 12关http://www.csie.ntu.edu.tw/~b94102/game/twofeet.htm16关http://www.csie.ntu.edu.tw/~b94102/game/iroha.htm 阅读全文
posted @ 2012-09-19 15:46 breakdawn 阅读(274) 评论(0) 推荐(0)
 
ch11
摘要: 1-4 initialize when using it 阅读全文
posted @ 2012-09-19 09:42 breakdawn 阅读(102) 评论(0) 推荐(0)
 
 

2012年9月16日

拿到最大宝石的概率
摘要: 题目大意说:有10个房间,每个房间内各有一个大小不同的宝石,如果前4个房间只看不拿,在后面的6个房间,发现一个比前面4个房间内的宝石都大的宝石就拿,否则拿最后一个,问拿到最大的宝石的概率?设最大宝石在第i个位置(i=1...10),应该是等概率的1/101.设 i = 5, p =12.i=6...10,需要考虑前i-1个位置上的宝石大小,假设前i-1个宝石中最大的(max(i-1))不在前四位中,则因为这个宝石(max(i-1))在最大的宝石(max(10))前面,且(max(i-1))大于前四个中的任一个,所以取不到最大(max(10)),相反max(i-1)在前四个位置则可以取到最大宝石 阅读全文
posted @ 2012-09-16 00:03 breakdawn 阅读(278) 评论(0) 推荐(0)
 
 

2012年9月14日

ch10
摘要: 2-6 元素可以重复?2-8 head需要记下的信息有head的location,prev[head] and next[head] ---> next[x] = np[x] XOR prev{location}, head的location知道,所以可以递归的求出所有元素的location. reverse只需要交换prev[head] and next[head]的值3-4 需要存下“array中最靠后”的node的location,设为last,allocate is easy. free(x)---->swap(x,last), last--3-5 ? 阅读全文
posted @ 2012-09-14 09:35 breakdawn 阅读(132) 评论(0) 推荐(0)
 
 

公告


博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3