摘要: http://poj.org/problem?id=1562大意:输入mp二维矩阵,规定‘@’连体的包括对角线为一片油田,统计共有多少油田。深搜方向数组dir设置8个方向遇到@继续搜索把当前位置赋值*避免重复遍历即可#include #include #include using namespace... 阅读全文
posted @ 2016-11-11 01:33 Lawliet__zmz 阅读(170) 评论(0) 推荐(0) 编辑
摘要: Light, more light#include #include using namespace std;int main(){ double c; double n; int n1; while(cin>>c&&c){ n=sqrt(c); n1=n; ... 阅读全文
posted @ 2016-11-09 23:02 Lawliet__zmz 阅读(116) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2024是的,这题很简单,但是1A也不是那么容易,为什么把这么简单的题记录在博客呢,因为提醒自己要严谨,注意细节。分析:这题就是合法的命名规则。规定开头不能用数字,可以用大小写字母和下划线,下划线相当于字母一样,所以... 阅读全文
posted @ 2016-10-24 21:41 Lawliet__zmz 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=2406这道题在很久之前就做过,由于那时候还没有仔细研究KMP以及对next数组的理解,所以当时也是留下了这个问题,最近《数据结构》上到串,老师提到这个算法,但是没有讲,下来后,我觉得是时候看下这个算法了。题目大概意思就是求给出的字符串最... 阅读全文
posted @ 2016-10-22 16:35 Lawliet__zmz 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=3461大概意思就是标题那个意思,给样例数,给模式串,给主串,求模式串在主串出现的次数。数据量大,所以要用到KMP,然后简单变形下#include#include#includeusing namespace std;char T[100... 阅读全文
posted @ 2016-10-22 14:44 Lawliet__zmz 阅读(153) 评论(0) 推荐(0) 编辑
摘要: #include "iostream"#include "stdlib.h"#include using namespace std;int main(){// map, char>mp;// mp[{'a','a'}]='a;// cout > mp; mp['a']... 阅读全文
posted @ 2016-10-10 22:53 Lawliet__zmz 阅读(212) 评论(0) 推荐(0) 编辑
摘要: /*1.有一个单链表(不同结点的数据域值可能相同),其头指针为head,编写一个函数计算数据域为x的结点个数*/#include #include using namespace std;struct node{ int data; struct node *next; };struct no... 阅读全文
posted @ 2016-10-05 18:06 Lawliet__zmz 阅读(408) 评论(0) 推荐(0) 编辑
摘要: 相比SDK编程MFC中省了那么多代码是如何实现的?都调用了那些函数?顺序是什么?博主整理集合:一、MFC应用程序中处理消息的顺序1.AfxWndProc():该函数负责接收消息,找到消息所属的CWnd对象,然后调用 AfxCallWndProc2.AfxCallWndProc... 阅读全文
posted @ 2016-09-22 23:59 Lawliet__zmz 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://poj.org/problem?id=1061裸扩展欧几里德算法,可做模板根据题意可列出一个等式:(x+m*s) - (y+n*s) = k*L(k = 0,1,2,.....)变形后:(n-m)*s + k*L =x-y令 a = n - m,b = L,c = x - y,... 阅读全文
posted @ 2016-09-07 22:22 Lawliet__zmz 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 首先回顾下C语言在控制台下通过标准输入输出函数输出"Hello,world!"的程序, 代码如下#include int main(){ printf( "Hello,world!\n" ) ; return 0 ;}然后今天上了第一趟VC++课后,学会了Windows版Hello,wo... 阅读全文
posted @ 2016-09-05 23:44 Lawliet__zmz 阅读(331) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://poj.org/problem?id=2739、直接用筛选法打表,然后双重循环判断多个情况,符合就cnt++。#include #include #include #include using namespace std;const int maxn = 10000;int s... 阅读全文
posted @ 2016-09-02 22:18 Lawliet__zmz 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://poj.org/problem?id=1248题意:给定字符串,从字符串中选择字符转换成整形满足密码公式,要求输出结果按照最大字典序输出。因为没有重复的字符,所以最多有26个字符,5重循环直接暴力不会超时。注意的是排序的时候吧字符串从大到小排序扫描循环的时候vwxyz,且不能有... 阅读全文
posted @ 2016-08-31 17:06 Lawliet__zmz 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://poj.org/problem?id=1250 题意:有n个位置,每个字母第一次出现代表客人的进来,第二次出现代表离开 , 统计流失了几个客户 我一直纠结的是Tanning是什么意思?题目为简单题,不要想到队列和栈,完全模拟即能过。只是有一句话不好理解,“Customers w... 阅读全文
posted @ 2016-08-30 23:12 Lawliet__zmz 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 传送门:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=862&page=show_problem&problem=4813 只有1的时候,会出现Impossible; 当输入的数是奇数时,... 阅读全文
posted @ 2016-08-22 17:59 Lawliet__zmz 阅读(177) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2016-08-22 15:54 Lawliet__zmz 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 题目传送门:http://acm.split.hdu.edu.cn/search.php?action=listproblemsource: 2012 Asia Hangzhou Regional Contest移过来的题目数据变好弱了,测试量变少了把,有三道题直接暴力就可以过,原题提交TLE,笑尿... 阅读全文
posted @ 2016-08-19 17:16 Lawliet__zmz 阅读(148) 评论(0) 推荐(0) 编辑
摘要: T-Shirt GumboTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3161 Accepted: 1478DescriptionBoudreaux and Thibodeaux are student volunteers f... 阅读全文
posted @ 2016-08-19 16:48 Lawliet__zmz 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Dressing Time Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 14 Accepted Submission(s) : 7Problem ... 阅读全文
posted @ 2016-08-18 11:11 Lawliet__zmz 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Running RabbitsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1787 Accepted Submission(s):... 阅读全文
posted @ 2016-08-18 10:07 Lawliet__zmz 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 题目传送门: http://acm.split.hdu.edu.cn/search.php?action=listproblemsource:2012 Asia JinHua Regional Contest当年ranklist:http://board.acmicpc.info/icpc2012/... 阅读全文
posted @ 2016-08-18 08:52 Lawliet__zmz 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Crazy TankTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6047 Accepted Submission(s): 1318... 阅读全文
posted @ 2016-08-17 20:39 Lawliet__zmz 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Physical Examination Time Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 15 Accepted Submission(s)... 阅读全文
posted @ 2016-08-17 14:37 Lawliet__zmz 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 时间是8月14号中午12点到下午5点,比赛结束后关闭平台,不过题目被上传到HDU上了。传送门:点击打开链接 阅读全文
posted @ 2016-08-16 08:51 Lawliet__zmz 阅读(109) 评论(0) 推荐(0) 编辑
摘要: Selecting CoursesTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10183 Accepted: 4594DescriptionIt is well known that it is not easy to sele... 阅读全文
posted @ 2016-08-15 21:02 Lawliet__zmz 阅读(114) 评论(0) 推荐(0) 编辑
摘要: The Perfect StallTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 23153 Accepted: 10312DescriptionFarmer John completed his new... 阅读全文
posted @ 2016-08-15 16:18 Lawliet__zmz 阅读(137) 评论(0) 推荐(0) 编辑