摘要: 此验证是不可逆转的 public class Passwor { private final static String[] hexDigital = { "0", "1", "2", "3", "4", "5", "6", "7", "8", &q 阅读全文
posted @ 2016-07-27 10:04 -梦里不知身是客 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 首先看看身份号码是如何产生的 : 公民身份证号码是特征组合码,由17位数字本体码和一位校验码组成,排列顺序从左到右依次为 6位数字地址码 ,8位数字出生日期码 3位数字顺序码和1位数字校验码 其中顺序码表示的是同一地域范围内对同年同月同日出生的编订的顺序号 顺序码为奇数的分给男性 偶数的分给女性 校 阅读全文
posted @ 2016-07-27 10:02 -梦里不知身是客 阅读(351) 评论(0) 推荐(0) 编辑
摘要: public class UsingString { public static void testFindStr(String str) { System.out.println("is 的位置"+str.indexOf("is"));//返回第一次出现的位置若找不到返回负数 System.out 阅读全文
posted @ 2016-07-27 09:41 -梦里不知身是客 阅读(106) 评论(0) 推荐(0) 编辑
摘要: class MyCompare implements Comparator//自定义比较方式 要实现Conparator的 compare 方法 { public int compare(Object o1,Object o2)//要比较的类型,这里要是(上帝类) { // int a=((Inte 阅读全文
posted @ 2016-07-27 09:40 -梦里不知身是客 阅读(130) 评论(0) 推荐(0) 编辑
摘要: public class UnrepeatRandomNumber { private int max; private int min; public UnrepeatRandomNumber() { this.max=10; this.min=0; } public UnrepeatRandom 阅读全文
posted @ 2016-07-27 09:07 -梦里不知身是客 阅读(228) 评论(0) 推荐(0) 编辑
摘要: public class TestList { public static void init(List list) { if(list!=null) { list.add("aaa"); list.add("bbb"); list.add("ccc"); list.add("eee"); list 阅读全文
posted @ 2016-07-27 09:05 -梦里不知身是客 阅读(144) 评论(0) 推荐(0) 编辑
摘要: public class UsingArray { public static void output(int[]Array) { if(Array!=null) { for(int i=0;i<Array.length;i++) System.out.print(Array[i]+" "); Sy 阅读全文
posted @ 2016-07-27 09:04 -梦里不知身是客 阅读(173) 评论(0) 推荐(0) 编辑
摘要: Random r1=new Random();//空参数 System.out.println("int :"+r1.nextInt()); System.out.println("Long :"+r1.nextLong()); System.out.println("float :"+r1.nex 阅读全文
posted @ 2016-07-27 09:02 -梦里不知身是客 阅读(107) 评论(0) 推荐(0) 编辑
摘要: DecimalFormat dFormat=new DecimalFormat(); double data =12345.67890; System.out.println("格式化之前的数字: "+data); String pattern="0.0";//如果该位存在字符则显示字符 如果不存在 阅读全文
posted @ 2016-07-27 08:38 -梦里不知身是客 阅读(121) 评论(0) 推荐(0) 编辑
摘要: /** 题意: 给你两个城市之间的道路(无向图),求出需要的 电缆。如果大于所提供的,就输出Not enough 。。。 否则输出所需要的电缆长度。 输入:N (给定的电缆总长度) m1 (有多少个城市—) str1 str2 str3 str4 : ;(城市的名字) m2(相当于给出m2条边) a 阅读全文
posted @ 2016-05-31 17:13 -梦里不知身是客 阅读(141) 评论(0) 推荐(0) 编辑
摘要: /** http://acm.tzc.edu.cn/acmhome/problemdetail.do?&method=showdetail&id=1840 题意: 判断线段是否相交 (包括间接相交) 输入: N(代表有n条线段) sx sy ex ey(一条直线的两端点的坐标) ; ; ; a b( 阅读全文
posted @ 2016-05-30 21:23 -梦里不知身是客 阅读(151) 评论(0) 推荐(0) 编辑
摘要: / 题意: 给出一个01串 按照题目要求可以求出Fun(X)的值 比如: 111 Fun(111)的值是2; 输入: t (t组测试数据) n k (有n位01串 Fun()的值为K) 输出:有多少种组合 使得这n位01串的Fun()值为k; 分析: 动态规划 转移方程 dp[i][j][k] i代 阅读全文
posted @ 2016-05-24 16:15 -梦里不知身是客 阅读(229) 评论(0) 推荐(0) 编辑
摘要: / 区间覆盖问题 分析: 每个点可以确定两个圆心 圆心的范围形成 一个区间 在这个区间上以任意一点画圆便可将此点 包含在内 如果有两个点所确定的区间相交了 说明这两个点可以用一个圆包含在内 即用一个区间的右端点与下一个区间的左短点相比较 所以 用后排的方式 (好像做过的这种题目差不多都是用的后排的方 阅读全文
posted @ 2016-05-24 12:35 -梦里不知身是客 阅读(154) 评论(0) 推荐(0) 编辑
摘要: / 本题的关键是 一次判断两个字符从而确定化学式的分子质量 直接模拟 / include include include include using namespace std; char s[50]; int jieQu(char s1)///截取等于号后面的第一个化学式 { int n=strl 阅读全文
posted @ 2016-05-23 16:48 -梦里不知身是客 阅读(136) 评论(0) 推荐(0) 编辑
摘要: / 优先队列加拓扑排序 / include include include include using namespace std; vectoredge[500 500]; int du[550]; void creatLinJieBiao(int x,int y) { edge[x].push_ 阅读全文
posted @ 2016-05-17 19:05 -梦里不知身是客 阅读(169) 评论(0) 推荐(0) 编辑
摘要: / http://acm.nyist.net/JudgeOnline/problem.php?pid=547 题意: 有一个正方形的区域 区域上面有高度不同的1 1的立方体自然有凸有凹 凹的地方可以储水 问一共可以储存多少水 分析: 每次都从最低的边界向内部注水(仅与边界相邻的内部) 如果能够注水 阅读全文
posted @ 2016-05-17 16:52 -梦里不知身是客 阅读(179) 评论(0) 推荐(0) 编辑
摘要: include include include include include include include using namespace std; ///找出入度为0的有且只有一个即可以产生冠军,不用拓扑排序 int du[2005]; bool panDuan(int n)///判断所有点的 阅读全文
posted @ 2016-05-16 21:06 -梦里不知身是客 阅读(174) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2647 题意: 老板要给n个员工发工资最低工资是888; 但是工人们是有要求的 如果输入 a b 表示a的工资要比b的工资高 求出老板最少准备多少工资 include include include include 阅读全文
posted @ 2016-05-16 18:48 -梦里不知身是客 阅读(170) 评论(0) 推荐(0) 编辑
摘要: ![](http://images2015.cnblogs.com/blog/732353/201605/732353-20160510210903296-893156067.jpg) 阅读全文
posted @ 2016-05-10 21:10 -梦里不知身是客 阅读(144) 评论(0) 推荐(0) 编辑
摘要: include const int inf=0x3f3f3f3f; int main() { int m,n; scanf("%d%d",&n,&m); int u[n+1],v[n+1],w[n+1]; for(int i=1; idis[u[i]]+w[i]) dis[v[i]]=dis[u[i 阅读全文
posted @ 2016-05-10 21:08 -梦里不知身是客 阅读(181) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1258 include include include include using namespace std; int sum,n; int a[1005],b[1005],c[1005],op=0; void 阅读全文
posted @ 2016-05-09 20:00 -梦里不知身是客 阅读(333) 评论(0) 推荐(0) 编辑
摘要: / http://acm.hdu.edu.cn/showproblem.php?pid=1114 完全背包问题 再判断背包能否装满 题意: 给出存空钱罐的重量以及装满时的重量 给出每种硬币的面值以及重量 求 存钱罐装满时的最小价值。。。若不能装满输出This is impossible 值得注意的两 阅读全文
posted @ 2016-05-04 19:22 -梦里不知身是客 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 本题思路对了就很好写 数塔的变形 从第5秒之后可能走的位置就在0到10内 仔细分析 和以前做的题目的区别与联系 c++ include include include include using namespace std; int dp[100005][15]; int main() { int 阅读全文
posted @ 2016-04-29 17:46 -梦里不知身是客 阅读(112) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/webcontest/contest_showproblem.php?cid=10541&pid=1006&ojid=0 本题和数塔差不多 找出所有到当前位置的方案,然后取用时最短的 如图 include include using namespace s 阅读全文
posted @ 2016-04-28 17:19 -梦里不知身是客 阅读(287) 评论(0) 推荐(0) 编辑
摘要: / 第一个多重背包题目 真的不理解二进制优化 /http://acm.hdu.edu.cn/webcontest/contest_showproblem.php?cid=10594&pid=1001&ojid 以下是用二进制优化的 不会超时 下面是搜索做的 比多重背包快了很多 include inc 阅读全文
posted @ 2016-04-25 20:45 -梦里不知身是客 阅读(362) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2639 / 第一行输入t 代表t组测试数据 第二行 输入物品个数 背包容量 要求的第k大值 物品的价值 物品的重量 分析: 平常我们用的dp[j]=max(dp[j],dp[j w[i]]+v[i]);所求的就是最 阅读全文
posted @ 2016-04-25 16:26 -梦里不知身是客 阅读(269) 评论(0) 推荐(0) 编辑
摘要: / http://acm.hdu.edu.cn/showproblem.php?pid=2159 分析: 和普通的完全背包没有什么太大的区别 但是题目中给出了限制最多可杀s个怪 用二维数组dp[i][j] 表示在所用j忍耐度下杀了 i个人是获得最大的经验值 然后遍历这些经验值 大于最大升级所需经验即 阅读全文
posted @ 2016-04-24 15:19 -梦里不知身是客 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 二维的就不用记了 二维的容易理解 看看一的 给一个在线生成的01背包的过程网址 http://karaffeltut.com/NEWKaraffeltutCom/Knapsack/knapsack.html(需FQ) 一组测试数据 背包容量 c =10 物品数量 n=5 每个物品的价值 v[]=5 阅读全文
posted @ 2016-04-22 16:51 -梦里不知身是客 阅读(336) 评论(0) 推荐(0) 编辑
摘要: http://acm.tzc.edu.cn/acmhome/problemdetail.do?&method=showdetail&id=2679 / 分析: dp[i][j] 代表i个苹果 j个盘子时有多少放法 有如下几种情况 1: 苹果的个数为1时 只有一种方法 2: 盘子的个数为1时 只有一种 阅读全文
posted @ 2016-04-07 20:03 -梦里不知身是客 阅读(669) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1003 / 给组测试数据 1 7 2 3 4 5 6 7 8 一个关键问题 : 什么时候将开始位置重新赋值 即当连续序列和小于等于零时 / include int main() { int t; scanf("%d 阅读全文
posted @ 2016-04-07 17:02 -梦里不知身是客 阅读(167) 评论(0) 推荐(0) 编辑