HDU 1520Anniversary party题意:有很多人之间有上下级关系,求没有直接上下级关系去参加party的最多人数。做法:dp[i][0]表示 结点 i 不参加,dp[i][1]表示 结点 i 参加。 1 #include 2 #include 3 #include 4 #includ...
分类:
其他好文 时间:
2015-04-12 10:31:58
阅读次数:
144
Costume Party
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 12297
Accepted: 4891
Description
It's Halloween! Farmer John is taking the cows to a costume ...
分类:
其他好文 时间:
2015-04-10 22:30:22
阅读次数:
117
糖果大战
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 2295 Accepted Submission(s): 787
Problem Description
生日Party结束的那天晚上,剩下了一些糖果...
分类:
其他好文 时间:
2015-04-10 09:40:37
阅读次数:
191
Description
It's Halloween! Farmer John is taking the cows to a costume party, but unfortunately he only has one costume. The costume fits precisely two cows with a length of S (1 ≤ S ≤ 1,000,000)....
分类:
其他好文 时间:
2015-04-09 21:56:32
阅读次数:
141
题意:
给n个数,求它们的最小公倍数。
分析:
lcm(a,b)==a*b/gcd(a,b);
代码:
//poj 3970
//sep9
#include
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b)
{
return a%b==0?b:gcd(b,a%b);
}
int main()
{
int n;
...
分类:
其他好文 时间:
2015-04-04 00:01:43
阅读次数:
500
不是什么难题,但也算自己写的第一个树形DP,留个纪念吧= =
状态方程(dp[0][i]代表不选i人参加聚会时候的最大值,dp[1][i]代表选)
dp[0][pos] = max(dp[0][pos],max(dp[0][e] + dp[0][pos],dp[1][e] + dp[0][pos]));
dp[1][pos] = max(dp[1][pos],dp[1][pos] + dp[0...
分类:
其他好文 时间:
2015-04-02 20:54:46
阅读次数:
132
/* * Hibernate, Relational Persistence for Idiomatic Java * * Copyright (c) 2010, Red Hat Inc. or third-party contributors as * indicated by the @auth...
分类:
编程语言 时间:
2015-04-01 11:15:31
阅读次数:
135
/* * Hibernate, Relational Persistence for Idiomatic Java * * Copyright (c) 2010, Red Hat Inc. or third-party contributors as * indicated by the @auth...
分类:
编程语言 时间:
2015-04-01 11:13:49
阅读次数:
217
6492 Welcome Party For many summers, the Agile Crystal Mining company ran an internship program for students. Theygreatly valued in...
分类:
其他好文 时间:
2015-03-30 22:25:04
阅读次数:
139
题目:天神小学时间限制(普通/Java) : 1000 MS/ 3000 MS 运行内存限制 : 65536 KByte总提交 : 148 测试通过 : 53 题目描述《corpse party:blood drive》中有这么一段,班长筱崎亚由美拿到六鬼门的晶石,导致了涅?的暴走,天小的崩溃,靠着幸子的力量才逃出了天小。(剧情什么的不重要)现在我们假设没有...
分类:
其他好文 时间:
2015-03-30 16:21:38
阅读次数:
201