随笔分类 -  Sorting/Searching

摘要:这道题是给出一个n 求出分子分母 7 #include 8 #include 9 #include10 #include11 #include 12 #include13 #include14 #include15 #include 16 #include 17 using namespace std;18 19 int N;20 21 int print(int au,int ad,int bu,int bd)22 {23 if(ad+bd>N;39 40 cout<<"0/1"<<endl;41 print(0,1,1,1);42 cout 阅读全文
posted @ 2014-02-10 22:39 doubleshik 阅读(192) 评论(0) 推荐(0)
摘要:题目意思就是通过一系列翻煎饼的动作让整个堆保持递增顺序在学习STL 从网上复制了别人的代码学习一下。。非常简洁题目:Stacks of FlapjacksBackgroundStacks and Queues are often considered the bread and butter of data structures and find use in architecture, parsing, operating systems, and discrete event simulation. Stacks are also important in the theory of fo 阅读全文
posted @ 2013-11-23 16:14 doubleshik 阅读(184) 评论(0) 推荐(0)
摘要:题目大意就是给出一个字典,找出其中不能通过打乱字母顺序后组成新单词的 那些单词(稍微有点绕)我写的相当繁琐,晚上回去要研究一下stl写法题目:AnanagramsMost crossword puzzle fans are used toanagrams--groups of words with the same letters in different orders--for example OPTS, SPOT, STOP, POTS and POST. Some words however do not have this attribute, no matter how you re 阅读全文
posted @ 2013-11-13 17:46 doubleshik 阅读(230) 评论(0) 推荐(0)
摘要:题目大意:找出三维坐标中一个点周围距离[1,2),[2,3),.....的点的个数学习了一下c++ 输出格式控制Tree's a CrowdDr William Larch, noted plant psychologist and inventor of the phrase ``Think like a tree--Think Fig'' has invented a new classification system for trees. This is a complicated system involving a series of measurements 阅读全文
posted @ 2013-10-18 15:24 doubleshik 阅读(351) 评论(0) 推荐(0)
摘要:题目大意: 找出一个数在给定的一组数中是第几小,如果不存在就输出notfound运用计数排序来找到第N小一开始做的时候一直错因为 cout 2 #include 3 #include 4 using namespace std; 5 const int maxn =100000; 6 7 int N,M; 8 9 int main()10 {11 int test=1;12 while(scanf("%d %d",&N,&M)==2)13 {14 if(N==0)break;15 int cc[maxn]={0};16 ... 阅读全文
posted @ 2013-10-18 00:02 doubleshik 阅读(189) 评论(0) 推荐(0)
摘要:题目大意就是找出国家名字出现了多少次然后排序 输出次数。练习了一下sscanfProblem BList of ConquestsInput:standard inputOutput:standard outputTime Limit:2 secondsIn Act I, Leporello is telling Donna Elvira about his master's long list of conquests:``This is the list of the beauties my master has loved, a list I've made out my 阅读全文
posted @ 2013-10-17 22:04 doubleshik 阅读(271) 评论(0) 推荐(0)