摘要: 重建二叉树参与人数:2411时间限制:1秒空间限制:32768K通过比例:18.41%最佳记录:0 ms|0K(来自心无杂念)题目描述输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。例如输入前序遍历序列{1,2,4,7,3,5,6,8}... 阅读全文
posted @ 2015-09-25 22:34 KindaCrazy 阅读(142) 评论(0) 推荐(0)
摘要: 从尾到头打印链表参与人数:4164时间限制:1秒空间限制:32768K通过比例:16.80%最佳记录:0 ms|0K(来自黄昏的足迹)题目描述输入一个链表,从尾到头打印链表每个节点的值。提交时间:2015-09-25 语言:C++ 运行时间:0ms 占用内存:8552K 状态:答案正确/* 遍... 阅读全文
posted @ 2015-09-25 21:29 KindaCrazy 阅读(95) 评论(0) 推荐(0)
摘要: 二维数组中的查找参与人数:5313时间限制:1秒空间限制:32768K通过比例:17.59%最佳记录:0 ms|0K(来自牛客游客)题目描述在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该... 阅读全文
posted @ 2015-09-25 21:16 KindaCrazy 阅读(114) 评论(0) 推荐(0)
摘要: 替换空格参与人数:5033时间限制:1秒空间限制:32768K通过比例:16.93%最佳记录:0 ms|0K(来自codeinniu)题目描述请实现一个函数,将一个字符串中的空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。提交... 阅读全文
posted @ 2015-09-25 20:56 KindaCrazy 阅读(150) 评论(0) 推荐(0)
摘要: I Love this Game!Time Limit:1000MSMemory Limit:10000KTotal Submissions:1270Accepted:458DescriptionA traditional game is played between two players on a pool of n numbers (not necessarily distinguishing ones).The first player will choose from the pool a number x1 lying in [a, b] (0 < a < b), wh 阅读全文
posted @ 2012-04-20 11:33 KindaCrazy 阅读(290) 评论(0) 推荐(0)
摘要: pku2234 Matches game!!!!!hdu1846 brave game. if(n%(m+1)==0)n是必败点 !!!!!!pku2484 A Funny Game. if(n>=3)n是必败点 !!!!!!hdu1851 A Simple Game!!!!!!for(i=1,s=0;i<=n;i++){scanf("%d%d",&m,&l);s^=m%(l+1);}hdu1847 GoodLuck in CET-4 Everybody.if(n%3==0)n是必败点hdu1730 Northcott Gamehdu1517 A 阅读全文
posted @ 2012-04-19 23:41 KindaCrazy 阅读(210) 评论(0) 推荐(0)
摘要: NimTime Limit:1000MSMemory Limit:30000KTotal Submissions:795Accepted:453DescriptionLet's play a traditional game Nim. You and I are seated across a table and we have a hundred stones on the table (we know the number of stones exactly). We play in turn and at each turn, you or I can remove on to 阅读全文
posted @ 2012-04-19 23:30 KindaCrazy 阅读(219) 评论(0) 推荐(0)
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1757矩阵快速幂/*If x < 10 f(x) = x.If x >= 10 f(x) = a0 * f(x-1) + a1 * f(x-2) + a2 * f(x-3) + …… + a9 * f(x-10);|f(10) | |a0 a1 a2 ...a8 a9| |f(9)|| f(9) | | 1 0 0 ... 0 0| |f(8)|| .....| = |.. ... ... ... ..| | .. || f(2) | | 0 0 0 ... 阅读全文
posted @ 2012-04-16 21:50 KindaCrazy 阅读(174) 评论(0) 推荐(0)
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2824欧拉函数+预处理题目大意:给定两个整数a,b,计算a、b之间的欧拉函数值。算法分析:定义:对于正整数n,φ(n)是小于或等于n的正整数中,与n互质的数的数目。 例如:φ(8) = 4,因为1,3,5,7均和8互质。性质:1.若p是质数,φ(p) = p-1. 2.若n是质数p的k次幂,φ(n) = (p-1)*p^(k-1)。因为除了p的倍数都与n互质 3.欧拉函数是积性函数,若m,n互质,φ(mn) =φ(m)φ(n). 根据这3条性质我们就可以推出一个整数的欧拉函数的公式。因为一个数... 阅读全文
posted @ 2012-04-16 14:49 KindaCrazy 阅读(269) 评论(0) 推荐(0)