和上题HDU 3333一样。#include #include #include #include #include #define LL __int64#define lowbit(x) ((x)&(-x))using namespace std;const int N=60050;const i...
分类:
其他好文 时间:
2015-02-04 14:34:50
阅读次数:
194
最长递增子序列——解题报告
题目描述:给定一个数组,长度为n,求出其中最长递增子序列。
分析:这题可以用动态规划求解,遍历i = 1 : n,当第i个数比前面j数大,而且前面的子序列长度加1之后,比现在的第i个子序列长的话,那么就变换。额,晦涩难懂额。。看代码可以好一些。
代码如下:
#include
using namespace std;
...
分类:
其他好文 时间:
2015-02-04 13:06:17
阅读次数:
144
改写要求1:改写为单链表结构可以对任意长度整数集合求并集#include #include using namespace std;struct LinkNode{ int data; LinkNode* next; };class SET{ public: ...
分类:
编程语言 时间:
2015-02-04 12:53:52
阅读次数:
242
改写要求1:改写为以指针为数据结构#include #include using namespace std; class ARP { int m; int* p; int count[10]; public: ARP(int x[],int size...
分类:
编程语言 时间:
2015-02-04 12:51:56
阅读次数:
173
改写要求1:改写为以单链表表示二维数组#include #include using namespace std; struct LinkNode { int Row; int Column; int Data;...
分类:
编程语言 时间:
2015-02-04 12:51:28
阅读次数:
206
改写要求1:改为适合处理超长整数#include #include #include using namespace std;struct LinkNode{ short int data; LinkNode *next;};class STR{ string st...
分类:
编程语言 时间:
2015-02-04 12:49:35
阅读次数:
156
改写要求1:动态生成单链表存储#include #include using namespace std;struct LinkNode{ int data; struct LinkNode *next;};class NUM{ int n; public:...
分类:
编程语言 时间:
2015-02-04 12:48:22
阅读次数:
190
改写要求:重载>>和#include using namespace std;class Fract{ int num,den; public: friend ostream& operator > (istream& int...
分类:
编程语言 时间:
2015-02-04 12:42:38
阅读次数:
156
using System;using System.IO;using System.Security.Cryptography;namespace RijndaelManaged_Example{ class RijndaelExample { public static ...
这道题很简单,但是涉及字符串的读取及常见处理。下面我贴出不同风格的代码:这个题目重要的就是如何读取有空格的字符串。代码1(我自己写的)#include#include#includeusing namespace std;char s[1000];int main(){ while(gets(...
分类:
其他好文 时间:
2015-02-04 10:44:23
阅读次数:
147