随笔分类 -  模版

摘要:题目描述 操作给定的二叉树,将其变换为源二叉树的镜像。 输入描述: 二叉树的镜像定义:源二叉树 8 / \ 6 10 / \ / \ 5 7 9 11 镜像二叉树 8 / \ 10 6 / \ / \ 11 9 7 5 #include <iostream> #include <cstdio> #i 阅读全文
posted @ 2018-05-09 15:20 Lincy*_* 阅读(197) 评论(0) 推荐(0)
摘要:#include #include #include #include #include #include #include using namespace std; //十进制n转r进制 void turnTor(long long n,int r) { int a[1000]; int t; int i=0; while(n>0) { ... 阅读全文
posted @ 2018-04-16 11:18 Lincy*_* 阅读(169) 评论(0) 推荐(0)
摘要:BF的生日快到了,这一次,小东决定为BF送一份特别的生日礼物为其庆生。作为高智商中的佼佼者,BF在国外求学,因此小东无法与之一起庆生。小东计划送一个生日卡片,并通过特别的包装让BF永远难忘。 她决定把卡片套装在一系列的信封A = {a1, a2, ..., an}中。小东已经从商店中购买了很多的信封 阅读全文
posted @ 2018-03-21 20:04 Lincy*_* 阅读(441) 评论(0) 推荐(0)
摘要:string类的大部分函数:begin 得到指向字符串开头的Iteratorend 得到指向字符串结尾的Iteratorrbegin 得到指向反向字符串开头的Iteratorrend 得到指向反向字符串结尾的Iteratorsize 得到字符串的大小length 和size函数功能相同max_siz 阅读全文
posted @ 2017-11-16 15:47 Lincy*_* 阅读(357) 评论(0) 推荐(0)
摘要:1.容器的创建,删除 3 两vector 容易赋值时,不能通过=来赋值而应使用遍历 或assign函数的方式来赋值 4 在vector中查找 阅读全文
posted @ 2017-03-23 17:28 Lincy*_* 阅读(415) 评论(0) 推荐(0)
摘要:康托展开的公式是 X=an*(n-1)!+an-1*(n-2)!+...+ai*(i-1)!+...+a2*1!+a1*0! 其中,ai为当前未出现的元素中是排在第几个(从0开始)。 这个公式可能看着让人头大,最好举个例子来说明一下。例如,有一个数组 s = ["A", "B", "C", "D"... 阅读全文
posted @ 2015-11-08 21:21 Lincy*_* 阅读(2078) 评论(0) 推荐(0)
摘要:亲和串Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9869 Accepted Submission(s): 4517Problem Descr... 阅读全文
posted @ 2015-08-24 10:37 Lincy*_* 阅读(218) 评论(0) 推荐(0)
摘要:1120: 病毒Time Limit: 3 SecMemory Limit: 128 MBSubmit: 620Solved: 255[Submit][Status][Web Board] Description你有一个日志文件,里面记录着各种系统事件的详细信息。自然的,事件的时间戳按照严格递增顺序... 阅读全文
posted @ 2015-08-22 18:18 Lincy*_* 阅读(257) 评论(0) 推荐(0)
摘要:Simpsons’ Hidden Talents Homer: Marge, I just figured out a way to discover some of the talents we weren’t aware we had.Marge: Yeah, what is it?Homer: 阅读全文
posted @ 2015-08-22 17:52 Lincy*_* 阅读(294) 评论(0) 推荐(1)
摘要:Number SequenceTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 13207 Accepted Submission(s): 597 阅读全文
posted @ 2015-08-22 17:50 Lincy*_* 阅读(181) 评论(0) 推荐(0)
摘要:1503: 点到圆弧的距离Time Limit: 1 SecMemory Limit: 128 MBSpecial JudgeSubmit: 400Solved: 88[Submit][Status][Web Board] Description输入一个点P和一条圆弧(圆周的一部分),你的任务是计算... 阅读全文
posted @ 2015-08-22 17:32 Lincy*_* 阅读(529) 评论(0) 推荐(0)
摘要:G. February 29Time Limit: 1000msMemory Limit: 131072KB64-bit integer IO format: %lld Java class name: Main Submit Status [PDF Link]GFebruary 29It is ... 阅读全文
posted @ 2015-08-22 17:00 Lincy*_* 阅读(294) 评论(0) 推荐(0)
摘要:1113: Updating a DictionaryTime Limit: 1 SecMemory Limit: 128 MBSubmit: 544Solved: 134[Submit][Status][Web Board] DescriptionIn this problem, a dictio... 阅读全文
posted @ 2015-08-22 16:57 Lincy*_* 阅读(228) 评论(0) 推荐(0)
摘要:例题hduJudgingTroubles#include struct node //必须是结构体{ char ch[20];};node ch1[100005],ch2[100005];int comp(node a,node b){ return strcmp(a.ch,b.ch)... 阅读全文
posted @ 2015-08-22 16:27 Lincy*_* 阅读(133) 评论(0) 推荐(0)
摘要:分析一下上面那个图看能得出什么规律: 据图可知:c1=a1,c2=a1+a2,c3=a3,c4=a1+a2+a3+a4,c5=a5,c6=a5+a6,c7=a7,c8=a1+a2+a3+a4+a5+a6+a7+a8,c9=a9,c10=a9+a10,c11=a11........c16=a1+a2+... 阅读全文
posted @ 2015-08-22 16:25 Lincy*_* 阅读(131) 评论(0) 推荐(0)
摘要://n个t相乘,对mod取余long long ksm(int q,int n){ long long s=1,t=q; while(n>0) { if(n%2!=0) { n=n-1; s=s*t%mod; ... 阅读全文
posted @ 2015-08-22 16:21 Lincy*_* 阅读(95) 评论(0) 推荐(0)
摘要:#include#includeint next[100];void set_next(char ch[]) //带入子串{ int len,j,i; len=strlen(ch); next[0]=-1; j=-1; i=0; while(i0)//str为母... 阅读全文
posted @ 2015-08-22 16:19 Lincy*_* 阅读(147) 评论(0) 推荐(0)
摘要://公约数之和打表#include #include #include using namespace std;int a[200005];int main(){ memset(a,0,sizeof(a)); for(int i=1;i#include #include using na... 阅读全文
posted @ 2015-08-22 16:18 Lincy*_* 阅读(337) 评论(0) 推荐(0)
摘要:double chaji(double ax,double ay,double bx,double by,double cx,double cy) //两条线段斜率的差,double !!!{ return (by-ay)*(cx-ax)-(cy-ay)*(bx-ax);}void co... 阅读全文
posted @ 2015-08-22 16:15 Lincy*_* 阅读(284) 评论(0) 推荐(0)
摘要://用队列#include #include #include #include using namespace std;int x1,x2,y2,x3,y3,y1;int dir[8][2]= {0,1,0,-1,-1,0,1,0,1,1,1,-1,-1,1,-1,-1};int mark[10]... 阅读全文
posted @ 2015-08-22 16:12 Lincy*_* 阅读(159) 评论(0) 推荐(0)