2013年8月10日
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=1588splay tree 中的一些操作的说明:sc函数: inline void sc(int y,int x,int p) { 如果p==0,则y是x的父亲,x是y的左儿子; 如果p==1,则y是x的父亲,x是y的右儿子; }rot函数: inline void rot(int x) { y是x的父亲节点; 如果x是y的左儿子,则w=0;如果x是y的右儿子,则w=1; 设p是y的父亲; 对x,y,p进行zig或zag操作; } 效果:每次rot(x),x向根靠近一单位深度splay函数: vo 阅读全文
posted @ 2013-08-10 15:04 tobec 阅读(197) 评论(0) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=1503#include #include #include #include using namespace std;#define inf (1 tree[now].v; if(tree[now].chd[w]) now = tree[now].chd[w]; else { tree[++splaysz] = node(now,val); tree[now].chd[w]= splaysz; updat... 阅读全文
posted @ 2013-08-10 15:02 tobec 阅读(234) 评论(0) 推荐(0) 编辑
摘要: ACM国际大学生程序设计竞赛(ACM-ICPC)是国际上公认的水平最高、规模最大、影响最深的计算机专业竞赛,目前全球参与人数达20多万。《ACM国际大学生程序设计竞赛(ACM-ICPC)系列丛书:题目与解读》作者将16年的教练经验与积累撰写成本系列丛书,全面、深入而系统地将ACM-ICPC展现给读者、本系列丛书包括《ACM国际大学生程序设计竞赛:知识与入门》、《ACM国际大学生程序设计竞赛:算法与实现》、《ACM国际大学生程序设计竞赛:题目与解读》、《ACM国际大学生程序设计竞赛:比赛与思考》等4册,其中《ACM国际大学生程序设计竞赛:知识与入门》介绍了ACM-ICPC的知识及其分类、进阶.. 阅读全文
posted @ 2013-08-10 12:13 tobec 阅读(1753) 评论(0) 推荐(0) 编辑
摘要: https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&category=214&page=show_problem&problem=1491We can generate a random string by generating a sequence of random characters and concatenating them together. Each character is chosen independently from the first 阅读全文
posted @ 2013-08-10 11:28 tobec 阅读(279) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=14&page=show_problem&problem=1229Problem FCouponsInput:standard inputOutput:standard outputTime Limit:2secondsMemory Limit:32 MBCoupons in cereal boxes are numbered1ton, and a set of one of each is required 阅读全文
posted @ 2013-08-10 11:16 tobec 阅读(757) 评论(0) 推荐(0) 编辑