- 博客(16)
- 资源 (8)
- 收藏
- 关注
原创 动态规划(练习题目,)
http://www.cnblogs.com/lzmfywz/archive/2012/02/15/2353320.html
2013-10-29 22:09:25 909
原创 最长单调子序列(O(n^2) 和 O(nlogn) 算法)
经典的O(n^2)的动态规划算法设A[i]表示序列中的第i个数,F[i]表示从1到i这一段中以i结尾的最长上升子序列的长度,初始时设F[i] = 0(i = 1, 2, ..., len(A))。则有动态规划方程:F[i] = max{1, F[j] + 1} (j = 1, 2, ..., i - 1, 且A[j] O(nlogn)算法现在,我们仔细考虑计算F[i]时的情况。假
2013-10-29 22:04:03 1179
原创 一个整数划分的多种情况(一堆苹果放到n个盘子)
整数划分问题(放苹果)http://www.cppblog.com/superKiki/archive/2010/05/27/116506.html 整数划分问题 http://www.cnblogs.com/hoodlum1980/archive/2008/10/11/1308493.html
2013-10-29 22:00:25 1118
原创 一个字符串要变成回文串的需要添加的字符最少个数
http://acm.nyist.net/JudgeOnline/problem.php?pid=37/* 求一个字符串要变成回文串的需要添加的字符最少个数 1. 字符串s1反转得到s2 2. 求 s1和s2 的最长公共子序列长度 len 3. 结果为 :strlen(s1)- len */ /***************************# 201
2013-10-29 14:21:18 3431
原创 (n个数选r个全排列)
http://acm.nyist.net/JudgeOnline/problem.php?pid=32输出结果中 不能重复使用(若有543 则不能有345,435等)/***************************# 2013-8-22 15:46:46 # Time: 8MS Memory: 232KB# Author: zyh# Status: Ac
2013-10-27 15:38:58 1311
原创 NYOJ 题目854 留恋
#include#includeint col[10005],row[10005];int main(){ int t,n,m,i,j,x,y; scanf("%d",&t); while(t--){ scanf("%d%d",&n,&m); memset(row,0,sizeof(row)); memset(col,0,sizeof(col));
2013-10-26 23:00:34 892
原创 NYOJ 517 最小公倍数 (1-n 个数的最小公倍数,大数)
http://acm.nyist.net/JudgeOnline/problem.php?pid=517 /* 为什么1小时有60分钟,而不是100分钟呢?这是历史上的习惯导致。 但也并非纯粹的偶然:60是个优秀的数字,它的因子比较多。 事实上,它是1至6的每个数字的倍数。即1,2,3,4,5,6都是可以除尽60。 我们希望寻找到能除尽1至n的的每个数字的最小整数。
2013-10-23 21:47:02 1382
原创 POJ 1220 (两种任意进制之间的转换(大数),java的BigInteger)
http://poj.org/problem?id=1220N进制 向 M进制 转换,1. 先将N进制 转换成10进制;2.将结果逐次对M取余;一开始用BigDecimal,没办法取余;参考大神的,用BigIntegerpackage com.zyh.hdu;import java.math.BigInteger;import java.util.S
2013-10-20 11:12:14 1975
原创 POJ1131 (Java大数 进制转化8-10 )
http://poj.org/problem?id=11318进制小树,转 10进制,跟2进制 转10进制 一样; 每位的数值 * 每位权值 ,在求和;package com.zyh.hdu;import java.math.BigDecimal;import java.util.Scanner;public class Poj1131 { public
2013-10-19 18:18:37 1164
原创 POJ 题目1001 ,hdu1753 (大数,Java简单题)
http://poj.org/problem?id=1001package com.hdu;import java.math.BigDecimal;import java.util.Scanner;public class POJ1001 { public static void main(String[] args) { Scanner cin = new Scanner
2013-10-16 22:22:39 1016
原创 hdu 题目2034(水题),2036(水,简单计算多边形面积),2037(水,贪心,会场安排类)
http://acm.hdu.edu.cn/showproblem.php?pid=2034#include#include#include#includeusing namespace std;int a[110],c[110],n,mark[110];int find(int b){ for(int i=0;i<n;i++){ if(a[i]==b) ret
2013-10-14 22:33:32 889
原创 Java中大数初级使用
http://acm.hdu.edu.cn/showproblem.php?pid=1002大数相加 package com.hdu;import java.math.BigInteger;import java.util.Scanner;public class BigNum { public static void main(String[] args) {
2013-10-13 18:07:49 929
原创 hdu 1039 题目 Easier Done Than Said? (字符串中字符n多条件)
点击打开链接#include#includechar s[55];bool isvol(char c){ if(c=='a' || c=='e' || c=='i' || c=='o' || c=='u') return 1; return 0;}bool is2(int i,int j) { if(s[i]==s[j] && !((s[i]=='e'&&s[j]==
2013-10-13 17:35:15 874
原创 hdu 2072 题目 单词数 (C,C++,Java)
http://acm.hdu.edu.cn/showproblem.php?pid=2072题意:输入一行字符串,求其中不相同的单词数目;C: gets(s); 然后根据“ ”来分离开单词, 然后放到 char【】【】 二维数组中 ,每放一个单词,都检测是否已存在#include#includeint main(){ char s[102],str[1
2013-10-13 15:51:21 2031 1
原创 Java 中的Random()
1. 创建一个程序,让一年级学生练习加法,程序随机产生两个一位整数number1 和number2 ,显示给学生如 what is 7 + 9,学生在输入对话框中敲入答案后,程序显示一个消息对话框,判定答案是true还是false package com.zyh.test;import java.util.Random;import jav
2013-10-06 22:26:41 2673
原创 hdu 题目1003 Max Sum (最大连续子序列和)
http://acm.hdu.edu.cn/showproblem.php?pid=1003 这个如果全是负数的话;最大子序列和不是0; #include int main(){ int n,t,tt,i,tmp,sum,max,tmax,start,end,a0; scanf("%d",&t); for(tt=1;tt<=t;tt++){ sca
2013-10-06 22:22:22 1081
PixateViewsDemo.zip
2015-03-22
pixate.jar
2015-03-22
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人