03 2016 档案
HDOJ 1070 Milk(水题,考英文的)
摘要:Problem Description Ignatius drinks milk everyday, now he is in the supermarket and he wants to choose a bottle of milk. There are many kinds... 阅读全文
posted @ 2016-03-31 20:01 cnxo 阅读(355) 评论(0) 推荐(0)
HDOJ 1061 Rightmost Digit(循环问题)
摘要:Problem Description Given a positive integer N, you should output the most right digit of N^N.Input The input contains several test cases. Th... 阅读全文
posted @ 2016-03-31 18:29 cnxo 阅读(168) 评论(0) 推荐(0)
HDOJ 1058 Humble Numbers(打表过)
摘要:Problem Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1... 阅读全文
posted @ 2016-03-31 13:08 cnxo 阅读(164) 评论(0) 推荐(0)
【8】JAVA---地址App小软件(AddrDaoFile .class)(数据层)
摘要:实现数据进行文件的存储和读写。 本软件也就到此结束了。 没多少可以讲的。 因为这个小软件也就8个类,主要学习的也就是一个分层思想的简单应用。package cn.hncu.addr.dao;import java.io.FileInputStream;import java.io.... 阅读全文
posted @ 2016-03-31 00:30 cnxo 阅读(465) 评论(0) 推荐(0)
【7】JAVA---地址App小软件(AddrBusiness.class)(逻辑层)
摘要:这个。。。没多少好解释的。。。 表现层的增删改查的具体实现类。package cn.hncu.addr.business;import javax.swing.JOptionPane;import cn.hncu.addr.dao.AddrDaoFile;import sun.se... 阅读全文
posted @ 2016-03-31 00:26 cnxo 阅读(249) 评论(0) 推荐(0)
【6】JAVA---地址App小软件(QueryPanel.class)(表现层)
摘要:查找模块: 年龄可进行段查找。 其他的都是模糊匹配。 空格为无用字符,会屏蔽的(除年龄)。 (如果在年龄中输入空格,会出现异常,当时没想到这点,要防护这点很容易的,但因为在这个小软件的编写过程,我主要学的是java项目开发的分层思想,软件可能bug比较多,望见谅。)/* * Que... 阅读全文
posted @ 2016-03-31 00:24 cnxo 阅读(293) 评论(0) 推荐(0)
【5】JAVA---地址App小软件(DeletePanel.class)(表现层)
摘要:删除地址的表现层类。 如果没有选中要删除的地址信息,会出现窗口提示: 删除地址界面:(无法修改数据,只能看) /* * DeletePanel.java * */package cn.hncu.addr.ui;import javax.swing.JFrame;import jav... 阅读全文
posted @ 2016-03-31 00:17 cnxo 阅读(170) 评论(0) 推荐(0)
【4】JAVA---地址App小软件(UpdatePanel.class)(表现层)
摘要:修改地址信息的一个表现层类。 必须选中地址,才能修改,否则会弹出窗口提示, 修改地址界面: /* * UpdatePanel.java * */package cn.hncu.addr.ui;import javax.swing.JFrame;import javax.swing.... 阅读全文
posted @ 2016-03-31 00:13 cnxo 阅读(363) 评论(0) 推荐(0)
【3】JAVA---地址App小软件(AddPanel.class)(表现层)
摘要:添加地址信息界面。年龄和地址必须是数字,否则会弹出窗口提示。 地址信息不能为空。 /* * AddPanel.java * * Created on __DATE__, __TIME__ */package cn.hncu.addr.ui;import javax.swing.JF... 阅读全文
posted @ 2016-03-31 00:07 cnxo 阅读(556) 评论(0) 推荐(0)
【2】JAVA---地址App小软件(ListPanel.class)(表现层)
摘要:这个是表现层的主界面。 /* * ListPanel.java * */package cn.hncu.addr.ui;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JList;impo... 阅读全文
posted @ 2016-03-31 00:01 cnxo 阅读(360) 评论(0) 推荐(0)
【1】JAVA---地址App小软件(AddressApp.class)(初步接触项目开发的分层思想)(表现层)
摘要:这个是表现层的main方法。 实现的地址信息有: 姓名,性别,年龄,电话,地址。 实现的功能有: 增加地址; 删除地址; 修改地址; 查找地址:其中年龄的查找为年龄段的查找。数据存储的方式为文件存储和读写。分层的思想是:表现层调用逻辑层,逻辑层调用数据层。不可以反过来每个class... 阅读全文
posted @ 2016-03-30 23:45 cnxo 阅读(334) 评论(0) 推荐(0)
HDOJ 1056 HangOver(水题)
摘要:Problem Description How far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a... 阅读全文
posted @ 2016-03-28 21:19 cnxo 阅读(181) 评论(0) 推荐(0)
HDOJ 1048 The Hardest Problem Ever(加密解密类)
摘要:Problem Description Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever faced was keeping himself alive. ... 阅读全文
posted @ 2016-03-28 16:43 cnxo 阅读(222) 评论(0) 推荐(0)
HDOJ 1028 Ignatius and the Princess III(递推)
摘要:Problem Description “Well, it seems the first problem is too easy. I will let you know how foolish you are later.” feng5166 says.“The second ... 阅读全文
posted @ 2016-03-27 12:30 cnxo 阅读(99) 评论(0) 推荐(0)
HDOJ 2114 Calculate S(n)(找周期)
摘要:Problem Description Calculate S(n).S(n)=1^3+2^3 +3^3 +……+n^3 .Input Each line will contain one integer N(1 < n < 1000000000). Process to end ... 阅读全文
posted @ 2016-03-25 15:53 cnxo 阅读(128) 评论(0) 推荐(0)
HDOJ 1017 A Mathematical Curiosity
摘要:Problem Description Given two integers n and m, count the number of pairs of integers (a,b) such that 0 0){ int p = 0; ... 阅读全文
posted @ 2016-03-24 21:21 cnxo 阅读(113) 评论(0) 推荐(0)
HDOJ 1014 Uniform Generator(公约数问题)
摘要:Problem Description Computer simulations often require random numbers. One way to generate pseudo-random numbers is via a function of the for... 阅读全文
posted @ 2016-03-24 20:37 cnxo 阅读(129) 评论(0) 推荐(0)
HDOJ 2117 Just a Numble(模拟除法)
摘要:Problem Description Now give you two integers n m, you just tell me the m-th number after radix point in 1/n,for example n=4,the first numble... 阅读全文
posted @ 2016-03-24 19:01 cnxo 阅读(247) 评论(0) 推荐(0)
HDOJ的题目分类
摘要:模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 1049 1050 1057 1062 1063 1064 1070 1073 1075... 阅读全文
posted @ 2016-03-24 18:43 cnxo 阅读(258) 评论(0) 推荐(0)
HDOJ 2200 Eddy's AC难题(数学组合概率题)
摘要:Problem Description Eddy是个ACMer,他不仅喜欢做ACM题,而且对于Ranklist中每个人的ac数量也有一定的研究,他在无聊时经常在纸上把Ranklist上每个人的ac题目的数量摘录下来,然后从中选择一部分人(或者全部)按照ac的数量分成两组进行比较,他... 阅读全文
posted @ 2016-03-24 18:31 cnxo 阅读(110) 评论(0) 推荐(0)
HDOJ 2131 Probability
摘要:Problem Description Mickey is interested in probability recently. One day , he played a game which is about probability with mini.First micke... 阅读全文
posted @ 2016-03-24 18:06 cnxo 阅读(166) 评论(0) 推荐(0)
HDOJ 2206 IP的计算(正则表达式的应用)
摘要:Problem Description 在网络课程上,我学到了很多有关IP的知识。IP全称叫网际协议,有时我们又用IP来指代我们的IP网络地址,现在IPV4下用一个32位无符号整数来表示,一般用点分方式来显示,点将IP地址分成4个部分,每个部分为8位,表示成一个无符号整数(因此不需... 阅读全文
posted @ 2016-03-24 13:29 cnxo 阅读(178) 评论(0) 推荐(0)
HDOJ 1287 破译密码(异或运算)
摘要:Problem Description 有个叫“猪头帮”的国家,采用一种简单的文法加密,他们所用的语言里面只有大写字母,没有其他任何字符;现在还知道他们加密的方法是:只用一个大写字母和原文进行异或运算生成密文。请你帮忙解开。Input 有若干组,每组输入有2行,第一行整数N表示有N... 阅读全文
posted @ 2016-03-24 11:01 cnxo 阅读(298) 评论(0) 推荐(0)
HDOJ 2089 不要62(打表)
摘要:Problem Description 杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。 杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。 不吉利的数字为所有含... 阅读全文
posted @ 2016-03-23 10:58 cnxo 阅读(109) 评论(0) 推荐(0)
HDOJ 2092 整数解(2次方程整数解公式)
摘要:Problem Description 有二个整数,它们加起来等于某个整数,乘起来又等于另一个整数,它们到底是真还是假,也就是这种整数到底存不存在,实在有点吃不准,你能快速回答吗?看来只能通过编程。 例如: x + y = 9,x * y = 15 ? 找不到这样的整数x和y 1+... 阅读全文
posted @ 2016-03-23 10:23 cnxo 阅读(263) 评论(0) 推荐(0)
HDOJ 1098 Ignatius's puzzle
摘要:Problem Description Ignatius is poor at math,he falls across a puzzle problem,so he has no choice but to appeal to Eddy. this problem describ... 阅读全文
posted @ 2016-03-22 11:20 cnxo 阅读(221) 评论(0) 推荐(0)
HDOJ 1097 A hard puzzle(循环问题)
摘要:Problem Description lcy gives a hard puzzle to feng5166,lwg,JGShining and Ignatius: gave a and b,how to know the a^b.everybody objects to thi... 阅读全文
posted @ 2016-03-21 20:17 cnxo 阅读(161) 评论(0) 推荐(0)
HDOJ 1019 Least Common Multiple(最小公倍数问题)
摘要:Problem Description The least common multiple (LCM) of a set of positive integers is the smallest positive integer which is divisible by all ... 阅读全文
posted @ 2016-03-21 14:44 cnxo 阅读(192) 评论(0) 推荐(0)
辗转相除法_欧几里得算法_java的实现(求最大公约数)
摘要:辗转相除法,又被称为欧几里德(Euclidean)算法, 是求最大公约数的算法。 当然也可以求最小公倍数。算法描述 两个数a,b的最大公约数记为GCD(a,b)。a,b的最大公约数是两个数的公共素因子的乘积。如462可以分解成2 × 3 × 7 × 11;1071可以分解成3 ×... 阅读全文
posted @ 2016-03-21 14:42 cnxo 阅读(1113) 评论(0) 推荐(0)
HDOJ 1020 Encoding
摘要:Problem Description Given a string containing only ‘A’ - ‘Z’, we could encode it using the following method: Each sub-string containing k sam... 阅读全文
posted @ 2016-03-21 10:51 cnxo 阅读(192) 评论(0) 推荐(0)
HDOJ 1018 Big Number(大数位数公式)
摘要:Problem Description In many applications very large integers numbers are required. Some of these applications are using keys for secure trans... 阅读全文
posted @ 2016-03-20 17:06 cnxo 阅读(186) 评论(0) 推荐(0)
HDOJ 1004 Let the Balloon Rise
摘要:Problem Description Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges’ favorite tim... 阅读全文
posted @ 2016-03-20 16:48 cnxo 阅读(136) 评论(0) 推荐(0)
HDOJ 1012 u Calculate e
摘要:Problem Description A simple mathematical formula for e is where n is allowed to go to infinity. This can actually yield very accurate approx... 阅读全文
posted @ 2016-03-20 16:31 cnxo 阅读(104) 评论(0) 推荐(0)
排序算法:归并排序
摘要:归并排序是建立在归并操作上的一种有效的排序算法。该算法是采用分治法(Divide and Conquer)的一个非常典型的应用。归并排序,其的基本思路就是将数组分成二组A,B,如果这二组组内的数据都是有序的,那么就可以很方便的将这二组数据进行排序。如何让这二组组内数据有序了? 可以... 阅读全文
posted @ 2016-03-20 16:00 cnxo 阅读(244) 评论(0) 推荐(0)
HDOJ 1008 Elevator
摘要:Problem Description The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers de... 阅读全文
posted @ 2016-03-18 18:51 cnxo 阅读(107) 评论(0) 推荐(0)
HDOJ 1285 确定比赛名次(拓扑排序)
摘要:Problem Description 有N个比赛队(1<=N<=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结果,即P1赢P2,用P1,P2表示,排名时... 阅读全文
posted @ 2016-03-18 16:58 cnxo 阅读(161) 评论(0) 推荐(0)
Java---软件试用次数(Properties类的简单使用)
摘要:编程练习(软件试用次数) 实现一个如下的软件小功能: 记录软件运行的次数并在每次运行时提示已经运行的次数。如果运行次数大于5次,软件不再运行并给出提示:试用次数已到,请注册!本代码只简单的介绍了软件的使用次数如何限定,很容易让人破解。 如果想让人难以破解,则自己加入算法,或者分开存... 阅读全文
posted @ 2016-03-17 22:19 cnxo 阅读(405) 评论(0) 推荐(0)
HDOJ 2072 单词数
摘要:Problem Description lily的好朋友xiaoou333最近很空,他想了一件没有什么意义的事情,就是统计一篇文章里不同单词的总数。下面你的任务是帮助xiaoou333解决这个问题。Input 有多组数据,每组一行,每组就是一篇小文章。每篇小文章都是由小写字母和空格... 阅读全文
posted @ 2016-03-17 20:29 cnxo 阅读(161) 评论(0) 推荐(0)
HDOJ 1016 Prime Ring Problem素数环【深搜】
摘要:Problem Description A ring is compose of n circles as shown in diagram. Put natural number 1, 2, …, n into each circle separately, and the su... 阅读全文
posted @ 2016-03-17 19:35 cnxo 阅读(172) 评论(0) 推荐(0)
Java---StringBuffer()方法的简单应用
摘要:描述:在实际应用中,经常回遇到对字符串进行动态修改。这时候,String类的功能受到限制,而StringBuffer类可以完成字符串的动态添加、插入和替换等操作。1、构造函数。StringBuffer() : 构造一个没有任何字符的StringBuffer类。 StringBuff... 阅读全文
posted @ 2016-03-15 21:14 cnxo 阅读(2225) 评论(0) 推荐(0)
排序算法:快速排序
摘要:快速排序(Quicksort)是对冒泡排序的一种改进。 在实际中最常用的一种排序算法,速度快,效率高。它的基本思想是:通过一趟排序将要排序的数据分割成独立的两部分,其中一部分的所有数据都比另外一部分的所有数据都要小,然后再按此方法对这两部分数据分别进行快速排序,整个排序过程可以递归... 阅读全文
posted @ 2016-03-15 09:07 cnxo 阅读(189) 评论(0) 推荐(0)
深搜算法:倒油/面向对象的思想来做
摘要:题目:有一位厨师要从盛12斤油(a桶)的桶中倒出6斤油来,可是手边只有盛8斤油(b桶)和盛5斤油(c桶)的两个桶,问如何操作才能将6斤取出来呢?下面为JAVA实现代码: 主类:package cn.hncu.oil.dfs1;import cn.hncu.oil.common.Bu... 阅读全文
posted @ 2016-03-13 02:21 cnxo 阅读(282) 评论(0) 推荐(0)
排序算法:希尔排序
摘要:希尔排序法(缩小增量法) 属于插入类排序,是将整个无序列分割成若干小的子序列分别进行插入排序的方法。 //shell排序/*基本思想:将序列分成几类,在类里将它分成几个小组,再让它在小组内进行排序,依次重复直至排序成功1,找出间距gap(分类)最后间距分类必须为1, 第一重循环2,... 阅读全文
posted @ 2016-03-07 16:08 cnxo 阅读(195) 评论(0) 推荐(0)
排序算法:插入排序
摘要:有一个已经有序的数据序列,要求在这个已经排好的数据序列中插入一个数,但要求插入后此数据序列仍然有序,这个时候就要用到一种新的排序方法——插入排序法将n个元素的数列分为已有序和无序两个部分,如 下所示:{{a1},{a2,a3,a4,…,an}}{{a1⑴,a2⑴},{a3⑴,a4⑴... 阅读全文
posted @ 2016-03-06 23:20 cnxo 阅读(148) 评论(0) 推荐(0)
排序算法:选择排序
摘要:选择排序(Selection sort)是一种简单直观的排序算法。它的工作原理是每一次从待排序的数据元素中选出最小(或最大)的一个元素,存放在序列的起始位置,直到全部待排序的数据元素排完。 平均时间复杂度:O(n2)空间复杂度:O(1) (用于交换和记录索引)package cn... 阅读全文
posted @ 2016-03-05 23:48 cnxo 阅读(137) 评论(0) 推荐(0)
排序算法:冒泡排序
摘要:冒泡排序算法的运作如下:(从后往前)​1.比较相邻的元素。如果第一个比第二个大,就交换他们两个。2.对每一对相邻元素作同样的工作,从开始第一对到结尾的最后一对。在这一点,最后的元素应该会是最大的数。3.针对所有的元素重复以上的步骤,除了最后一个。4.持续每次对越来越少的元素重复上面... 阅读全文
posted @ 2016-03-05 23:37 cnxo 阅读(164) 评论(0) 推荐(0)
HDOJ 2802 F(N)
摘要:Problem Description Giving the N, can you tell me the answer of F(N)?Input Each test case contains a single integer N(1<=N<=10^9). The input... 阅读全文
posted @ 2016-03-01 16:52 cnxo 阅读(105) 评论(0) 推荐(0)
HDOJ 1715 大菲波数
摘要:Problem Description Fibonacci数列,定义如下: f(1)=f(2)=1 f(n)=f(n-1)+f(n-2) n>=3。 计算第n项Fibonacci数值。Input 输入第一行为一个整数N,接下来N行为整数Pi(10){ int ... 阅读全文
posted @ 2016-03-01 15:51 cnxo 阅读(167) 评论(0) 推荐(0)
HDOJ 1214 圆桌会议
摘要:Problem Description HDU ACM集训队的队员在暑假集训时经常要讨论自己在做题中遇到的问题.每当面临自己解决不了的问题时,他们就会围坐在一张圆形的桌子旁进行交流,经过大家的讨论后一般没有解决不了的问题,这也只有HDU ACM集训队特有的圆桌会议,有一天你也可以进... 阅读全文
posted @ 2016-03-01 15:39 cnxo 阅读(103) 评论(0) 推荐(0)