这种问题以前没有遇见过,折腾了近一天,好歹弄明白了,这个源程序才精妙:/*ID: qq104801LANG: C++TASK: holstein*/#include #include #include #include #include using namespace std;#define VMA...
分类:
其他好文 时间:
2014-09-03 16:21:26
阅读次数:
491
题目链接:HDU 1160 FatMouse's Speed
题意:求体重越重,反而速度越慢的例子,并输出对应的编号。
对speed进行从大到小排序,再求weight的最长上升序列,并输出路径。
AC代码:
#include
#include
#include
using namespace std;
struct Node
{
int weight;
int spee...
分类:
其他好文 时间:
2014-09-03 15:00:16
阅读次数:
214
#include
#include
using namespace std;
typedef long long LL;
const int maxn = 100010;
int pre[maxn], ch[maxn][2], sz[maxn];
int root, top1;
int s[maxn], top2;//内存池
LL sum[maxn];
int val[maxn], add...
分类:
其他好文 时间:
2014-09-03 14:58:56
阅读次数:
264
题目:HDU4907Task schedule(并查集)
题目大意:中文题意自己看。
解题思路:并查集。
代码:
#include
#include
#include
#include
using namespace std;
const int N = 2e5 + 5;
int num[N];
int p[N];
int n, m;
void in...
分类:
其他好文 时间:
2014-09-03 14:58:36
阅读次数:
171
** For the full copyright and license information, please view the LICENSE* file that was distributed with this source code.*/namespace Symfony\Compon...
分类:
其他好文 时间:
2014-09-03 14:33:16
阅读次数:
192
这题写着真累,⊙﹏⊙b汗
各种操作,具体见注释
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define INF 0xfffff...
分类:
其他好文 时间:
2014-09-03 13:08:46
阅读次数:
237
【题意简述】:这个题目描述很短,也很简单。不再赘述。
【分析】:只需再加一个判别这个数是否出现的数组即可,注意这个数组的范围!
// 3388K 0Ms
#include
using namespace std;
#define Max 500001
int a[Max];
bool b[10000000] = {false}; // b的数据范围是可以试出来的…
void i...
分类:
其他好文 时间:
2014-09-03 13:06:06
阅读次数:
132
通过泛型来简化工作的一个Demo,记录一下: using System;using System.Collections.Generic;namespace MyCollection{ public class CBase { private string id = "CBase"; public ...
分类:
其他好文 时间:
2014-09-03 13:00:56
阅读次数:
184
# include
# include
# include
using namespace std;
__int64 gcd(__int64 a,__int64 b)
{
if(b==0)
return a;
return gcd(b,a%b);
}
int main()
{
int n,k,i,j,vis[810],m,num[810],x;
...
分类:
其他好文 时间:
2014-09-03 11:23:25
阅读次数:
192
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{ public class Context { public Context...
分类:
其他好文 时间:
2014-09-03 11:13:16
阅读次数:
204