/*#include
using namespace std;
//2014!里面0的个数.
int Giral(int x)
{
int i=0;
int j=0;
while(x)
{
int sum = x;
if(x%2==0)
{
while(x%2==0)
{
x/=2;
i++;
}
}
if(x%5==0)
...
分类:
编程语言 时间:
2015-04-25 22:51:11
阅读次数:
283
POJ1226——Substrings
题意,给定一堆字符串,找出最大的公共子串。
//Date: 2015.04.25
//Time: 0ms
//Memory: 144k
#include
#include
using namespace std;
const int MAX_LEN=105;
int n,index,length;
char str[100][...
分类:
其他好文 时间:
2015-04-25 22:50:44
阅读次数:
161
水题一枚,乍看还以为是最长上升子序列,其实也差不多啦
//dp[i]表示到达第i个点时能取得的最大分值,注意这里是到达该点,而不是前i个点
#include
#include
#include
using namespace std;
int dp[1005],a[1005];
int main(){
#ifndef ONLINE_JUDGE
freopen("in.txt","r",st...
分类:
其他好文 时间:
2015-04-25 22:49:19
阅读次数:
127
//C++ 在堆上开辟与释放二维、三维指针
#include
using namespace std;
int main()
{
//二级指针的开辟与释放
int number = 0;
int** p = new int*[4];
for(int i = 0; i
{
p[i] = new int[4];
}...
分类:
编程语言 时间:
2015-04-25 22:48:07
阅读次数:
176
参考了别人的代码的总结1.四柱汉诺塔问题和n柱汉诺塔问题
题目:#include
#include
#include
using namespace std;
double f[70];void init() {
f[1] = 1;
f[2] = 3; for(int i = 3; i <= 65; i++) {...
分类:
其他好文 时间:
2015-04-25 22:46:20
阅读次数:
186
#include #include //#include using namespace std;int main () { int myints[] = {32,71,12,45,26,67,53,68}; int l=sizeof(myints)/sizeof(myints[0]);//数组.....
分类:
编程语言 时间:
2015-04-25 22:28:28
阅读次数:
254
和nyoj613(免费馅饼)一样的原理 从下 网上依次遍历 存贮最大值
#include
#include
using namespace std;
int main()
{
int n,num[105][105]={0};
scanf("%d",&n);
for(int i=1;i<=n;i++)
for(int j=1;j<=i;j++)
scanf("%d",&num[i]...
分类:
其他好文 时间:
2015-04-25 21:18:00
阅读次数:
148
给出一个序列,求所有上升序列中和最大的一个值m,(该序列不一定连续)
例如4 1 3 2 4这组数据的结果为8
#include
#include
#define maxn 1000+5
using namespace std;
int rem[maxn],dp[maxn];
int main()
{
int n;
while(cin>>n&&n)
{
for(int i=0;i>r...
分类:
其他好文 时间:
2015-04-25 21:17:00
阅读次数:
145
Two elements of a binary search tree (BST) are swapped by mistake.
Recover the tree without changing its structure.
Note:
A solution using O(n)
space is pretty straight forward. Could you devis...
分类:
其他好文 时间:
2015-04-25 21:15:52
阅读次数:
186
using System;using System.Collections.Generic;using System.Linq;using System.Windows.Forms;using JxsFL.CaiGou;using JxsFL.CangKu;using JxsFL.CangKu.Ou...