09 2013 档案

HDUOJ----(1175)连连看
摘要:连连看Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 14847 Accepted Submission(s): 3880 Problem Description“连连看”相信很多人都玩过。没玩过也没关系,下面我给大家介绍一下游戏规则:在一个棋盘中,放了很多的棋子。如果某两个相同的棋子,可以通过一条线连起来(这条线不能经过其它棋子),而且线的转折次数不超过两次,那么这两个棋子就可以在棋盘上消去。不好意思,由于我以前没有玩过连连看,咨询了 阅读全文

posted @ 2013-09-29 23:20 龚细军 阅读(357) 评论(0) 推荐(0) 编辑

HDUOJ-----(1072)Nightmare(bfs)
摘要:NightmareTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5795 Accepted Submission(s): 2868 Problem DescriptionIgnatius had a nightmare last night. He found himself in a labyrinth with a time bomb on him. The labyrinth has an exit, Ignatius should 阅读全文

posted @ 2013-09-28 22:41 龚细军 阅读(239) 评论(0) 推荐(0) 编辑

deque容器的运用一点一点积累
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 int main() 8 { 9 int a;10 dequestr;11 for(int i=0;i>a;14 str.push_back(a);15 }16 for(deque::iterator j=str.begin();j!=str.end();j++)17 cout<<*j;18 return 0;19 }上面的代码实现输入输出....... 阅读全文

posted @ 2013-09-28 21:29 龚细军 阅读(287) 评论(0) 推荐(0) 编辑

HDUOJ----(1016)Prime Ring Problem
摘要:Prime Ring ProblemTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 21151 Accepted Submission(s): 9465 Problem DescriptionA ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum o 阅读全文

posted @ 2013-09-26 21:57 龚细军 阅读(277) 评论(0) 推荐(0) 编辑

HDUOJ----Safecracker(1015)
摘要:SafecrackerTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 6779 Accepted Submission(s): 3370 Problem Description=== Op tech briefing, 2002/11/02 06:42 CST === "The item is locked in a Klein safe behind a painting in the second-floor library. 阅读全文

posted @ 2013-09-25 22:42 龚细军 阅读(345) 评论(0) 推荐(0) 编辑

hduoj---Tempter of the Bone
摘要:Tempter of the BoneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 55812 Accepted Submission(s): 15052 Problem DescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to sha 阅读全文

posted @ 2013-09-23 22:38 龚细军 阅读(318) 评论(0) 推荐(0) 编辑

VC6.0设置注释快捷键
摘要:第一步:工具栏上右键选择Customize(定制),选择“Add-ins and Macro Files(附加项和宏文件)”页,把SAMPLE前面打上钩。第二步:选择“Commands(命令)”页,Category(类别)选Macros,然后在Commands中把CommentOut(注释)拖曳到工具栏快捷方式。第三步:选择“Keyboard(键盘)”tab页,还是Category(工具栏)选Macros,选中CommentOut(注释),然后换到“Press new shortcut key(设置快捷键)”,设置快捷键ALT+/,单击分配后确认即完成设置。第四部 退出即可.... 阅读全文

posted @ 2013-09-22 21:59 龚细军 阅读(1517) 评论(0) 推荐(1) 编辑

nyoj------------找球号(一)
摘要:找球号(一)时间限制:3000 ms | 内存限制:65535 KB难度:3描述在某一国度里流行着一种游戏。游戏规则为:在一堆球中,每个球上都有一个整数编号i(0 3 #include 4 using namespace std; 5 int main() 6 { 7 int m,n,i,c; 8 setstr; 9 cin>>m>>n;10 for(i=0;i>c;13 str.insert(c);14 }15 for(i=0;i>c;18 if(str.find(c)==str.end())19 cout<<"NO"< 阅读全文

posted @ 2013-09-20 21:21 龚细军 阅读(435) 评论(0) 推荐(0) 编辑

set 容器 的全解(转)
摘要:1.关于setC++ STL 之所以得到广泛的赞誉,也被很多人使用,不只是提供了像vector, string, list等方便的容器,更重要的是STL封装了许多复杂的数据结构算法和大量常用数据结构操作。vector封装数组,list封装了链表,map和set封装了二叉树等,在封装这些数据结构的时候,STL按照程序员的使用习惯,以成员函数方式提供的常用操作,如:插入、排序、删除、查找等。让用户在STL使用过程中,并不会感到陌生。关于set,必须说明的是set关联式容器。set作为一个容器也是用来存储同一数据类型的数据类型,并且能从一个数据集合中取出数据,在set中每个元素的值都唯一,而且系统能 阅读全文

posted @ 2013-09-20 20:35 龚细军 阅读(405) 评论(0) 推荐(0) 编辑

nyoj------擅长排列的小明
摘要:擅长排列的小明时间限制:1000 ms | 内存限制:65535 KB难度:4描述小明十分聪明,而且十分擅长排列计算。比如给小明一个数字5,他能立刻给出1-5按字典序的全排列,如果你想为难他,在这5个数字中选出几个数字让他继续全排列,那么你就错了,他同样的很擅长。现在需要你写一个程序来验证擅长排列的小明到底对不对。输入第一行输入整数N(1 2 #include 3 #include 4 #include 5 using namespace std; 6 int str[12]={1,2,3,4,5,6,7,8,9,10},maze[12]; 7 int main() 8 { 9 int t.. 阅读全文

posted @ 2013-09-20 20:05 龚细军 阅读(323) 评论(1) 推荐(0) 编辑

strcpy和memcpy的区别
摘要:strcpy和memcpy都是标准C库函数,它们有下面的特点。 strcpy提供了字符串的复制。即strcpy只用于字符串复制,并且它不仅复制字符串内容之外,还会复制字符串的结束符。已知strcpy函数的原型是:char* strcpy(char* dest, const char* src); memcpy提供了一般内存的复制。即memcpy对于需要复制的内容没有限制,因此用途更广。 void *memcpy( void *dest, const void *src, size_t count );?char * strcpy(char * dest, const char * src) / 阅读全文

posted @ 2013-09-20 19:22 龚细军 阅读(678) 评论(0) 推荐(0) 编辑

nyoj-----D的小L
摘要:D的小L时间限制:4000 ms | 内存限制:65535 KB难度:2描述 一天TC的匡匡找ACM的小L玩三国杀,但是这会小L忙着哩,不想和匡匡玩但又怕匡匡生气,这时小L给匡匡出了个题目想难倒匡匡(小L很D吧),有一个数n(0 2 #include 3 #include 4 using namespace std; 5 int main() 6 { 7 int n,t,i; 8 int str[]={1,2,3,4,5,6,7,8,9,10}; 9 scanf("%d",&t);10 while(t--)11 {12 scanf("%d",&a 阅读全文

posted @ 2013-09-20 17:21 龚细军 阅读(229) 评论(0) 推荐(0) 编辑

HDUOJ---The Moving Points
摘要:The Moving PointsTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 612 Accepted Submission(s): 250 Problem DescriptionThere are N points in total. Every point moves in certain direction and certain speed. We want to know at what time that the large 阅读全文

posted @ 2013-09-16 07:54 龚细军 阅读(281) 评论(0) 推荐(0) 编辑

HDUOJ---------Kia's Calculation
摘要:Kia's CalculationTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 624 Accepted Submission(s): 178 Problem DescriptionDoctor Ghee is teaching Kia how to calculate the sum of two integers. But Kia is so careless and alway forget to carry a numbe 阅读全文

posted @ 2013-09-12 23:18 龚细军 阅读(352) 评论(0) 推荐(0) 编辑

HDUOJ----Good Numbers
摘要:Good NumbersTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 673 Accepted Submission(s): 242 Problem DescriptionIf we sum up every digit of a number and the result can be exactly divided by 10, we say this number is a good number. You are required 阅读全文

posted @ 2013-09-12 20:10 龚细军 阅读(352) 评论(1) 推荐(0) 编辑

DP较为完整的知识
摘要:1 数位DP 2 3 4 这类题,才刚刚接触,记得去年网络赛,就有道这样的题,我完全不会, 5 6 对于这类题基本方法是,是利用数的位数来构造转移方程。 7 8 下面给出两篇论文的链接: 9 10 《数位计数问题解法研究》11 12 《浅谈数位类统计问题》13 14 下面给出某位大牛关于此类题报告的链接:15 16 http://www.cppblog.com/Yuan/archive/2011/07/15/139299.html17 18 FOJ 204219 20 http://acm.fzu.edu.cn/problem.php?pid=204221 22 解法23 24 h... 阅读全文

posted @ 2013-09-11 22:50 龚细军 阅读(278) 评论(0) 推荐(0) 编辑

HDUOJ----The Number Off of FFF
摘要:The Number Off of FFFTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 169 Accepted Submission(s): 83 Problem DescriptionX soldiers from the famous "*FFF* army" is standing in a line, from left to right. You, as the captain of *FFF*, deci 阅读全文

posted @ 2013-09-11 19:03 龚细军 阅读(296) 评论(0) 推荐(0) 编辑

HDUOJ-------Naive and Silly Muggles
摘要:Naive and Silly MugglesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 61 Accepted Submission(s): 39 Problem DescriptionThree wizards are doing a experiment. To avoid from bothering, a special magic is set around them. The magic forms a circle, w 阅读全文

posted @ 2013-09-11 18:57 龚细军 阅读(402) 评论(0) 推荐(0) 编辑

HDUOJ----A Computer Graphics Problem
摘要:A Computer Graphics ProblemTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 92 Accepted Submission(s): 80 Problem DescriptionIn this problem we talk about the study of Computer Graphics. Of course, this is very, very hard. We have designed a new m 阅读全文

posted @ 2013-09-11 18:50 龚细军 阅读(283) 评论(0) 推荐(0) 编辑

HDUOJ---(4708)Herding
摘要:HerdingTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 937 Accepted Submission(s): 254 Problem DescriptionLittle John is herding his father's cattles. As a lazy boy, he cannot tolerate chasing the cattles all the time to avoid unnecessary omi 阅读全文

posted @ 2013-09-10 23:08 龚细军 阅读(297) 评论(0) 推荐(0) 编辑

HDUOJ---(4708)Rotation Lock Puzzle
摘要:Rotation Lock PuzzleTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 695 Accepted Submission(s): 204 Problem DescriptionAlice was felling into a cave. She found a strange door with a number square matrix. These numbers can be rotated around the ce 阅读全文

posted @ 2013-09-10 21:05 龚细军 阅读(357) 评论(1) 推荐(0) 编辑

(随机算法)
摘要:如何测试洗牌程序 我希望本文有助于你了解测试软件是一件很重要也是一件不简单的事。我们有一个程序,叫ShuffleArray(),是用来洗牌的,我见过N多千变万化的ShuffleArray(),但是似乎从来没人去想过怎么去测试这个算法。所以,我在面试中我经常会问应聘者如何测试ShuffleArray(),没想到这个问题居然难倒了很多有多年编程经验的人。对于这类的问题,其实,测试程序可能比算法更难写,代码更多。而这个问题正好可以加强一下我在《我们需要专职的QA吗?》中我所推崇的——开发人员更适合做测试的观点。我们先来看几个算法(第一个用递归二分随机抽牌,第二个比较偷机取巧,第三个比较通俗易懂)递归 阅读全文

posted @ 2013-09-10 13:39 龚细军 阅读(443) 评论(0) 推荐(0) 编辑

HDUOJ---Hamming Distance(4712)
摘要:Hamming DistanceTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 65535/65535 K (Java/Others) Total Submission(s): 916Accepted Submission(s): 335 Problem Description(From wikipedia) For binary strings a and b the Hamming distance is equal to the number of ones in a XOR b. For calculating Hamming d 阅读全文

posted @ 2013-09-10 13:28 龚细军 阅读(278) 评论(0) 推荐(0) 编辑

HDUOJ-----Difference Between Primes
摘要:Difference Between PrimesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 832 Accepted Submission(s): 267 Problem DescriptionAll you know Goldbach conjecture.That is to say, Every even integer greater than 2 can be expressed as the sum of two prim 阅读全文

posted @ 2013-09-09 21:56 龚细军 阅读(378) 评论(0) 推荐(0) 编辑

HDUOJ----(4706)Children's Day
摘要:Children's DayTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 248 Accepted Submission(s): 140 Problem DescriptionToday is Children's Day. Some children ask you to output a big letter 'N'. 'N' is constituted by two vertical 阅读全文

posted @ 2013-09-09 00:08 龚细军 阅读(271) 评论(0) 推荐(0) 编辑

poj-------Common Subsequence(poj 1458)
摘要:Common SubsequenceTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 34477Accepted: 13631DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = is a subsequence of X if there exists a strictly .. 阅读全文

posted @ 2013-09-08 16:09 龚细军 阅读(329) 评论(0) 推荐(0) 编辑

poj----Maximum sum(poj 2479)
摘要:Maximum sumTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 30704Accepted: 9408DescriptionGiven a set of n integers: A={a1, a2,..., an}, we define a function d(A) as below:Your task is to calculate d(A).InputThe input consists of T( 2 #include 3 #define maxn 50001 4 #include 5 using namespac 阅读全文

posted @ 2013-09-08 15:48 龚细军 阅读(561) 评论(0) 推荐(0) 编辑

scanf/sscanf %[]格式控制串的用法(转)
摘要:scanf/sscanf %[]格式控制串的用法 scanf中一种很少见但很有用的转换字符:[...]和[ ^...]。 #include int main() { char strings[100]; scanf("%[1234567890]",strings); printf("%s",strings); return 0; } 运行,输入:1234werew后,结果是:1234。 通过运行可以发现它的作用是:如果输入的字符属于方括号内字符串中某个字符,那么就提取该字符;如果一经发现不属于就结束提取。该方法会自动加上一个字符串结束符到已经提取的字符后 阅读全文

posted @ 2013-09-07 07:05 龚细军 阅读(1771) 评论(1) 推荐(0) 编辑

HDUOJ--------Text Reverse
摘要:Text ReverseTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 13449 Accepted Submission(s): 5140 Problem DescriptionIgnatius likes to write words in reverse way. Given a single line of text which is written by Ignatius, you should reverse all the w 阅读全文

posted @ 2013-09-06 21:56 龚细军 阅读(316) 评论(0) 推荐(0) 编辑

HDUOJ---hello Kiki
摘要:Hello KikiTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1717 Accepted Submission(s): 599 Problem DescriptionOne day I was shopping in the supermarket. There was a cashier counting coins seriously when a little kid running and singing "门前大桥 阅读全文

posted @ 2013-09-06 20:49 龚细军 阅读(462) 评论(0) 推荐(0) 编辑

HDUOJ-----X问题
摘要:X问题Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2587 Accepted Submission(s): 817 Problem Description求在小于等于N的正整数中有多少个X满足:X mod a[0] = b[0], X mod a[1] = b[1], X mod a[2] = b[2], …, X mod a[i] = b[i], … (0 2 #define LL long long 3 #include 4 us. 阅读全文

posted @ 2013-09-05 21:27 龚细军 阅读(250) 评论(0) 推荐(0) 编辑

POJ-----C Looooops
摘要:C LooooopsTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 15282Accepted: 3893DescriptionA Compiler Mystery: We are given a C-language style for loop of typefor (variable = A; variable != B; variable += C) statement;I.e., a loop which starts by setting variable to value A and while variabl.. 阅读全文

posted @ 2013-09-05 20:01 龚细军 阅读(402) 评论(0) 推荐(0) 编辑

POJ--Strange Way to Express Integers
摘要:Strange Way to Express IntegersTime Limit: 1000MSMemory Limit: 131072KTotal Submissions: 8370Accepted: 2508DescriptionElina is reading a book written by Rujia Liu, which introduces a strange way to express non-negative integers. The way is described as following:Choose k different positive integers 阅读全文

posted @ 2013-09-05 13:48 龚细军 阅读(410) 评论(0) 推荐(0) 编辑

HDUOJ----More is better(并查集)
摘要:More is betterTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 327680/102400 K (Java/Others) Total Submission(s): 10473 Accepted Submission(s): 3877 Problem DescriptionMr Wang wants some boys to help him with a project. Because the project is rather complex, the more boys come, the better it wil 阅读全文

posted @ 2013-09-04 19:30 龚细军 阅读(318) 评论(0) 推荐(0) 编辑

HDUOJ 1099——Lottery
摘要:LotteryTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2061Accepted Submission(s): 941 Problem DescriptionEddy's company publishes a kind of lottery.This set of lottery which are numbered 1 to n, and a set of one of each is required for a priz 阅读全文

posted @ 2013-09-04 10:30 龚细军 阅读(388) 评论(0) 推荐(0) 编辑

HDUOJ-----取(m堆)石子游戏
摘要:取(m堆)石子游戏Time Limit : 3000/1000ms (Java/Other)Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 2Accepted Submission(s) : 2Problem Descriptionm堆石子,两人轮流取.只能在1堆中取.取完者胜.先取者负输出No.先取者胜输出Yes,然后输出怎样取子.例如5堆 5,7,8,9,10先取者胜,先取者第1次取时可以从有8个的那一堆取走7个剩下1个,也可以从有9个的中那一堆取走9个剩下0个,也可以从有10个的中那一堆取走7个剩下3个.Inpu 阅读全文

posted @ 2013-09-03 13:33 龚细军 阅读(307) 评论(0) 推荐(0) 编辑

HDUOJ-----Be the Winner
摘要:1 此题用到的概念: 【定义1】:若一堆中仅有一个石子,则被称为孤单堆。若大于1个,则称为充裕堆。 【定义2】:T态中,若充裕堆的堆数大于等于2,则称为完全利他态,用T2表示;若充裕堆的堆数等于0,则称为部分利他态。用T0表示。 孤单堆的根数异或智慧影响二进制的最后以为,但充裕堆会影响高位(非最后一位)。一个充裕堆,高位必有一位不为0,则所有根数异或不为0。故不会是T态。 【定理1】:S0态,即仅有奇数个孤单堆,必败。T0态必胜。 证明:S0态,其实就是每次只能取一根。每次第奇数根都由自己取,第偶数根都由对方取,所以最后一根必由自己取。所以必败。同理:T0态必胜。 【定理2】:... 阅读全文

posted @ 2013-09-02 22:12 龚细军 阅读(363) 评论(1) 推荐(0) 编辑

HDUOJ-------- Fibonacci again and again
摘要:Fibonacci again and againTime Limit : 1000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 5 Accepted Submission(s) : 2Problem Description任何一个大学生对菲波那契数列(Fibonacci numbers)应该都不会陌生,它是这样定义的: F(1)=1; F(2)=2; F(n)=F(n-1)+F(n-2)(n>=3); 所以,1,2,3,5,8,13……就是菲波那契数列。 在HDOJ上 阅读全文

posted @ 2013-09-02 21:47 龚细军 阅读(633) 评论(0) 推荐(0) 编辑

HDUOJ----Good Luck in CET-4 Everybody!
摘要:Good Luck in CET-4 Everybody!Time Limit : 1000/1000ms (Java/Other)Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 2Accepted Submission(s) : 2Problem Description大学英语四级考试就要来临了,你是不是在紧张的复习?也许紧张得连短学期的ACM都没工夫练习了,反正我知道的Kiki和Cici都是如此。当然,作为在考场浸润了十几载的当代大学生,Kiki和Cici更懂得考前的放松,所谓“张弛有道”就是这个意思。这不,Kik 阅读全文

posted @ 2013-09-02 10:44 龚细军 阅读(263) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示