摘要: //小哈面前有三个箱子,手上有1,2,3三张牌,规定能放小牌就放小牌,小哈放完最后一个箱子后,最后在箱子的牌能有几种排列?#include #include using namespace std;int a[10],book[10],n;void dfs(int step) //step表示站在第... 阅读全文
posted @ 2016-07-29 16:01 Lawliet__zmz 阅读(360) 评论(0) 推荐(0) 编辑
摘要: 一个没用到大数的进制转换的思想:http://www.cnblogs.com/phinecos/archive/2009/09/11/1564975.html二、八、十、十六进制转换(图解篇):http://www.cnblogs.com/gaizai/p/4233780.html题目连接:http... 阅读全文
posted @ 2016-07-28 17:36 Lawliet__zmz 阅读(147) 评论(0) 推荐(0) 编辑
摘要: RailsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 31441 Accepted: 12222DescriptionThere is a famous railway station in PopP... 阅读全文
posted @ 2016-07-27 16:10 Lawliet__zmz 阅读(178) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include //olower 将大写字母转换为小写字母#include using namespace std;map cnt;vector words;string biaozhun(const st... 阅读全文
posted @ 2016-07-27 09:34 Lawliet__zmz 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 1、迭代器是一种对象,它能够用来遍历STL容器中的部分或全部元素,每个迭代器对象代表容器中的确定的地址。迭代器修改了常规指针的接口,所谓迭代器是一种概念上的抽象:那些行为上象迭代器的东西都可以叫做迭代器。然而迭代器有很多不同的能力,它可以把抽象容器和通用算法有机的统一起来。2、迭代器提供一些基本操作... 阅读全文
posted @ 2016-07-26 21:49 Lawliet__zmz 阅读(132) 评论(0) 推荐(0) 编辑
摘要: The Blocks ProblemTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 5404 Accepted: 2314DescriptionMany areas of Computer Science use simple, a... 阅读全文
posted @ 2016-07-26 21:09 Lawliet__zmz 阅读(204) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std;int sum[1002];char str[1000];int main(){ while(scanf("%s",str)&&strcmp(str,"0")) { int len... 阅读全文
posted @ 2016-07-26 10:55 Lawliet__zmz 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 必须去掉前导0和后导0,一个特殊数据是对000.00这样的输出0#include#includeusing namespace std;int main(){ string r; int n,dianwei; const int R_LEN=150;//存下的极限数位大小 s... 阅读全文
posted @ 2016-07-26 09:16 Lawliet__zmz 阅读(156) 评论(0) 推荐(0) 编辑
摘要: Modular multiplication of polynomialsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 4516 Accepted: 2033DescriptionConsider po... 阅读全文
posted @ 2016-07-26 00:13 Lawliet__zmz 阅读(270) 评论(0) 推荐(0) 编辑
摘要: Word AmalgamationTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 9164 Accepted: 4375DescriptionIn millions of newspapers acros... 阅读全文
posted @ 2016-07-24 17:25 Lawliet__zmz 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 对多个字符串排序,比较函数用strcmp写,如string数组存储的多个字符串#include #include #include #include #include using namespace std;string s[110];bool cmp (string a, string b) { ... 阅读全文
posted @ 2016-07-24 16:16 Lawliet__zmz 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Hay PointsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6269 Accepted: 4006DescriptionEach employee of a bureaucracy has a j... 阅读全文
posted @ 2016-07-24 15:25 Lawliet__zmz 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 栈的存储结构分为顺序存储结构(用数组实现)和链表存储结构(用链表实现)相同点:从"数据结构"的角度看,它们都是线性结构,即数据元素之间的关系相同。不同点:栈(Stack)是限定只能在表的一端进行插入和删除操作的线性表。 队列(Queue)是限定只能在表的一端进行插入和在另一端进行删除操作的线性表。它... 阅读全文
posted @ 2016-07-24 10:14 Lawliet__zmz 阅读(169) 评论(0) 推荐(0) 编辑
摘要: TEX QuotesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 10056 Accepted: 5250DescriptionTEX is a typesetting language develop... 阅读全文
posted @ 2016-07-23 19:45 Lawliet__zmz 阅读(76) 评论(0) 推荐(0) 编辑
摘要: Inglish-Number TranslatorTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 5162 Accepted: 2027DescriptionIn this problem, you will be given on... 阅读全文
posted @ 2016-07-23 17:02 Lawliet__zmz 阅读(212) 评论(0) 推荐(0) 编辑
摘要: Numbers That CountTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 20129 Accepted: 6735Description"Kronecker's Knumbers" is a l... 阅读全文
posted @ 2016-07-23 16:24 Lawliet__zmz 阅读(170) 评论(0) 推荐(0) 编辑
摘要: C语言递归算法是怎么执行的#include void net(int);int main(){ net(1); return 0;}void net(int n){ printf("数字%d:n的地址是:%p\n", n, &n); if(n递归就是自己调用自己,例如... 阅读全文
posted @ 2016-07-22 22:42 Lawliet__zmz 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 有一串已经从小到大排好序的数 2 3 5 8 9 10 18 26 32。现需要往这串数中插入 6 使其得到的新序列仍符合从小到大排列。链表中的每一个结点只有两个部分。我们可以用一个数组 data 来存储每序列中的每一个数。那每一个数右边的数是谁,这一点该怎么解决呢?上一节中是使用指针来解决的,这里... 阅读全文
posted @ 2016-07-19 02:35 Lawliet__zmz 阅读(136) 评论(0) 推荐(0) 编辑
摘要: #include #include#includeusing namespace std;char *catstr(char *a,char *b){char *p=a,*q=b;while(*p) p++;while(*q)*p++=*q++;*p='\0';return a;}int main(... 阅读全文
posted @ 2016-07-03 16:22 Lawliet__zmz 阅读(883) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;int a[101],n;void quicksort(int left,int right){ int i,j,t,tmp; if(left>right) return ; //当i变为left值... 阅读全文
posted @ 2016-06-19 23:21 Lawliet__zmz 阅读(378) 评论(0) 推荐(0) 编辑
摘要: 1.#define INF (1ll<<60)-1 表示义INF的值为2^60-1 阅读全文
posted @ 2016-06-18 17:16 Lawliet__zmz 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 进制转换Problem Description输入一个十进制数N,将它转换成R进制数输出。 Input输入数据包含多个测试实例,每个测试实例包含两个整数N(32位整数)和R(210)。 Output为每个测试实例输出转换后的数,每个输出占一行。如果R大于10,则对应的数字规则参考16进制(比如,10... 阅读全文
posted @ 2016-06-18 17:09 Lawliet__zmz 阅读(140) 评论(0) 推荐(0) 编辑
摘要: find the nth digitTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11272 Accepted Submission... 阅读全文
posted @ 2016-06-05 17:09 Lawliet__zmz 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 一、概念时间复杂度是总运算次数表达式中受n的变化影响最大的那一项(不含系数)比如:一般总运算次数表达式类似于这样:a*2^n+b*n^3+c*n^2+d*n*lg(n)+e*n+fa ! =0时,时间复杂度就是O(2^n);a=0,b0 =>O(n^3);a,b=0,c0 =>O(n^2)依此类推e... 阅读全文
posted @ 2016-06-03 20:24 Lawliet__zmz 阅读(461) 评论(0) 推荐(0) 编辑
摘要: 一开始直接把case++写在输出位置,结果PE,以为是有什么问题,结果是自己在提交框在原来代码上没有覆盖,导致两段代码在一起提交上去,出现两个main函数当然PE了 sum<0有两种情况,当第一个数是小于0,就直接置为0,然后first的备胎tmp会+1,如果sum1是大于零的,但是到下一个数相加后 阅读全文
posted @ 2016-06-02 20:11 Lawliet__zmz 阅读(239) 评论(0) 推荐(0) 编辑